iPhone: How to Programmatically Respond to SMS Messages

Tall Jeff picture Tall Jeff · Dec 23, 2008 · Viewed 12.9k times · Source

After a review of the iPhone SDK documentation, I have not yet found a way for an application to be written such that it can programmatically process the content of an incoming SMS message within the iPhone platform. The idea would be for such an application to be running in the background and based on specifically formatted SMS messages would be able to take specific actions.

Does anybody know if this is possible with an iPhone SDK application and if so, provide a pointer to information about how this can be done?

Answer

Brad The App Guy picture Brad The App Guy · Dec 23, 2008

Unfortunately, you cannot intercept - or be notified of - incoming SMS messages with the iPhone SDK.

One possible alternative, is to register a custom URL scheme that launches your application when a url with that scheme is embedded in the sms message and the user cicks on it.

to set a custom url scheme, you must implement both the CFBundleURLSchemes and CFBundleURLName keys in your application's info.plist.

In your Application's delegate, you can then implement the application:handleOpenURL: method to get any paramaters that were passed to your App from the url in the SMS message.