Reputation: 13371
I've answered two different questions now, both explaining how VOIP apps don't start on start-up, yet people seem to think they do.
I'm not 100% sure myself, someone linked me to a part of the apple docs, which doesn't really mention anything about auto-starting of apps.
I was originally going on prior knowledge and this answer, but after another person saying that they do, I'm really not sure.
As far as I'm aware, apps only react to push notifications, and can't be launched into the background when a device is turned on.
Can we please clarify whether it is possible to auto-start an app or not?
Upvotes: 27
Views: 39365
Reputation: 12505
I have been developing VoIP apps and I can confirm that VoIP app will autostart when iPhone reboots as long as user doesn't kill it before reboot. When iOS autostart voip app only application:didFinishLaunchingWithOptions:
will be run, i.e. applicationDidBecomeActive:
won't be run.
I used to doubt whether iOS will automatically restart the voip app when it crashes. After investigating I find iOS does automatically restart the voip app but if it keeps crashing iOS will then try servals time before it finally gives up.
If you check iPhone console output from xcode, you can see logs like these after the first crash
..
Service exited due to signal: Abort trap: xxx
Unable to get short BSD proc info for xxxx: No such process
Application 'UIKitApplication:xxxxx]' crashed.
...
Upvotes: 1
Reputation: 77
OK, I don't know if this classifies as an answer but I feel obligated to say. I am developing an app that both tracks significant location changes and provides VoIP features. The app has voip
key in Required background modes. I tried some cases which I would like to share the results:
When booted, app is running in background, as well as other apps that were running before. I do not think this is related to VoIP in any way.
When booted, the app is not running, there are no logs in configuration utility, server says the user is not registered I cannot call it from other devices; and yet the other apps that are not related to voip or location tracking but were open before turning off are at least loaded in memory. Meaning, the voip
key did not work.
I have continued the test with the same app but this time downloaded it from app store. The results are the same. Changed the device and os to iPhone 3G (product name: iPhone2,1) and iOS 6.1.6 (10B500). Nothing changed both in debug and release modes.
I have told my boss that Apple provides this behavior and it can be done. Then I had second thoughts and tried, now I am desperately trying to find another way. Going to send my regards to Apple about this.
Upvotes: 3
Reputation: 61
I confirm that setting VOIP mode works. However, I've found that the app won't restart after power up unless it was running when the device was powered off. Furthermore, the app won't actually restart on the recently powered up device until the device is unlocked after power up.
Upvotes: 6
Reputation: 481
Significant location change or region monitoring also causes an app to launch on boot as long as its turned on and left on. No UIBackgroundModes key is necessary for this.
Upvotes: 0
Reputation: 60150
Take a look at the UIBackgroundModes section in this document - it seems to state that adding the voip
key will autostart an app on boot.
Edit: a sample app seems to confirm this behavior.
Upvotes: 32
Reputation: 27536
You can not launch an application without user interaction. The user has to click on the app icon, on push notifications, on a custom link. May be there are other ways I am not aware of, but even if they exist, they require user interaction to intentionally launch the app.
Edit
It turns out, as Tim mentioned, there might be an exception for VOIP apps.
Upvotes: 2