Airbridge sends silent push notifications to users who have performed any app event at least once in the past 6 months to check if they have deleted the app. These notifications are sent daily between 3:00 PM and 4:00 PM UTC. Uninstall events can be viewed via Airbridge reports and raw data exports.
Airbridge uses Firebase Cloud Messaging in Android uninstall tracking.
Note
Your Airbridge Android SDK should be v2.6.0 or later.
Submit Firebase credentials to Airbridge to enable Android uninstall tracking.
Note
Google will be deprecating the Firebase Cloud Messaging (FCM) legacy API. To continue using Android uninstall tracking, update your Firebase credentials submitted to Airbridge by May 31, 2024. For detailed instructions, refer to this article.
Airbridge will use the new API starting with the next silent push notifications after you update your credentials. The new API does not affect the uninstall event count or the uninstall tracking mechanism.
Follow the steps below to generate a private key file in the Firebase console.
1. Sign in to the Firebase console. Click on the Firebase project to generate a private key file or click Add project to add a new project. Refer to Firebase documentation to set up your app in the project.
2. Navigate to [Project Overview]>[Project settings] within the project. Select the [Cloud Messaging] tab and check the Firebase Cloud Messaging API (V1) status. If it shows Enabled, move on to the next step.
If it shows Disabled, click the ellipsis icon and select Manage API in Google Cloud Console. Click Enable and go back to the [Cloud Messaging] tab in the Firebase console to check whether the status shows Enabled.
3. Select the [Cloud Messaging] tab and find your server key and the sender ID.
3. Navigate to [Project Overview]>[Project settings] and select the [Service accounts] tab. Click Generate new private key.
4. Click Generate key to download the JSON file containing the private key. Securely store the JSON file.
Note
Google will be deprecating the Firebase Cloud Messaging (FCM) legacy API. To continue using Android uninstall tracking, update your Firebase credentials submitted to Airbridge by May 31, 2024. For detailed instructions, refer to this article.
Airbridge will use the new API starting with the next silent push notifications after you update your credentials. The new API does not affect the uninstall event count or the uninstall tracking mechanism.
Follow the steps below to submit Firebase credentials to Airbridge.
1. Navigate to [Settings]>[Uninstall Tracking] in the Airbridge dashboard.
2. Select the [Android] tab.
3. Upload the private key file by dropping the file or clicking to select the file.
Test silent push notifications to make sure the notifications can be successfully sent to devices. To proceed with the test, click Test silent push and enter the FCM registration token of your test device. For detailed instructions on how to access your FCM registration token, refer to Firebase documentation.
A success message will be shown when a silent push notification is successfully sent to a test device with the app. A failure message containing the error 404 will be shown when a silent push notification is successfully sent to a test device without the app.
Find the complete list of error codes below. For details about the error codes, refer to Firebase documentation.
Error code | HTTP Error Code | Description |
---|---|---|
INVALID_ARGUMENT | 400 | Invalid request parameters. Check your valid package name, data key, etc. |
THIRD_PARTY_AUTH_ERROR | 401 | APNs certificate or web push auth key invalid or missing. Check the validity of your development and production credentials. |
SENDER_ID_MISMATCH | 403 | Invalid Firebase credentials. Try again with the correct sender ID. |
UNREGISTERED | 404 | Invalid registration token, which Airbridge assumes as an uninstall event. Uninstall events can be successfully collected by Airbridge. |
QUOTA_EXCEEDED | 429 | Sending limit exceeded for the message target. |
INTERNAL | 500 | An unknown error in the Firebase server. Retry after a few seconds. |
UNAVAILABLE | 503 | Firebase server overloaded. Retry after a few seconds. |
The test never affects the uninstall event count available via Airbridge reports and raw data exports. Therefore, it is impossible to track actual uninstall events by testing the silent push notifications.
1. Add the following code to AndroidManifest.xml
.
<service
android:name="${packageName}.MyFirebaseMessagingService"
android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
2. Send the FCM push token to Airbridge using the Airbridge SDK.
public class MyFirebaseMessagingService extends FirebaseMessagingService {
@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
super.onMessageReceived(remoteMessage);
}
@Override
public void onNewToken(String token) {
super.onNewToken(token);
Airbridge.registerPushToken(token);
}
}
class MyFirebaseMessagingService : FirebaseMessagingService() {
override fun onMessageReceived(remoteMessage: RemoteMessage) {
super.onMessageReceived(remoteMessage)
}
override fun onNewToken(token: String) {
super.onNewToken(token)
Airbridge.registerPushToken(token)
}
}
3. There could be an FCM push token already issued before. Use the following code and send this push token as well.
public class MyApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
FirebaseMessaging.getInstance()
.getToken()
.addOnSuccessListener(new OnSuccessListener<String>() {
@Override
public void onSuccess(String token) {
Airbridge.registerPushToken(token);
}
});
}
}
class MyApplication : Application() {
override fun onCreate() {
super.onCreate()
...
FirebaseMessaging.getInstance()
.token
.addOnSuccessListener {
Airbridge.registerPushToken(it)
}
...
}
}
Caution
Make sure the above functions are called after the SDK initialization process.
4. To hide the silent push notifications on the user's device, add the below exception handling logic code.
public class MyFirebaseMessagingService extends FirebaseMessagingService {
@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
super.onMessageReceived(remoteMessage);
if (remoteMessage.getData().containsKey("airbridge-uninstall-tracking")) {
return;
} else {
// handleNotification(remoteMessage);
}
}
@Override
public void onNewToken(String token) {
super.onNewToken(token);
Airbridge.registerPushToken(token);
}
}
class MyFirebaseMessagingService : FirebaseMessagingService() {
override fun onMessageReceived(remoteMessage: RemoteMessage) {
super.onMessageReceived(remoteMessage)
if (remoteMessage.data.containsKey("airbridge-uninstall-tracking")) {
return
} else {
// handleNotification(remoteMessage)
}
}
override fun onNewToken(token: String) {
super.onNewToken(token)
Airbridge.registerPushToken(token)
}
}
Once the Firebase credentials have been submitted to Airbridge and the SDK setup is complete, the Enable uninstall tracking toggle will be activated. Switch on the toggle to start tracking uninstall events.
For more details about uninstall tracking, refer to this article.
Was this page helpful?