Uninstall Tracking
To enable uninstall tracking for your Android app, first configure the app in the Singular platform as detailed in Setting Up Uninstall Tracking. Then follow the instructions below.
Note: Google deprecated the GCM APIs in April 2018. Use Firebase Cloud Messaging (FCM) for uninstall tracking, as described below.
I. Integrate with FCM:
To track uninstalls, you can use the services of the Firebase Cloud Messaging (FCM) platform. If you are not already using FCM follow Google's instructions on how to Set up a Firebase Cloud Messaging client app on Android.
FCM Requirements ( source )
FCM clients require devices running Android 4.1 or higher that also have the Google Play Store app installed, or an emulator running Android 4.1 with Google APIs. Note that you are not limited to deploying your Android apps through the Google Play Store.
Users/devices who are not running on supported versions of Android will not be available for Singular uninstall tracking.
II. Update the AndroidManifest.xml File:
Update your AndroidManifest.xml file to add the necessary intent filter for your app (replace MyFirebaseMessagingService with your class that implements the Firebase Service):
<service android:name=".java.MyFirebaseMessagingService"
android:exported="false">
<intent-filter>
action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
III. Register and Send the FCM Device Token:
Finally, set the FCM device token after your SingularConfig is initialized in OnCreate(), as follows:
Singular.setFCMDeviceToken(String fcmDeviceToken);