Reputation: 1073
I'm trying to configure Twilio client to be able to receive incoming calls if app is in background.
I've given the app the VOIP and Audio Background Capabilities. I've set -(void)device:(TCDevice*)device didReceiveIncomingConnection:(TCConnection*)connection
to fire a local notification. Trouble is, the only time this works is if the app is running.
If I reboot the phone or launch the app and then send the app to the background, it appears as though the incoming call is not getting received yet and I get dead air when I call it.
(I'm using a telephone number that has a verb that points to the client in question for testing).
Everything works fine if I have app in foreground and accept the call and press home button, the call stays up. It's specifically background inbound call handling that I'm shooting for here.
Upvotes: 3
Views: 903
Reputation: 10366
Twilio evangelist here.
Did you add the "Required background modes" key to your apps plist file? If not you need to add the "App Plays Audio" and "App Provides Voice over IP services" flags. Check out the One Last Step section of this blog post:
https://www.twilio.com/blog/2013/08/installing-twilio-client-for-ios-using-cocoapods-2.html
Hope that helps.
Upvotes: 1