VoIP notifications
This page explains how to register, unregister, and set up VoIP push notifications for a call from your app.
Note: First, see our GitHub page to learn how to generate your certificate for iOS VoIP Services.
Set up
- To receive push notifications in your app, you must register your APNs certificate from Sendbird Dashboard.
- Refer to the Make 1-to-1 call section on the Make first call page to enable background modes and voice over IP capabilities.
- Deliver incoming VoIP push notifications to the
pushRegistry(_:didReceiveIncomingPushWith:for:completion:)
of the push registry object. - The
SendBirdCall
instance will only receive notifications throughPushKit
, so you must implement appropriateCallKit
actions when the instance delivers an incoming call through itsdidStartRinging
delegate method.
Note: With the Calls SDK, incoming calls can be received only when an app is in the foreground by using the
didStartRinging
delegate method. However, if bothCallKit
andPushKit
are implemented, the Calls SDK will be able to receive incoming calls even when the app is in the background or closed.
VoIP push token registration
Register
To receive calls when an app is in the background or closed, a user’s device push token must be registered to the server. A device push token can be registered by using the SendBirdCall.registerVoIPPush(token:unique:completionHandler:)
method after a user’s authentication has been completed.
After authenticating a user, register the VoIP push token which is acquired from the PKPushRegistryDelegate
.
If the VoIP push token is acquired from PKPushRegistryDelegate
before a user is authenticated, save the token and register it after the user authentication is completed.
Unregister
For a user to stop receiving calls in the background or VoIP push notifications on the device, unregister their VoIP push token by using the SendBirdCall.unregisterVoIPPush(token:completionHandler:)
method.
UnregisterAll
Use the SendBirdCall.unregisterAllVoIPPushTokens(completionHandler:)
method to unregister all VoIP push tokens of the current user.
Note: For more guide on how to make a video app with CallKit, see this tutorial.