Kevin
Kevin

Reputation: 2730

Are there new requirements for a voip app in ios 8?

I have a voip app, but it won't wake up from standby mode when a call comes in. The docs say the following:

There are several requirements for implementing a VoIP app:

 1. Enable the Voice over IP background mode for your app. (Because VoIP
    apps involve audio content, it is recommended that you also enable
    the Audio and AirPlay background mode.) You enable background modes
    in the Capabilities tab of your Xcode project.
 // I did this using the "capabilities" tab in the project's settings.  
 // I have "audio and airplay", "voice over ip",  
 // "background fetch" and "remote notifications" checked.

 2. Configure one of the app’s sockets for VoIP usage.
 // I have 2 sockets, one for sending stuff to the server that closes after sending.  
 // One socket that stays alive all the time, which is used to  
 // receive stuff from the server.  
 // The one that stays alive is configured as voip*.

 3. Before moving to the background, call the
    setKeepAliveTimeout:handler: method to install a handler to be
    executed periodically. Your app can use this handler to maintain its
    service connection.
 // I did this and in the handler I send a login message to the server,  
 // On the server side it's detected that the account is already logged in so  
 // it refreshes the connection instead.

 4. Configure your audio session to handle transitions to and from active use.  
 // I did not do this yet, I might in the future.

 5. To ensure a better user experience on iPhone, use the Core Telephony
    framework to adjust your behavior in relation to cell-based phone
    calls; see Core Telephony Framework Reference.
 // I did not do this and probably never will (company's decision, not mine).

 6. To ensure good performance for your VoIP app, use the System
    Configuration framework to detect network changes and allow your app
    to sleep as much as possible.
 // I don't do this yet, but will implement it once all the basics run fine.

When a call comes in I create a local notification to let the user know about the call. When the app is minimized this works fine, but when the device is in standby (sleep) there is no notification. When I wake the device from standby, the notification pops up after a few seconds (so it's not already there, it really appears after waking up the device).

I created more voip apps in the past, and I can't remember ever having trouble with this. I'm running ios 8 now, perhaps I have to do some more to make it work while in standby? Are there more requirements for voip now? Or am I missing something stupid?

Note: I know about push notifications. They are an option (in fact, I already tested and they make it work), but I'd rather not be dependent on the apns.

Upvotes: 0

Views: 900

Answers (2)

haroldbasset
haroldbasset

Reputation: 11

I just spent two full days troubleshooting a similar problem. An iPhone 6+ worked properly but neither of two iPhone 6's did. To make a long story short, SIP packets were not being transmitted reliably. I pinged the VOIP servers offered me and found that I was using one with a latency of 30 milliseconds but one with 15 milliseconds' latency was available, so I tried switching servers. That did the trick.

Upvotes: 1

CarlesCF
CarlesCF

Reputation: 205

Be aware that if the user closes the App manually (double click home button, swipe up) your application will not be able to run in the background until the user manually opens it up.

However, the system does not automatically launch your app if the user has force-quit it. In that situation, the user must relaunch your app or restart the device before the system attempts to launch your app automatically again.

Check it here.

Upvotes: 0

Related Questions