Troubleshooting Push notification using Plivo console logs

Mobile SDK uses Apple Push Notification Service(APNS) for iOS and Google Firebase Cloud Messaging (FCM) for Android to deliver incoming call notifications.
To make debugging issues easier, errors related to Push notifications are presented in the call debug logs available on the Plivo console.

Plivo console

Common Issues:

Here are some common issues that can arise when using Push Notifications for incoming mobile SDK calls.

  1. Some notifications received, but not all:

    Are you sending multiple push notifications simultaneously in Sandbox environment? Sandbox environment is meant for testing purposes and should not be used to trigger multiple push notifications simultaneously. APNS maintain QoS (Quality of Service) queue for each device with a push app. Size of the queue is 1. Sandbox environment is used only for testing purposes.

  2. Problem connecting to Push Notification Service:
    1. A firewall might be blocking traffic from Firebase/APNS to the mobile device. Make sure firewall is not blocking traffic on below ports:
      1. TCP port 5223 to communicate with APNS.
      2. TCP port 443 is required for device activation from APNS.
      3. TCP port 5228, 5229, 5230 to communicate with Firebase.
    2. For iOS, Private key and Certificate uploaded on Plivo console might be wrong. Each App ID has a unique CSR and private key combination. Detailed guide to setup Push notifications for iOS.
    3. For Android, FCM API key might be incorrect.Detailed guide to setup Push notifications for Android.
  3. Stop receiving Push notification:

    It is likely that device token has changed. This can happen when app is uninstalled or reinstalled. Make sure that correct device token is used during Plivo Endpoint registration.(iOS/Android)

Plivo shares as much information as possible regarding Push Notification failures in its Call debug logs. Below is a comprehensive list of error messages related to push notification failures that you may come across in Plivo console logs

  1. Error: InvalidCredentials, Reason: Using a wrong or expired iOS/Android Push notification certificate.

    Possible cause:
    Using a wrong or Expired iOS/Android certificate on Plivo Console

    Description:
    An iOS certificate cannot be used for sending push notifications after its expiration date has passed. iOS certificate can be inactive by revoking and invalidating from Apple’s Developer Center. Android FCM API key can be deleted from Firebase console.

    Recommended solution:

    For iOS, make sure that correct Certificate and Private key is uploaded on Plivo console. Sign in to Apple’s Developer Center and ensure that provisioning profile is active and respective certificates have not been expired, revoked or invalidated. For Android, make sure correct FCM API key is uploaded on Plivo console and its active on Firebase console.

  2. Error: BadDeviceToken, Reason: Using Push notification certificate for the wrong environment (production/sandbox)

    Possible cause:
    Using an iOS certificate for the wrong environment

    Description:
    Apple issues different SSL certificates for Development and Production purposes. If there is a mismatch of Certificate Type (Production/Sandbox) specified on Plivo console and your app’s actual provisioning profile, your device will not be able to receive push notification.

    Recommended solution:
    Make sure the Certificate type selected on Plivo console matches with iOS provisioning profile of your app and certificate. Register your Plivo Endpoint again to make sure that valid device token is used after correcting certificates.

  3. Error: DeviceTokenNotForTopic, Reason: Push notification certificate and Device App provisioned with different Apple App ID

    Possible cause:
    Push notification certificate and Device app are provisioned with different Apple App ID.

    Description:
    This error is returned from APNS when the presented push notifications token attributes does not match the topic specified at the time of sending. Device token was issued to an app with a given Apple App ID but the Push notification certificate is configured for another Apple App ID.

    Recommended solution:
    Ensure that the Apple App ID of the provisioning profile with which the application is deployed to a device is matching the Apple App ID for which the Push notification SSL certificate is configured. Register your Plivo Endpoint again to make sure that valid device token is used after correcting certificates.

  4. Error: InvalidPlatformToken, Reason: Push notification certificate is invalid.

    Possible cause:

    1. Using an iOS certificate for the wrong environment(Production/Sandbox)
    2. Push notification certificate and Device app are provisioned with different Apple App ID.
    3. Device Token is expired. GCM and APNs update their tokens from time to time.

    Recommended solution:
    Pinpoint the issue from other console logs like DeviceTokenNotForTopic, BadDeviceToken, if present. Else Re-register Plivo endpoint.

  5. Push notification certificate is missing. Upload iOS push notification certificate on Plivo console. or Push notification certificate is missing. Upload FCM Server key on Plivo console.

    Possible cause:
    Push notification certificate is not present on Plivo console.

    Description:
    Plivo Mobile SDKs use Apple Push Notification Service(APNS) for iOS and Google Firebase Cloud Messaging (FCM) for Android to deliver incoming call notifications.

    Recommended solution:
    Detailed guide to setup Push notifications for iOS and Android.