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.
我现在回答了两个不同的问题,两个问题都解释了VOIP应用程序如何在启动时没有启动,但人们似乎认为他们这样做了。
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?
我们可以澄清是否可以自动启动应用程序?
6 个解决方案
#1
29
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.
看一下本文档中的UIBackgroundModes部分 - 它似乎表明添加voip密钥将在启动时自动启动应用程序。
Edit: a sample app seems to confirm this behavior.
编辑:示例应用程序似乎确认此行为。
#2
5
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.
我确认设置VOIP模式有效。但是,我发现应用程序在启动后不会重新启动,除非它在设备断电时运行。此外,应用程序实际上不会在最近通电的设备上重新启动,直到设备在加电后解锁。
#3
3
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:
好的,我不知道这是否归类为答案,但我觉得有义务说。我正在开发一个既能跟踪重要位置变化又能提供VoIP功能的应用程序。该应用程序在所需的后台模式中具有voip键。我尝试了一些我想分享结果的案例:
- App is in Debug mode - Turned off while app was running (active or background) - iOS 7.1.1 (11D201) and iPhone 4 (product name: iPhone3,2):
- 应用程序处于调试模式 - 在应用程序运行时关闭(活动或后台) - iOS 7.1.1(11D201)和iPhone 4(产品名称:iPhone3,2):
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.
启动时,应用程序在后台运行,以及之前运行的其他应用程序。我不认为这与VoIP有任何关系。
- App is in Debug mode - Turned off while app was terminated - iOS 7.1.1 (11D201) and iPhone 4 (product name: iPhone3,2):
- 应用程序处于调试模式 - 应用程序终止时关闭 - iOS 7.1.1(11D201)和iPhone 4(产品名称:iPhone3,2):
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.
启动时,应用程序未运行,配置实用程序中没有日志,服务器表示用户未注册我无法从其他设备调用它;但是其他与voip或位置跟踪无关但在关闭前打开的应用程序至少会加载到内存中。意思是,voip键不起作用。
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.
我继续使用相同的应用程序进行测试,但这次是从应用程序商店下载的。结果是一样的。将设备和操作系统更改为iPhone 3G(产品名称:iPhone2,1)和iOS 6.1.6(10B500)。调试和释放模式都没有改变。
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.
我告诉我的老板,Apple提供了这种行为并且可以完成。然后我有了第二个想法并尝试过,现在我拼命想找到另一种方式。打算向Apple致以诚挚的问候。
#4
2
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.
事实证明,正如Tim所说,VOIP应用程序可能存在例外情况。
#5
0
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.
重要的位置更改或区域监控也会导致应用程序在启动时启动,只要它打开并保持打开状态。没有UIBackgroundModes键是必需的。
#6
0
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.
我一直在开发VoIP应用程序,我可以确认,当iPhone重新启动时,只要用户在重启之前没有杀死它,VoIP应用程序就会自动启动。当iOS自动启动voip app only应用程序:didFinishLaunchingWithOptions:将运行,即applicationDidBecomeActive:将不会运行。
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.
我曾经怀疑iOS是否会在崩溃时自动重启voip应用程序。经过调查我发现iOS确实会自动重启voip应用程序,但如果它一直崩溃,iOS会在最终放弃之前尝试servals时间。
If you check iPhone console output from xcode, you can see logs like these after the first crash
如果您从xcode检查iPhone控制台输出,您可以在第一次崩溃后看到这些日志
..
Service exited due to signal: Abort trap: xxx
Unable to get short BSD proc info for xxxx: No such process
Application 'UIKitApplication:xxxxx]' crashed.
...
#1
29
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.
看一下本文档中的UIBackgroundModes部分 - 它似乎表明添加voip密钥将在启动时自动启动应用程序。
Edit: a sample app seems to confirm this behavior.
编辑:示例应用程序似乎确认此行为。
#2
5
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.
我确认设置VOIP模式有效。但是,我发现应用程序在启动后不会重新启动,除非它在设备断电时运行。此外,应用程序实际上不会在最近通电的设备上重新启动,直到设备在加电后解锁。
#3
3
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:
好的,我不知道这是否归类为答案,但我觉得有义务说。我正在开发一个既能跟踪重要位置变化又能提供VoIP功能的应用程序。该应用程序在所需的后台模式中具有voip键。我尝试了一些我想分享结果的案例:
- App is in Debug mode - Turned off while app was running (active or background) - iOS 7.1.1 (11D201) and iPhone 4 (product name: iPhone3,2):
- 应用程序处于调试模式 - 在应用程序运行时关闭(活动或后台) - iOS 7.1.1(11D201)和iPhone 4(产品名称:iPhone3,2):
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.
启动时,应用程序在后台运行,以及之前运行的其他应用程序。我不认为这与VoIP有任何关系。
- App is in Debug mode - Turned off while app was terminated - iOS 7.1.1 (11D201) and iPhone 4 (product name: iPhone3,2):
- 应用程序处于调试模式 - 应用程序终止时关闭 - iOS 7.1.1(11D201)和iPhone 4(产品名称:iPhone3,2):
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.
启动时,应用程序未运行,配置实用程序中没有日志,服务器表示用户未注册我无法从其他设备调用它;但是其他与voip或位置跟踪无关但在关闭前打开的应用程序至少会加载到内存中。意思是,voip键不起作用。
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.
我继续使用相同的应用程序进行测试,但这次是从应用程序商店下载的。结果是一样的。将设备和操作系统更改为iPhone 3G(产品名称:iPhone2,1)和iOS 6.1.6(10B500)。调试和释放模式都没有改变。
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.
我告诉我的老板,Apple提供了这种行为并且可以完成。然后我有了第二个想法并尝试过,现在我拼命想找到另一种方式。打算向Apple致以诚挚的问候。
#4
2
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.
事实证明,正如Tim所说,VOIP应用程序可能存在例外情况。
#5
0
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.
重要的位置更改或区域监控也会导致应用程序在启动时启动,只要它打开并保持打开状态。没有UIBackgroundModes键是必需的。
#6
0
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.
我一直在开发VoIP应用程序,我可以确认,当iPhone重新启动时,只要用户在重启之前没有杀死它,VoIP应用程序就会自动启动。当iOS自动启动voip app only应用程序:didFinishLaunchingWithOptions:将运行,即applicationDidBecomeActive:将不会运行。
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.
我曾经怀疑iOS是否会在崩溃时自动重启voip应用程序。经过调查我发现iOS确实会自动重启voip应用程序,但如果它一直崩溃,iOS会在最终放弃之前尝试servals时间。
If you check iPhone console output from xcode, you can see logs like these after the first crash
如果您从xcode检查iPhone控制台输出,您可以在第一次崩溃后看到这些日志
..
Service exited due to signal: Abort trap: xxx
Unable to get short BSD proc info for xxxx: No such process
Application 'UIKitApplication:xxxxx]' crashed.
...