简体   繁体   English

Firebase 更新补丁更新后,三星 S10 设备的 Android12 中未收到推送通知

[英]Firebase Push notification not receiving in Android12 in Samsung S10 Device After updating Patch Update

I am using a Samsung Galaxy S10 mobile.我正在使用三星 Galaxy S10 手机。 On February 3rd Security patch was updated on my phone. 2 月 3 日,我的手机上更新了安全补丁。 After the update Push notification was not received in my App.在我的应用程序中没有收到更新推送通知。 Other App notifications are working fine.其他应用程序通知工作正常。 Anyone can answer my question, please?有人可以回答我的问题吗? What was the reason for not receiving notification?没有收到通知的原因是什么?

The answer could be because the PendingIntent for that app's notifications hasn't had its mutability defined.答案可能是因为该应用程序通知的 PendingIntent 尚未定义其可变性。 Starting from Android 12, you have to define whether a PendingIntent is immutable or mutable for it to work properly:从 Android 12 开始,您必须定义 PendingIntent 是不可变的还是可变的才能正常工作:

https://developer.android.com/about/versions/12/behavior-changes-12#pending-intent-mutability https://developer.android.com/about/versions/12/behavior-changes-12#pending-intent-mutability

Another thing to try to make notifications work again is to add the "exported:false" tag to the notifications service:尝试让通知再次工作的另一件事是将“exported:false”标签添加到通知服务:

https://developer.android.com/about/versions/12/behavior-changes-12#exported https://developer.android.com/about/versions/12/behavior-changes-12#exported

That should help.那应该有帮助。

In comments for checks answer, Shobana wrote aboute PendingIntent.在检查答案的评论中,Shobana 写了关于 PendingIntent。 My answer will be for Xamarin dev.我的答案是 Xamarin dev。 After 12+ android, users not receive messages. 12+ android后,用户收不到消息。 This helped me( PendingIntentFlags.Mutable ):这帮助了我( PendingIntentFlags.Mutable ):

public void CreateNotification(string title, string message, string action)

var pendingIntent = PendingIntent.GetActivity(mContext, 0, intent, PendingIntentFlags.Mutable);

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

相关问题 在 Android12(API 级别 31、32)上接收推送消息时,“Could not send notification”日志为 output - When receiving a push message on Android12 (API Level 31, 32) "Could not send notification" log is output Firebase Android 12 上未收到推送通知 - Firebase Push notification not receiving on Android 12 Flutter GoRouter 并接收 Firebase 推送通知 - Flutter GoRouter and receiving Firebase Push notification Firebase 云消息 - 手机收不到推送通知 - Firebase Cloud Messaging - Mobile not receiving push notification iOS Firebase 推送通知:如何提供 Firebase 用户的设备令牌并发送通知 - iOS Firebase Push Notifications : How To Give Firebase User's Device Token And Send Notification Firebase 云消息:在 android 12 中未收到消息 - Firebase Cloud Messaging : not receiving message in android 12 更改 Android 12 上的推送通知背景颜色 - Change Push Notification background color on Android 12 设备离线时 Firebase 推送通知无法正常工作 - Firebase push notification is not working properly when device is offline Android 接收推送通知并在前台或后台处理它 - Android receiving push notification and handling it either in foreground or background React Native Firebase 推送通知 iOS 真实设备 - React Native Firebase Push Notification iOS Real Device
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM