【问题标题】:Firebase messaging only working in debug, but not in release mode (iOS)Firebase 消息传递仅在调试模式下工作,而不是在发布模式下工作 (iOS)
【发布时间】:2019-08-14 10:21:44
【问题描述】:

我正在使用带有 firebase 消息传递插件的颤振框架来启用推送通知。在调试模式下编译我的颤振应用程序时,Firebase 消息在 iOS 上正常工作。我还没有在Android上尝试过。但是当我在发布模式下编译时,没有推送通知出现。在 Firebase 中,我还没有填写 app-name 和 store-id,因为该应用还没有在 Apple AppStore 中发布。可能是这个问题吗?

【问题讨论】:

  • app-name 或 store-id 是什么?请问你解决了吗?
  • 您是否将 APN 密钥添加到 Firebase 控制台中的云消息传递中?您需要它并确保添加该功能

标签: firebase flutter firebase-cloud-messaging flutter-layout


【解决方案1】:

也有这个问题 (firebase_messaging: ^7.0.3),花了几个小时修复它。对我来说,工作了两个步骤:

第一

改变

<key>FirebaseAppDelegateProxyEnabled</key>
<true/>

<key>FirebaseAppDelegateProxyEnabled</key>
<string>NO</string>

ios/Runner/Info.plist 文件中。

更多信息在这里flutter: fcm ios push notifications doesn't work in release mode

第二次

当 init 推送时使用此代码

FirebaseMessaging firebaseMessaging = FirebaseMessaging();

if (Platform.isIOS) {
  firebaseMessaging.configure();
  userPermission = await firebaseMessaging.requestNotificationPermissions(
        const IosNotificationSettings());
}

【讨论】:

    猜你喜欢
    • 2023-03-03
    • 1970-01-01
    • 1970-01-01
    • 2023-01-11
    • 2021-12-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-20
    相关资源
    最近更新 更多