Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS - best practice to send incoming call notifications on VoIP app

The first solution I can think of for the incoming call notification is Apple's Push Notification service. However, it is not guaranteed.. there's a relatively high chance it may get lost.. and in a VoIP app, the incoming call notification is so important that I can't afford to miss it too often...

Thus, I followed the tips and enabled the Background Mode to keep the app alive and listening to any incoming call invite. By right, I should just show local notification when the app gets the incoming call invite. This works pretty well when the app is in background/inactive. HOWEVER, when user kills the app manually, no code will get executed, so the app won't get any incoming call invite in such a condition... And because of this particular scenario, I still have to rely on remote push notification.

What I'm trying to achieve is.. waiting for remote notification first, if it arrives, then do not show local notification anymore. If it's lost, then show local notification so that user will always get notified.

The problem is... I have no way to tell if a remote notification has arrived.

I want to know what is the best practice to handle incoming call notifications for a VoIP app?

like image 403
xialin Avatar asked Jul 09 '14 03:07

xialin


People also ask

What are interactive notifications and VoIP notifications?

VoIP notifications are background messages that don't generate alerts or sounds. These notifications are used to wake up apps and pass across information about incoming calls. With VoIP, mobile apps let users send and receive calls on their devices, using the app interface rather than the default phone interface.

How do I turn on incoming call notifications on my iPhone?

On your iPhone or iPad, open the Settings app. Tap Notifications. Voice. Turn on or off the notification settings you want to change.

What is VoIP push?

VoIP push is considered a high-priority notification and delivered to an app without delay. An app launches automatically when it receives a VoIP push, removing the requirement to keep the app running in the background.


1 Answers

From appleDoc Apple Developer Docs. (Updated link)

In iOS 8 and later, voice-over-IP (VoIP) apps register for UIRemoteNotificationTypeVoIP push notifications instead of using this method. Using push notifications eliminates the need for a timeout handler to check in with the VoIP service. Instead, when a calls arrives for the user, the VoIP service sends a VoIP push notification to the user’s device. Upon receiving this notification, the device launches or wakes the app as needed so that it can handle the incoming call.

like image 131
pasqui86 Avatar answered Oct 02 '22 14:10

pasqui86