Why am I receiving my push notifications twice on Android?

Sometimes after you set up Batch's SDK, you receive push notifications twice due to misconfiguration.

During your tests on Android devices, you may receive push notifications twice.

Push receiver conflict

What probably happens is that one is displayed by Batch, and the second is from another push SDK or your custom code. It's usually not the expected behaviour.

The reason is that Batch comes with its own receiver that manages the display of your push notification automatically. ​

On the other hand, your FirebaseMessagingService implementation (or any other Push SDK) might not correctly handle notifications sent by Batch.

You have different ways to deal with this situation:

  1. You can keep Batch's receiver and skip executing your own code when Batch.Push.isBatchPush(RemoteMessage message) returns true

  2. You can put Batch in manual mode, create your own custom receiver, and take full control of the display of your push notifications.

SDK API Key issues

If you installed a version of your app using the Batch Dev API key and updated it to a version using the Live API key, then Batch will have one installation with a valid token on both environments, and you will receive push notifications twice. In this case, reinstalling the app should fix the issue.

If this happens in production, then you may have used the Dev API key in production. You will find instructions on how to fix the issue in our App settings documentation.

Last updated

Was this helpful?