Troubleshooting Push Notifications

Push notifications are crucial for keeping your app users engaged and informed. If you're facing issues with push notifications, follow these steps to troubleshoot and resolve the problem. Do not skip any steps or the final note. We have covered all scenarios, common mistakes, and even provided you with scripts to bypass mesibo and send push directly.

Step 1: Verify Firebase and Apple Push Credentials

Ensure that you have correctly configured the push credentials for Android (Firebase) and iOS (Apple Push Notification Service) in the mesibo console as described here. Common mistakes include:

  • Android Firebase Credentials: Double-check that the project and client ID from the uploaded credentials match the ones used for generating the push token.

  • Apple P12 Certificate: Verify that the bundle ID matches your app's bundle ID. If they don't match, push notifications will be rejected.

Step 2: Check the Push Token

Confirm that you have obtained and set the push token correctly, as described in the documentation. You can verify this by checking the user details in the mesibo console, which should display the push token and will also allow you to send a test push notification.

Step 3: Use Background Push and not Alert

mesibo sends Background Push notifications by default, which is the recommended configuration. Your app should utilize Background Push in conjunction with local notifications to display push notifications instead of using alerts. Avoid using alerts unless you fully understand the implications.

Step 4: Check if you are using Firebase Push Tokens for iOS Applications

For iOS applications, it is generally recommended to use Apple Push Tokens instead of Firebase Push Tokens. However, if you decide to use Firebase API to generate push tokens for your iOS app, it is mandatory to upload FCM (Firebase Cloud Messaging) credentials to mesibo. Uploading APN (Apple Push Notification service) certificates alone will not be sufficient.

Additionally, you should refer to the Firebase documentation to properly configure APN certificates in their settings. Since we do not have access to your Firebase settings, we cannot provide much support if you choose to use the Firebase API for your iOS application. We strongly advise using APN and Apple Push Tokens for iOS.

Step 5: General Troubleshooting

Before we describe more advanced troubleshooting using webhooks and enabling push notification debugging in the next step, read through the General Troubleshooting and iOS specific Troubleshooting steps below:

General Troubleshooting

If your app doesn't get the push, check the following:

  • Ensure that you are testing push notifications under normal conditions. Your app will not receive push if you "force stop" the app, clean the app cache, etc.
  • Ensure that you have configured push-notification credentials for your app correctly on the mesibo consoleopen_in_new.
  • Ensure that your phone is not in Do-Not-Disturb mode.
  • Keep your phone on the cellular data and see if you are receiving push notifications.
  • See if other apps on your phone receive it.
  • mesibo sends push only when your app is suspended and disconnected. It may take a few seconds (or minutes) depending on the operating system and also the device configuration.
  • mesibo rate limits push notifications per user to prevent excessive notifications to one user from impacting your entire app, as FCM/APNs throttle globally. You can disable this setting in on-premise deployments, though not recommended.
  • Ensure that you are using Background push and not Alert.

Additional Troubleshooting Steps for iOS

  • While PushKit is ideal for calls, the iOS 13 and newer mandatorily require CallKit integration and reporting when using Push Tokens which does not go well with Video Calls. If not, iOS will terminate your app. Refer to Apple documentation and WWDC talk Advances in App Background Executionopen_in_new. Also, according to these threads ( hereopen_in_new, hereopen_in_new, and hereopen_in_new), only a few apps (WhatsApp, FB messenger, Telegram) are given special privileges, so unless your app is also given those privileges, we currently do not recommend using Push Kit.
  • Use the Production Certificate, not the development certificate. Mesibo console will give you a warning but will accept the certificate. However, your device is likely not to receive push notifications.
  • Ensure that the bundle ID on the certificate matches your app bundle ID. Note, if you are using the mesibo demo app, you need to change the bundle ID to match your certificate.
  • Don't mess with the APS entitlements setting unless you know what you are doing. By default, it is set to development for the development and set to Production by Xcode when you upload your app to the App Store for release or test flight. This setting impacts the selected APN endpoint for sending push notifications. Hence, if you change this to say 'Production', you may need to send all your sandbox pushes to the production APN server

Step 6: Configure Webhook to receive Push Notification Results

If your app still cannot receive push notifications after the above steps, you can debug the issue using webhooks. When a push notification fails, you'll receive a webhook request from mesibo containing information about the push event, including the request and the response from FCM and APN.

To enable this, check Push Notification Results checkbox setting in Webhook, in the consoleopen_in_new. When a push notification fails, you will receive a webhook request from mesibo, and the payload will contain information about the push event. In the webhook payload, you can inspect the request and the response so that you can understand the reason for failure or why the push service(FCM/APN) rejected the push. For example, if you did not configure the right credentials, etc.

Refer mesibo Real-time webhooks to know about setting up a webhook and using the push event type to debug failed push notifications.

In the push event, the response.code field will contain the error code which indicates the reason for failure.

If FCM/APN rejected the push, then refer to the respective documentation of push notification error codes.

If Mesibo rejected the push, then the error code will be a value greater than 900. Refer to the table below for special error codes and their meaning:

Error CodeDescription
901Push service for the app is not configured
902Push service for the app is temporarily disabled
903Push certificate expired
904Push certificate error
905Production certificate is required for this push
911Bad push token
912Mismatch in APN certificate and the push token app id
913Bad payload
914Ratelimit reached

Step 7: Enable Push Debugging

You can also enable Push Notification Debugging from the App Settings -> Push Notifications in the mesibo console. This will send additional data over the webhook, even for successful pushes. However, since debugging requires more CPU resources, you can enable push debugging for 3 hours out of every 8 hours.

Step 8: Sending Test Push Notifications using API

You can send test push notifications using the mesibo backend API to troubleshoot push delivery issues. This is particularly useful for verifying your push configuration and debugging connectivity problems.

Refer to the mesibo Backend API Push Notifications documentation for details.

Testing Push Delivery

Use the pushtest operation to send test notifications to specific user addresses. This helps verify that your push credentials are correctly configured and that notifications can reach target devices.

Debug Mode

Use the pushdebug operation to enable detailed debugging information for all push notifications sent to FCM or APN. This provides comprehensive logs of push delivery attempts, success/failure status, and detailed error information when issues occur.

Note:

  • Cloud deployments have rate limiting and time restrictions for debugging
  • On-premise deployments have no such limitations

Additional Troubleshooting for On-premise

If you are using mesibo on-premise, you can enable detailed push notification logs to help with debugging and monitoring push delivery. Push logging can be configured through the local configuration file.

To enable push logs, refer to the Logging Configuration section in the Local Configuration documentation. Set the push parameter to 1 in your logging configuration:

logs {
    push = 1
}

Additionally, for testing purposes, you can disable push notification rate limiting in the mesibo console. However, this is not recommended for production environments as rate limiting prevents excessive notifications to one user from impacting your entire app, since FCM/APN throttle globally.

Final Note

mesibo's role is to reliably deliver push notifications to FCM or APN depending on the type of device and your configuration. Once mesibo delivers the notification to FCM/APN, it is entirely up to FCM or APN to decide what to do with it and whether to deliver it to the device - mesibo has no control over this final delivery step.

If you encounter issues with push notifications not reaching devices, use the debugging features or webhook responses to check if mesibo successfully delivered the notification to FCM/APN. If the delivery to FCM/APN was successful but the notification still didn't reach the device, the issue lies with FCM/APN delivery policies, device settings, or network conditions beyond mesibo's control.