Even with "voip" present in "UIBackgroundModes" in "plist", the iOS application does not start automatically after rebooting the device in iOS10

I need my VoIP application to start automatically after rebooting the device.

Apple documents clearly state that: -

(========= EDIT: This is from Apple white papers, please take a look at this before commenting or answering the question that the application cannot be launched without user intervention or silent push notification. Look at the project Github below, people tested this behavior)

Values ​​for the UIBackgroundModes Array

Value: voip Description. The application provides Voice-over-IP services. Applications with this key automatically start after the system boots , so the application can restore VoIP services. Applications with this key are also allowed to play background sound.

https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html#//apple_ref/doc/uid/TP40009252-SW1

Here is a screenshot from Apple Docs.

I have ensured that: -

  • The application was launched when the device was disconnected.
  • VoIP is present in the plist and Capabilities section.
  • Make sure that the application does not start after rebooting the device by adding the logs to the file in the main method and application:didFinishLaunchingWithOptions: method.
  • The device’s screen is unlocked at least once after rebooting the device.

enter image description here

enter image description here

I even tried to run this 36-star GitHub sample application to test the startup download. https://github.com/lithium3141/BootLaunch
But even this application does not restart on reboot when I tried on the device.

Therefore, does it make me think that something was recently changed in iOS10, or am I still not seeing something here?

+8
ios iphone swift plist voip
source share
2 answers

Well, I explored this a little further, but first I have to point out that I did not test it, actually trying to build a project for this, as now it would be too laborious for me.

I found this (already mentioned in the comments), this , and, most importantly, this tech Q & A.

What I have compiled, especially from various comments by Apple technicians in these threads, looks like the behavior of iOS 10 has really changed. This means that the same code that is connected to VoiP servers in previous versions of iOS will no longer do this if you link your assembly to the latest version of the SDK, that is, to iOS 10.

Now, in your case, you really don't need a real VoiP connection, right? You are just interested in the "start after reboot" functionality, right? At least the demo project that you linked actually does not use any VoiP connection, the setKeepAliveTimeout:handler: method, for example, is not even implemented. I know that this particular issue is not discussed in related threads or is not addressed in Q & A, BUT:

It makes sense that along with all the outdated VoiP behavior, the reboot function also disappears. If you switched to the VoiP Push-Kit, your application did not need to be launched after a restart, it will restart after the next remote notification arrives (and VoiP notifications have a high priority, so there may be no delay).

Obviously, I subtract the rationale for this whole goal here and cannot guarantee that Apple really thinks about it, but it makes sense: the whole reason for the (former) VoiP application to be (re) launched after reboot was because it needed to establish a connection, that is, he needed to run some code. With push notifications that are no longer needed (the OS basically does this behind the scenes to receive these notifications), it makes sense that they completely removed this functionality along with the whole outdated VoiP approach.

You can test this by compiling against the old SDK (i.e. use Xcode 7 as suggested by Q & A) and see if it will resume. This Apple employee actually explained that the OS really distinguishes the build SDK for applications, which is completely contrary to intuition for me. Apparently, in this case, he would have decided "hey, this is an older application, so it is expected that it will be restarted because its SDK was documented that way" for applications based on Xcode 7 and "Oh, this application is new, so I do not otherwise need to stick to the old ways. " Wowsies.


TL; DR . It seems to me that yes, the iOS SDK has changed this behavior, and also left the whole old VoiP method without notice. Compiling with the new SDKs will cause applications to not restart after a reboot.

For the record: I can understand the evil people in these streams. Although there may be technical reasons for the change, this specific consequence was far from obvious. If the method is deprecated, but the project is still compiling and starting, I would not expect such a process to fail. These applications do not crash, they are just “handled differently by the OS”, which is not exactly the same. At least I was expecting the documentation to become more clear in the new SDK.

+2
source share

The application will be called in the background when it is in completion mode, only with a quiet push kit notification and certificates should be generated for the push set, and not with the usual APNS notification and normal push notification certificates.

From the back, your payload should be like that.

 $body['aps'] = array( 'content-available'=> 1, 'alert' => $message, 'sound' => 'default', 'badge' => 0, ); 

Once you get the pushkit payload, then schedule a local notification with the sound file, your application will be called in the background to play the sound files (maximum 30 seconds). Then you need to complete the background task.

Please provide some important information about the step-by-step process of push kit integration.

https://github.com/hasyapanchasara/PushKit_SilentPushNotification

Application Life Cycle - When an application terminates and a set payload is pressed

  • First of all

    didFinishLaunchingWithOptions // will call

  • Then

    didReceiveIncomingPushWithPayload // the payload method calls the call

  • Then, if you have a local notification

    didReceiveLocalNotification // receive local notification

  • Then

    handleActionWithIdentifier // handler method, if you have action buttons (local)

  • Then, if you have a remote notification

    didReceiveRemoteNotification // receive remote notification

  • Then

    handleActionWithIdentifier // handler method, if you have action buttons (deleted)

Note. . Without clicking on the application icon or getting a payload on the push kit, your application will never automatically cancel / open / regenerate. If you want your application to be based on VOIP, and the application will be canceled after rebooting the device. Impossible.

0
source share

All Articles