macOS (Flutter) 云消息传递未接收消息

时间:2021-07-20 09:58:26

标签: macos flutter firebase-cloud-messaging

我正在尝试让我的 Flutter 应用程序使用云消息传递接收消息。这在 iOS 上运行良好,但对于我的 Flutter macOS 应用程序,无论我尝试什么都行不通。

关于如何执行此操作的在线文档似乎很少,甚至 the official documentation 也不是特别清楚。

我尝试过的:

  • 清理颤振
  • 移除 Pod 并重建
  • 从 Firebase 的测试页面和 Firebase 函数发送消息

我想知道我是否做错了:

  • 在文档中说 For iOS; you must have a physical iOS device to receive messages.,这是否意味着我在运行 macOS 应用程序时也应该做一些不同的事情?
  • 文档中说的 This guide applies to both iOS & macOS Flutter apps, repeat each step for the platforms you require,它的字面意思是每一步,因为有些步骤似乎没有重复,例如....
  • 我可以重复使用相同的 Firebase iOS app and Apple key 还是需要创建单独的 Firebase iOS 应用和单独的 Apple 密钥?
  • 我可以使用与 iOS 实现相同的 identifier 吗?

非常感谢!

1 个答案:

答案 0 :(得分:0)

对于尝试此操作的其他任何人,事实证明,使用默认构建方法的 MacOS 上不应该使用通知。相反,您必须使用经过公证的应用程序版本。非常感谢 Markus Aksli,他回复如下:

<块引用>

不,你可以在你的 mac 上运行,但是你需要一个具有 苹果公证 (https://github.com/FirebaseExtended/flutterfire/issues/5717)

<块引用>

您可以使用相同的标识符和密钥