Push Notification

Overview#

We use VOIP services of apple to receive calls in the background and in killed state.

Prerequisites#

Please upload your VOIP Certificate to our Console. To know more how to generate and upload VOIP Certificate Click Here.

In your Appdelegetae, register for voip notification by conforming to the following delegates PKPushRegistryDelegate.

Goto Project -> Target -> Signing & Capabilities -> Click + at the top left corner -> Search for the capabilities below
Capabilities
Voice over IP

Capabilities-voip

Update VOIP token#

Update your VOIP token using the below methods when an VOIP token gets updated.

    func pushRegistry(_ registry: PKPushRegistry, didUpdate pushCredentials: PKPushCredentials, for type: PKPushType) {
    //VOIP Token Update
    let deviceToken = pushCredentials.token.reduce("") { $0 + String(format: "%02X", $1) }
    VOIPManager.sharedInstance.saveVOIPToken(deviceToken)
    VOIPManager.sharedInstance.updateDeviceToken()
    }
    ArgumentDescription
    TOKENApns or Voip Token

    Process VOIP request#

    With the didReceiveIncomingPushWith method, you will receive the call payload. In order to continue processing the call, you must send the payload to the SDK method below.

      func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, for type: PKPushType, completion: @escaping () -> Void) {
      VOIPManager.sharedInstance.processPayload(payload)
      }
      ArgumentDescription
      PAYLOADPayload Dictionary