Android RegistrationId 推送通知

Android RegistrationId push Notification

我想从我的应用程序中获取注册 ID。在您的应用程序被发送到商店之前,registrationid 是否存在?如果没有,我该如何测试推送通知?

当设备上安装了带有 Firebase 云消息传递 SDK 的应用程序时,FCM 会使用该设备注册令牌将您的应用程序的消息传送到该设备。您的应用不需要在 Play 商店中即可实现。请参阅 accessing the registration token 上的文档以了解如何在您的应用程序代码中获取该令牌。

测试交付的最简单方法是 send a notification through the Firebase console,在这种情况下,您只需要 FCM 注册令牌或主题(您的应用程序代码订阅的主题)。

send a message to the device from (server-side) code,您需要FCM令牌(或再次主题)、FCM服务器密钥(或OAuth授权)和发件人ID。