Azure 通知中心:如果发送到组,则不会显示通知 [英] Azure Notification Hub: notifications not showing up if sent to group

查看:34
本文介绍了Azure 通知中心:如果发送到组,则不会显示通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法使通知中心正常工作.

I have a trouble making notification hub to work.

如果我向只有一个注册关联的标签发送通知,那么一切都很好.来源:

If I send notification to tag that has only one registration associated with it, then everything's fine. Here's source:

var alert = "{\"aps\":{\"alert\":\"some message(targeted)\"},\"inAppMessage\": \"text\"}";
hub.SendAppleNativeNotificationAsync(alert,"mytag").ContinueWith(t => {
    var outcome = t.Result;
    Console.WriteLine(outcome);
});

但是如果我尝试将通知发送给所有用户,如下所示:

But if I try to sent my notification to all users, like so:

var alert = "{\"aps\":{\"alert\":\"some message(all users)\"},\"inAppMessage\": \"text\"}";
hub.SendAppleNativeNotificationAsync(alert).ContinueWith(t => {
    var outcome = t.Result;
    Console.WriteLine(outcome);
});

然后没有人收到通知.我在 Azure 门户中检查了监视器,但没有出现错误.

then no one gets the notification. I checked monitor in Azure portal but there were no errors present.

你们有什么想法吗?

推荐答案

您描述的行为不正确.有一个已知问题可能会导致 Apple only 出现此类错误:

Behavior you described is incorrect. There is one known issue which can potentially cause such kind of errors for Apple only:

如果通知中心中的某些注册具有无效的设备令牌(这通常发生在应用程序从测试 APNS 切换到生产时,或者如果在模拟器中进行测试期间使用了一些假令牌),则 APNS 在发送和发送所有通知期间终止连接之后使用相同的连接被忽略.目前通知中心无法正确处理这种情况.

If some registrations in the Notification Hub have invalid device token (it typically happens when application switches from test APNS to production or if some fake tokens were used during testing in emulator) then APNS terminates connection during the send and all notifications being sent after that using same connection are just ignored. Right now Notification Hub does not handle this situation correctly.

修复方法 - 清除不良"注册.如果您正在开发/测试并且丢失数据并不重要 - 只需删除所有注册.如果您有很多现有用户,请给我发电子邮件,我们将尝试为您的特定情况找到解决方案.

Way to fix - clean up "bad" registrations. If you are about developing/testing and it is not critical to lose the data - just remove all the registrations. If you have a lot of existing users then email me and we will try to find solution for your particular case.

这篇关于Azure 通知中心:如果发送到组,则不会显示通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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