Currently, I'm using only 1 Firebase product - Firebase Messaging. (I didn't use Firebase Analytics)
implementation 'com.google.firebase:firebase-messaging:18.0.0'
According to https://firebase.google.com/docs/cloud-messaging/android/client#prevent-auto-init
Firebase generates an Instance ID, which FCM uses to generate a registration token and Analytics uses for data collection. When an Instance ID is generated, the library will upload the identifier and configuration data to Firebase. If you prefer to prevent Instance ID autogeneration, disable auto initialization for FCM and Analytics (you must disable both) by adding these metadata values to your AndroidManifest.xml:
I don't really understand the above.
My only use cases are
FirebaseInstanceId.getInstance().getInstanceId()MyFirebaseMessagingService extends FirebaseMessagingServiceI'm concerning, under what kind of situation, I should care about "Prevent auto initialization", and what's wrong with "auto initialization"?
As the message says, you would want to prevent auto initialization when you don't want the Firebase SDK to automatically upload the instance ID token as soon as it becomes available. This might be a concern for you if you're not allowed to track the usage of the device for whatever reason. This might impact the ability of some Firebase products to work correctly. If this isn't a concern to you, then you don't have to make any changes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With