tags:

views:

5918

answers:

5

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?

+3  A: 

I believe that currently the SDK doesn't allow for background apps (except for apple ones).

frankodwyer
+11  A: 

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.

Brad Smith
Excellent information!
Frank Krueger
Thanks this IS helpful
Tall Jeff
+1  A: 

BREW and J2ME had (and probably still have) ways to launch your app via specially formatted SMS, which may be what the Jeff is referring to.

Apple does have the upcoming Push Server which will allow you to send the user an alert which will give them the option of launching your app, but you cannot launch your app for them.

Genericrich
A: 

is there a possibility to read received SMS messages ?

NccWarp9
Post a new question if you want to ask something different to the current one!
Dan J
+1  A: 

Unfortunately, just registering an URL scheme dosn't help you at all, because the SMS app makes "http://" urls clickable only...

aldi
If this is true, perhaps you could set up a web server whose only job is to redirect the browser to a non-http url when someone clicks that link?
Jesse Rusak
This workaround works, but again involves a 3rd component, which isn't the actual intention of custom url schemas, is it? Feels weired to send an SMS to the users, which requires him to tap a http link, which opens Safari and redirects it to a custom URL, which closes Safari and launches the app...
aldi