【发布时间】:2022-01-04 07:42:46
【问题描述】:
我在 Flutter 中开发应用程序。有人会建议我在哪里更改 PendingIntent 以使用 FLAG_IMMUTABLE?应用程序安装在模拟器上,但在启动时崩溃。谁能举一个简短的例子在哪里改变它?
我读到 workmanager 2.7.1 可以帮助解决问题。具体应该添加到哪里?
【问题讨论】:
-
如果对您有帮助,请考虑接受@SebastienB 的回答。我只是在此处删除此评论,以便其他搜索错误消息的人找到此线程。
Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent. Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles..