android FCM启用/禁用应用程序设置 [英] android FCM enable/disable from application settings

查看:216
本文介绍了android FCM启用/禁用应用程序设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的Android应用程序中实施了Firebase云消息传递。

是否可以从我的应用程序设置屏幕中关闭通知?

我们已经广播了 GcmReceiver ,并且我们可以自己处理。



现在我们只有 FirebaseInstanceIdService ,只有当应用程序处于前台时才能处理它。



当应用程序处于后台时,我们如何处理它?<​​b>

可能只是禁用Firebase云消息传递仅适用于某些类别的应用程序内的通知或这应该在服务器端?如果我需要打开/关闭某种类型的通知,我带着解决方案向服务器发送请求。如果发送请求关闭某些通知服务器将不再触发FCM服务器发送通知到设备

I've implemented Firebase Cloud Messaging in my android app.

Is it possible to turn notifications off from my application settings screen?

It was possible with old GCM as we have broadcast GcmReceiver and we could handle it ourselves.

Now we have only FirebaseInstanceIdService and could handle it only when app is in foreground.

How we can handle it when app is in background?

Is it possible only to disable Firebase Cloud Messaging only for some category of notification inside app or this should be done on the server side?

解决方案

I came with the solution to send request to the server if I need to switch on/off some type of notifications. And if send request to switch off some notification server will no longer trigger FCM server to send notification to the device

这篇关于android FCM启用/禁用应用程序设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆