gpt4 book ai didi

azure - PWA 仅使用 JS 为 Azure 通知中心注册推送通知

转载 作者:行者123 更新时间:2023-12-04 13:43:49 27 4
gpt4 key购买 nike

我正在创建一个 PWA,并按照此 Google 实验室 - Adding Push Notifications to a Web App 中详细介绍的订阅推送通知的示例进行操作。

该示例使用 Firebase 云消息传递 (FCM),但我们已经有一个 Azure 通知中心

我是否可以使用相同的方法(仅限 JS)向 ANH 注册 - 是否可以发送包含集线器名称、连接字符串和注册 ID 的有效负载的 API 调用?

最佳答案

您可以查看有关 Tutorial: Push notifications to Chrome apps with Azure Notification Hubs 的文档。那里有一个示例代码,可以发送包含中心名称、连接字符串和注册 ID 的 API 调用。

Note: The sample uses CryptoJS v3.1.2. If you downloaded another version of the library, make sure you properly substitute the version in the src path.

哪里CryptoJS是一个不断增长的标准和安全加密算法的集合,在JavaScript 使用最佳实践和模式。

关于azure - PWA 仅使用 JS 为 Azure 通知中心注册推送通知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52518715/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com