This page explains how to register, unregister, and set up VoIP push notifications for a call from your client app.
Note: First, see our GitHub page to learn how to generate your certificate for iOS VoIP Services.
- To receive push notifications in your client app, you must register your APNs certificate from Sendbird dashboard.
- Refer to the Step 4 of the Install and configure the Calls SDK 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.
SendBirdCallinstance will only receive notifications through
PushKit, so you must implement appropriate
CallKitactions when the instance delivers an incoming call through its
Note: With the Calls SDK, incoming calls can be received only when an app is in the foreground by using the
didStartRingingdelegate method. However, if both
PushKitare implemented, the Calls SDK will be able to receive incoming calls even when the app is in the background or closed.
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 to authenticating a user, register the VoIP push token which is acquired from the
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.
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.unregisterAllVoIPPushTokens(completionHandler:) method to unregister all VoIP push tokens of the current user.