user1519979 user1519979 - 1 year ago 113
Android Question

Disabling FirebaseMessagingService programmatically

I'm using Firebase for receiving Pushnotifications. My problem is that i want to make an option for users available, where they can disable these Notifications.

<application android:label="MyApp" android:theme="@android:style/Theme.NoTitleBar" android:icon="@drawable/ico_myapp_application">
<receiver android:name="" android:exported="false" />
<receiver android:name="" android:exported="true" android:permission="">
<action android:name="" />
<action android:name="" />
<category android:name="${applicationId}" />
<!-- END Manual Firebase Additions -->

Is there a way to prevent the app from register/creating the FirebaseMessagingService ?

Answer Source

You could make options for users to Unsubscribe from your Firebase topic, they would stop getting the notifications. Unless if you are sending it directly to their ID.


and then unsubscribe users