Azure NotificationHub 发送推送时凭据无效

Azure NotificationHub Invalid credentials when sending push

我已经设置了一个 Azure Notification Hub,并且完成了将 Push Notification 合并到我的 Android 应用程序中的所有步骤。该应用程序运行良好,可以正常接收推送通知。然后今天我去尝试发送推送但失败了。所以我尝试从 Azure Portal 那里也失败了。

它似乎只与 Android 相关,因为 运行 我在 iOS 中的应用正在接收 Push Notification 应有的设备。我知道我没有更改代码中的任何内容。但是,我现在没有像我应该的那样得到 Push Notification,而是在 Azure 门户中收到以下消息。

The Push Notification System rejected the request because of an invalid credential

有人知道为什么会这样吗?我很难过。 起初我想可能是我的 API 键(我也没有改变)所以我检查了一下。 Google Cloud Message API Azure Portal 中的键与我在 Google API Console 中的键匹配,所以不是那样。

它会是什么?

好的,下面是我解决问题的方法: 在 Google API 管理器中,我曾经只有一个 api 类型的键 - Android

我创建了另一个类型的密钥 - 服务器,并将其复制到我的 azure gcm 配置中,然后她走了......通知再次工作