0

我正在尝试使用 OneSignal 在我的 UWP 应用程序中获取推送通知。我已经从 Live Service 获得了 App Secret 和 Package SID(并在 OneSignal 仪表板上进行了注册)。根据 [Windows UWP][1] 的文档,我应该使用推送令牌作为标识符注册设备(并且 device_type 为 6)。

我有这个代码的频道uri

PushNotificationChannel pushNotificationChannel = await PushNotificationChannelManager.CreatePushNotificationChannelForApplicationAsync();

并在 OneSignal 上注册设备没有问题......但是当我尝试创建通知时,我收到以下错误(来自 OneSignal 服务):

{
"id": "",
"recipients": 0,
"errors": [
    "All included players are not subscribed"
],
"warnings": [
    "Windows Platform Errors: (Invalid Windows credentials) Windows rejected the request for an authentication token due to invalid credentials. Please check that your credentials are correct."
]

}

我尝试使用分配给仅从通道 uri 中提取的令牌以及整个通道 uri 的标识符来注册设备。但我总是得到同样的错误。

有人对 WNS 和 OneSignal 有经验吗?

这里是来自 OneSignal 的设备 JSON:

{
        "id": "cce63....",
        "identifier": "https://db5p.notify.windows.com/?token=AwYAAAB0h....",
        "session_count": 1,
        "language": "it",
        "timezone": null,
        "game_version": null,
        "device_os": null,
        "device_type": 6,
        "device_model": null,
        "ad_id": null,
        "tags": {},
        "last_active": 1540676034,
        "playtime": 0,
        "amount_spent": 0,
        "created_at": 1540676034,
        "invalid_identifier": false,
        "badge_count": 0,
        "sdk": null,
        "test_type": null,
        "ip": null
    }

谢谢,

问候

4

1 回答 1

0

和我的同事说他配置了 OneSignal,我发现在 OneSignal 配置中,App Secret 被打错了……在更正了 App Secret 之后,显然它可以正常工作了。

于 2018-11-01T10:12:14.453 回答