Azure 推送通知中心在失败后不起作用 [英] Azure push-notification hub don't work after failure

查看:34
本文介绍了Azure 推送通知中心在失败后不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在服务器端,我们使用 Azure 和 SDK Azure 工具版本:2.2

On the server side, we are using Azure with SDK Azure Tools Version: 2.2

我们在 iOS 上发送失败的推送通知(APNS 错误确实出现在仪表板中).在此失败后,推送通知不会一直在此标签和集线器上工作.我们如何在不清除所有注册并创建新标签的情况下解决这种情况?

We send push-notifications on iOS with a failure (APNS Errors did appear in Dashboard). After this failure, push-notifications don't work on this tag and hub all the time. How can we fix this situation without clearing all registrations and creating a new tag?

通常的场景是这样的:1.标签工作正常.2. 例如,我们注册了一些带有错误证书的设备.仪表板中的错误.3. 标签完全不起作用.仪表板中的错误.以前收到通知的设备现在没有收到通知.

Usually scenario looks like this: 1. Tag works fine. 2. We register some device with wrong certificate for example. Errors in dashboard. 3. Tag doesn't work totally. Errors in dashboard. Devices which previously got notifications doesn't get it now.

我们可以更改一些内容以使旧的(在第 2 步之前添加)设备能够接收通知吗?

Can we change something to make old(added before step 2) devices able to get notifications?

推荐答案

Notification Hub 对 APNS 证书/令牌非常敏感.有几个规则:

Notification Hub is very sensitive to APNS certificates/tokens. There are couple rules:

  1. 避免使用无效(假)设备令牌或在发送到真实设备之前清理它们.如果需要使用假令牌运行一些单元测试,那么最好为此目的创建单独的集线器.

  1. Avoid to use invalid (fake) device tokens or clean them up before send to real devices. If it is required to run some unit tests with fake tokens then it is better to create separate hub for such purpose.

当需要从沙箱 APNS 证书/端点切换到生产证书/端点时(或返回),需要清理所有现有的 APNS 注册.或者更好的方法 - 只需为测试和生产创建单独的中心.

When it is time to switch from the sandbox APNS certificate/endpoint to the production one (or back) it is required to clean up ALL existing APNS registrations. Or even better way - just create separate hubs for test and for production.

这篇关于Azure 推送通知中心在失败后不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆