开发者

iPhone Dev: Can you have a program running in background respond to SMS in iOS4+?

Can you have a program running in background respond to SMS? I basically want my program to sit in the background so the will be iOS4+ and when someone text messages you, the app can then do something with that text.

Can this be done?

I have seen that the question has been asked before,开发者_开发百科 but it was before the iphone could have background apps.


No backgrounding is very limited on IOS. There is only a handful of stuff you can do. You can always send push notifications to get an alert while the app is not running in the foreground.

From Apple:

OS 4 delivers seven new multitasking services that allow your apps to perform tasks in the background while preserving battery life and performance. These multitasking services include:

Background audio - Allows your app to play audio continuously. So customers can listen to your app while they surf the web, play games, and more. Voice over IP - Your VoIP apps can now be even better. Users can now receive VoIP calls and have conversations while using another app. Your users can even receive calls when their phones are locked in their pocket.

Background location - Navigation apps can now continue to guide users who are listening to their iPods, or using other apps. iOS 4 also provides a new and battery-efficient way to monitor location when users move between cell towers. This is a great way for your social networking apps to keep track of users and their friends' locations.

Push notifications - Receive alerts from your remote servers even when your app isn't running.

Local notifications - Your app can now alert users of scheduled events and alarms in the background, no servers required.

Task finishing - If your app is in mid-task when your customer leaves it, the app can now keep running to finish the task.

Fast app switching - All developers should take advantage of fast app switching, which allows users to leave your app and come right back to where they were when they left - no more having to reload the app.


Nope. The only way for your application to be "called" when it's not already open is by sending a push notification.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜