I’ve written a small windows mobile application, which intercepts incoming SMS and does some processing on them.
After selling about 30 of these apps on windows marketplace I noticed a problem. The problem does (so far) only occur on one device:
the HTC HD2.
The problem is quite simple: I attach my program to a system service called MessageInterceptor like this:
private void RegisterInterceptor()
{
_msgInterceptor = new MessageInterceptor(InterceptionAction.Notify, true);
_msgInterceptor.MessageReceived += new MessageInterceptorEventHandler (_msgInterceptor_MessageReceived);
String appPath = Assembly.GetExecutingAssembly().GetName().CodeBase;
_msgInterceptor.EnableApplicationLauncher(_appID, appPath, "Program started by System");
}
void _msgInterceptor_MessageReceived(object sender, MessageInterceptorEventArgs e)
{
SmsMessage sm = e.Message as SmsMessage;
if (sm != null)
labelMsgReceived.Text = "SMS rcvd \"" + sm.Body + "\"";
else
labelMsgReceived.Text = "Unknown message rcvd";
}
This usually does work nicely. Just on these HTC HD2 this event never is called.
I do not own a HTC HD2, so I can’t test the device myself. I heard rumors, that there do exist some HD2 where this does work as expected, but so far I got no confirmation about this.
I’m looking for a workaround.
Is there something on the HD2 which does disable this function?
Are there other ways to intercept SMS which I might use?
Might be something to do with HTC Sense which effectively replaces large swathes of the standard UI, including the default SMS application – it may be the case that PocketOutlook, which normally fires the message interceptors isn’t even being loaded.
I’ve tested using the example code form MSDN, and that doesn’t appear to work on a HD2, which matches what you’re seeing.