Question

I'm developing an iOS app that sends sms. What's the best way to handle a incoming message when the app is active. Is this done automatically or do I have to code for this in my app via the

applicationWillResignActive:(UIApplication *)application

method?

Was it helpful?

Solution

You don't need to/shouldn't need to deal with incoming SMSs.

When the device receives an SMS (or an iMessage these days), then the user will be notified by their method of choice. They may leave your application via that notification, but you cannot determine that it was the SMS that caused it.

CoreTelephony provides some abilities for people to deal with Calls, but nothing to do with SMS. Sorry. As such your app cannot determine the state of SMS messages. You're able to send SMS messages because the OS provides you with a view controller to do so, but you can't do anything else with them.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top