简体   繁体   English

在 Android 自定义操作系统中未收到 FCM 推送通知

[英]FCM Push notification not receiving in Android customized OS

Can anybody please help me to solve this issue...谁能帮我解决这个问题...

I have implemented the FCM functionality in my project.我已经在我的项目中实现了 FCM 功能。 Its normally working in all default android OS versions.它通常适用于所有默认的 android 操作系统版本。 phones like moto, nexus, redmi, etc., moto、nexus、redmi等手机,

But I have installed the same apk in oppo, vivo, one plus3, honor, etc., (customized OS).但是我在oppo、vivo、一加3、荣耀等都安装了同样的apk,(定制OS)。 Which I am not getting any notifications from my app.我没有从我的应用程序收到任何通知。

Why this is happening.. And also I have checked with the some other apps like inshorts, dailyhunt, etc., which is getting push notifications in customized OS.为什么会发生这种情况……而且我还检查了其他一些应用程序,如 inshorts、dailyhunt 等,这些应用程序正在自定义操作系统中获取推送通知。

I have tried all the given solutions.我已经尝试了所有给定的解决方案。 1. Allowed my app in battery optimization. 1. 允许我的应用进行电池优化。 (Honor) 2. Allowed my app as non protected app. (荣誉) 2. 允许我的应用程序作为不受保护的应用程序。 3. Whitelisted my app from the list. 3. 从列表中将我的应用程序列入白名单。

These are all working..这些都在工作..

But I need to get push notification without doing this... like inshorts, dailyhunt, whatsapp, fb, etc.,但我需要在不这样做的情况下获得推送通知......比如 inshorts、dailyhunt、whatsapp、fb 等,

Am searching for this long time.找了这么久。 Pls help me with this.请帮我解决这个问题。

Thanks in advance.提前致谢。

Try this in your Manifest file.在您的清单文件中试试这个。 Hope you will receive push notification without modifying your system settings.希望您能在不修改系统设置的情况下收到推送通知。

<service android:name="com.jibarath.MyFirebaseMessagingServices"
    android:exported="true"
    android:stopWithTask="false">
    <intent-filter>
        <action android:name="com.google.firebase.MESSAGING_EVENT"></action>
    </intent-filter>
</service>

stopwithtask=false did the trick. stopwithtask=false成功了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM