If you are having trouble integrating the SDK, uploading your certificates or sending notifications, here are some suggestions.
The Installation ID is an ID generated by Batch for all the installs the first time your users open the app. You can safely display it in your app to simplify the debug process.
You can use that ID in the debug tool (Dashboard settings > Debug) to find your own install, see the data Batch has on it and send test notifications to your device.
Your end users can also send it to you so you can understand why they are not receiving push notifications or not seeing an In-App message. This is useful when your app doesn't share any advertising ID with Batch.
You can also store the install ID on your end and reuse it later to target specific installs using the Transactional API.
You can retrieve the installation ID by calling the following methods:
That installation ID can be exposed to your end users. You can insert it in a diagnostic email automatically generated when users report an issue from the app or hide it in an easter egg.
The debug view is a UI with multiple debug features, allowing you to see the native and custom data attached to your install. You can also see the list of In-App campaigns already stored in your device.
This is useful for development purposes and for internal uses only, especially if your team cannot use an advertising or a custom user id to find their device in the debug tool and send test notifications to their device.
Shows a list of native information you can use for basic debug:
- Batch SDK version
- Installation ID
- Advertising ID
- Push token
You can easily share that report by clicking the share button in the top right corner.
Shows the custom user data attached to your install, excluding events. This is useful to:
- Check the Custom User ID attached to the install (see more here).
- See the list of attributes / tag collections attached to your install. You can use that part to see if the app has been tagged correctly or understand why your device didn't receive a notification based on a one of these information.
Use that part to manually pull the campaigns available on Batch servers for your install and to see the list of stored In-App campaigns. This requires Batch to be started.
Here is how you start the debug activity:
public static void startDebugActivity(Context context)
You can hide it in an easter egg (e.g. display it after 10 taps on specific button, etc) or simply display it in your app settings for your development versions exclusively.
Unable to resolve dependency [...]: Could not find any version that matches com.batch.android:batch-sdk:1.12+.
Batch is published to Maven Central. Sometimes, jCenter does not correctly mirror it, breaking the auto update of the artifacts.
To fix this, either switch to an explicit version (such as
1.12.0 rather than
1.12+), or add
mavenCentral() to your repositories in your build.gradle.
Please ensure you added the Play Services library in the dependencies. If you use Proguard (
"minifyEnabled=true" in the Gradle build), make sure you have added Batch's Proguard rules.
If you use Proguard, please make sure you have added Batch's Proguard rules. If your integration worked on the debug builds, it is probably because Proguard was disabled on that configuration.
This usually happens when the SDK is not integrated in ALL your activities.
Please make sure you call
Batch.User methods after
Batch.onStart() and before
There are several points you should check if Batch is unable to find a start event for your app:
- Integration issue: See if Batch is integrated in all your activities.
- Wrong API key: Make sure you are using a valid API Key (⚙ Settings → General).
- Emulator. Make sure you are testing on a real device (unless you're using Google API emulators).
- Logcat: Look for errors in logcat to understand why Batch is not starting in your app.
If Batch is unable to find a token, here are some suggestions to find the issue:
- Emulator. Make sure you are testing on a real device since Batch relies on the Play Services for push services (unless you're using Google API emulators).
- GCM sender ID. Check if you have set the GCM sender ID in your code as described here.
- Google Play services. See if you are using the most recent version of the Google Play Services by opening this link on your device.
Here are several points that may help:
- Network. Try turning off and on your WiFi connection or using a 3G/4G connection.
- Integration issue. See if Batch is registering a push token in your logs or if there are errors in your device logcat.
- Force close. Go to the system settings → Apps. Make sure your app is not force closed, otherwise it won't receive any notifications.
- Energy saving. Some energy saving features may kill the apps (Samsung Smart Manager) or delay push delivery when the device is low on battery (Doze). Try changing the priority of your push to see if that fixes the issue.
You can also check the status of every message sent to a specific device token (received, device disconnected, etc) using the FCM Diagnostics from the Google Play Developer Console.
There are several points you should check if Batch doesn't show any data on your dashboard:
- Dev/Live API key. Make sure that you used the Live API key in the build you uploaded to the store. Stats are only displayed for the Live API key.
- 24h delay. Installs, DAU, starts and redeems shown on the Analytics tab are updated on a 24h basis for the Live API key.
- Integration issue. If you still don't see any stats for your app 24h after changing the API key, see if you find anything related to Batch in your logs and double check your integration using the documentation.
GCM tokens are linked to a single Sender ID. Make sure the GCM Server API Key used in Batch's dashboard (⚙️ Settings → Push settings) matches the GCM sender ID used in your app. You will find more information here.
This error happens when GCM is not available for a short period of time. Try again later or fallback on cellular network.
Please reach us at firstname.lastname@example.org. Our team will help you to fix the issue.
You can find the list of GCM and Batch internal errors in the Notifications tab, by hovering on the error count.
GCM/FCM refused the credentials supplied in your app configuration
GCM sends this error when the token Batch tries to push is not valid anymore. This usually happens when users uninstall/reinstall your app.
On Android, tokens are linked to a specific sender ID. GCM will systematically send this error when a token is pushed with the wrong sender ID. Make sure you are using the same Sender ID you were using with your old push provider.
This internal error happens when the number of maximum send attempts is reached for a token. Feel free to reach us if you are seeing to many max_retry_attemps errors.
If the number of max_retry_attempts error suddenly increases, make sure you are using a "Server API key" to communicate with GCM (Developer dashboard → Credentials → API keys). If you are using an Android API key, you should generate a new Server API key and paste it in Batch's dashboard (⚙️ Settings → Push settings).