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.
Here are some common issues that can arise when using Push Notifications for incoming mobile SDK calls.
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.
Stop receiving Push notification:
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
Error: InvalidCredentials, Reason: Using a wrong or expired iOS/Android Push notification certificate.
Using a wrong or Expired iOS/Android certificate on Plivo Console
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.
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.
Error: BadDeviceToken, Reason: Using Push notification certificate for the wrong environment (production/sandbox)
Using an iOS certificate for the wrong environment
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.
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.
Error: DeviceTokenNotForTopic, Reason: Push notification certificate and Device App provisioned with different Apple App ID
Push notification certificate and Device app are provisioned with different Apple App ID.
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.
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.
Error: InvalidPlatformToken, Reason: Push notification certificate is invalid.
Pinpoint the issue from other console logs like DeviceTokenNotForTopic, BadDeviceToken, if present. Else Re-register Plivo endpoint.
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.
Push notification certificate is not present on Plivo console.
Plivo Mobile SDKs use Apple Push Notification Service(APNS) for iOS and Google Firebase Cloud Messaging (FCM) for Android to deliver incoming call notifications.