Firebase on Android - I want to disable firebase notifications on Android client

前端 未结 5 1826
忘掉有多难
忘掉有多难 2020-12-16 13:38

I\'m using Firebase console to send notifications to users. However I want to let users disable notifications. How can I disable them?

I am able to handle (and stop)

5条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-16 14:40

    Not sure why this happens to you (code snippet maybe?), but there is a heavy weight ultimate solution: define your own c2dm receiver in the manifest and set the priority high (>0) then stop the notification from processing.

    GCM messages are processed as ordered broadcasts, so you can stop the processing chain by calling this method:

    https://developer.android.com/reference/android/content/BroadcastReceiver.html#abortBroadcast()

    If you don't do anything in your receiver then the next receiver will do the processing, which will be the Firebase receiver.

    Please note: Firebase is sending push notification for Remote Config changes. So, if you use Remote Config then it is not advisable to suppress any data push.

提交回复
热议问题