【问题标题】:Using local app to test Push Notification [duplicate]使用本地应用程序测试推送通知 [重复]
【发布时间】:2018-12-31 01:16:32
【问题描述】:

我在Android Developmentfcm 都是新手。我一直在构建一个移动应用程序,我想使用Firebase Cloud Messaging 向特定用户推送通知(通过让他们订阅不同的主题)。我已经创建了一个Java Server(除了移动应用程序),但我不知道如何在我的应用程序上测试它,因为我不知道如何为我的应用程序找到fcm key(如果有的话)。有没有办法测试我的服务器locally 或者是否有义务将应用程序注册到Google Firebase?任何帮助将不胜感激,在此先感谢。

【问题讨论】:

  • this 将帮助您获得fcm key

标签: android firebase push-notification


【解决方案1】:

有没有办法在本地测试我的服务器,或者是否有义务将应用程序注册到 Google Firebase?

您肯定需要将您的应用程序注册到 firebase 才能使用 FCM 并获取密钥。

我不知道如何在我的应用程序上测试它,因为我不知道如何为我的应用程序找到 fcm 密钥(如果有的话)。

在您将应用注册到 Firebase 并将其链接到您的 Android Studio 项目后, (https://firebase.google.com/docs/android/setup)

在 firebase 中转到您的项目设置,

在你的项目设置中,点击云消息,Server Key就是你的FCM KEY

按照此操作将消息从您的服务器发送到设备。您也可以使用 firebase 控制台来执行此操作,

How can I send a Firebase Cloud Messaging notification without use the Firebase Console?

【讨论】:

    【解决方案2】:

    是的,你可以。

    FCM API 密钥(服务器密钥)可以在您项目下的 firebase 控制台中找到:

    Project Settings > Cloud Messaging

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-06-06
      • 2011-08-07
      相关资源
      最近更新 更多