[英]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.