【问题标题】:Unable to send notification on android using Azure Notification Hub无法使用 Azure 通知中心在 Android 上发送通知
【发布时间】:2017-08-20 17:37:30
【问题描述】:

我正在尝试使用 Azure 通知中心向 Android 设备发送通知。

我已经按照教程here

android 模拟器可以注册到集线器,如屏幕截图所示,但是当我尝试发送测试消息时,我收到以下错误:

The Push Notification System handle for the registration is invalid

还算零???有没有注册?

Google 已更新 Firebase API,因此我已更新示例中的代码

String FCM_token = FirebaseInstanceId.getInstance().getToken();

String FCM_token = InstanceID.getInstance(this).getToken(NotificationSettings.SenderId, "RECEIVE");

我不确定第二个参数应该是什么。 Firebase documentation 建议它应该是范围。

不知道是什么导致了这个失败。任何帮助将不胜感激。

谢谢

【问题讨论】:

    标签: android firebase firebase-cloud-messaging azure-notificationhub


    【解决方案1】:

    你能用INSTANCE_ID_SCOPE试试吗?

    InstanceID.getInstance(this).getToken(NotificationSettings.SenderId, GoogleCloudMessaging.INSTANCE_ID_SCOPE, null)
    

    【讨论】:

    • 谢谢萨提什!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-11-26
    • 2020-12-24
    • 2021-06-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-02-22
    相关资源
    最近更新 更多