Azure的通知中心:通知没有显示出来,如果​​发送到组 [英] Azure Notification Hub: notifications not showing up if sent to group

查看:213
本文介绍了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的门户网站,但没有任何错误present。

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

难道你们有什么想法?

推荐答案

您描述的行为是不正确。有一个已知的问题,这可能会导致这类错误对于苹果只

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天全站免登陆