ios - Flutter Firebase_messaging onBackgroundMessage 不会在较旧的 ios 设备上调用(iPhone 7 iPhone 8)
问题描述
我们在 Flutter 应用程序中使用 firebase_messaging ^9.1.1。当应用程序处于后台或终止状态时,在“iPhone se”中调用 onBackgroundMessage。但不是在 iPhone 7 或 iPhone 8 上调用。所有设备的 IOS 版本相同,即 IOS 14.4.2。
我们在 onBackgroundMessage 中调用 callkeep: ^0.2.3+1 插件。当应用程序终止/在后台接收通知(iPhone 7 或 iPhone 8)时,我们看不到呼叫 UI。
这是我们的代码:
void main() async {
FirebaseMessaging.onBackgroundMessage(myBackgroundMessageHandler);
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp();
if (!UniversalPlatform.isWeb) {
PushNotificationsManager().initCallKit();
}
Future<dynamic> myBackgroundMessageHandler(RemoteMessage message) async {
await Firebase.initializeApp();
//callkeep: ^0.2.3+1 plugin. code here.
}
Have anyone faced this issue? what next we can try to solve this issue?
解决方案
推荐阅读
- android - 虽然我只想选择一个,但可以选择两个单选按钮
- python - mysqlconnector在Mysql中的日期格式错误
- c++ - CGAL Triangulated Surface Mesh Shortest Paths 算法 - 断言错误
- java - 尝试自动装配使用 MockitoJUnitRunner 运行的配置属性时出现 NullPointerException
- c# - OPC 客户端服务器:建立连接时出错:BadNotConnected
- material-ui - 反应钩子 setState 没有正确地重新渲染组件
- java - Spring Boot 表单数据与 FreeMarker 绑定列表
- graphql - 如何在 graphql 服务器中处理多租户?Apollo/Prisma/Hasura 什么有这个 pugin?
- sql - 如何在 Oracle 的单行中返回重复 ID 的冗余行
- java - 在活动中进行谷歌登录后保存谷歌个人资料