2

In iPhone/iPad applications like Tango and Viber, you can make in app calls like phone calls. I mean when you make a call, the other client's phone rings and the answer option appears on the bottom side of the screen. It is not a push notification, it is a call which can be answered or declined.

It does not differ even if the application is running on the background on the iPhone which is being called, the call appears on the screen with answer option. Also if you cancel the call it disappears on the other phone which is being called. Shortly it is exactly like a phone call but it is not, it is an in-app call.

How can that kind of functionality be implemented?

1 Answers1

1

You need to implement VOIP background mode in your app. Once you implement it, your app will be started in the background and will have the opportunity to open a connection toward your server and maintain it, so you can show the incoming call screen for your users.

Léo Natan
  • 56,823
  • 9
  • 150
  • 195
  • If I have background permissions, and I am running the app. How can I display an incoming dialog to the user similar to Viber? UILocalNotification has been suggested, but as far as I know, you cannot go to the app from those, they are used for display purposes only.. – Pacemaker Apr 14 '15 at 17:39
  • 1
    This is not true. With a local notification, the default action opens the application. – Léo Natan Apr 14 '15 at 19:42
  • Leo's answer above is exactly correct. Here are some links to help you get started. https://developer.apple.com/library/ios/documentation/iphone/conceptual/iphoneosprogrammingguide/AdvancedAppTricks/AdvancedAppTricks.html#//apple_ref/doc/uid/TP40007072-CH7-SW12 http://www.raywenderlich.com/29948 Good Luck! – Omer Janjua Nov 22 '13 at 11:47
  • Thanks for the sources! One more small question; VoIP call is ok but i want to make a video call, it uses the same protocol right? – volkankasar Nov 23 '13 at 11:58
  • I don't think voip can be used for video calls.. try this http://www.iphonegamezone.net/ios-tutorial-create-iphone-video-chat-app-using-parse-and-opentok-tokbox/ in this tutorial it uses Opentok library and Parse as the back end. or if you really wanna get your hands dirty and do everything from scratch you need to play around with the AV Foundation library https://developer.apple.com/library/mac/documentation/AudioVideo/Conceptual/AVFoundationPG/Articles/04_MediaCapture.html#//apple_ref/doc/uid/TP40010188-CH5-SW2 – Omer Janjua Nov 25 '13 at 12:15
  • But when you make a call with Opentok, the app must be active on the phone which is being called. Thats why i am confused. I need to be able to call the phones which has the app as active or inactive. With Voip it is possible to make this kind of calls as i see. But how can i have the same functionality with Video Calls? that is the problem... – volkankasar Nov 25 '13 at 13:02
  • sorry i didn't realise that. i don't have much expertise in video side of things... try and do what you said earlier... use the voip protocols to keep the connection listening and when something comes in and then use the av foundation library to implement the calling functionality. – Omer Janjua Nov 25 '13 at 16:17