我的Android应用程序通知在Android 12上没有工作
我正在尝试使用Workmanager和Kotlin中的频道显示通知。他们在具有较旧的Android的设备上工作正常,我已经在Android 8和Android 11上进行了测试。
但是,当我在Android 12设备(Realme 8)上尝试它们时,他们拒绝出现。我已经尝试更改通知优先级,检查设备上是否允许通知,调整通知量,没有任何帮助。我还使用Android 12和Android Emulator版本的Pixel XL在不同的Realme 8设备上对其进行了测试,该版本也是Android 12,它们在这些设备上也无法使用
其他应用程序的通知。只有我的应用程序在Android 12个设备上不起作用 。
如果需要更多信息,请说。谢谢你的宝贵时间。
I am trying to display notification using WorkManager and Channels in Kotlin. They are working totally fine on devices with older Androids, I've tested it on Android 8 and Android 11.
But as I try them on Android 12 device (Realme 8) they refuse to show up. I've already tried to change Notification priority, check if the notifications are allowed on my device, tune up the notification volume, nothing helps. I also tested it on different Realme 8 device with Android 12 and also Android emulator version of Pixel XL which is also Android 12 and they didn't work on these devices as well
Other app's notifications work correctly. Only my App's doesn't work on the Android 12 devices.
If any more info needed, just say. Thank you for your time.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正如Vincent091所评论的那样...
解决方案对于此问题,以下是:
声明给定的
pendingIntent
对象是可变的或不可变的,请使用pendend> pendingIntent.flag_mutable 或
pendingIntent.flag_immutable
标志。As vincent091 commented...
The SOLUTION for this problem is this:
To declare that a given
PendingIntent
object is mutable or immutable, use thePendingIntent.FLAG_MUTABLE
orPendingIntent.FLAG_IMMUTABLE
flag, respectively.