Azure的通知集线器注册生存时间(90天限制) [英] Azure Notification Hubs registration time to live (90 days limit)

查看:332
本文介绍了Azure的通知集线器注册生存时间(90天限制)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在我使用 PushSharp 库送苹果推送通知(通过APNS),但我希望迁移到集线器的通知健壮性和可扩展性。

Now I'm using PushSharp library to send Apple push notifications (through APNS), but I want to migrate to Notification Hubs for robustness and scalability.

我计划实施,因为在<描述了一个通过使用后台登记的Azure通知集线器发送通知href=\"http://azure.microsoft.com/en-us/documentation/articles/notification-hubs-mobile-services-notify-users/\">this文章。所以:

I'm planning to implement sending notification via Azure Notification Hubs using backend registration as described in this article. So:


  1. 有后端API的方法的的iOS客户端调用,当它已经推令牌更新。在此方法中我做了登记与用户ID标记它。 (previously,我推存储令牌到数据库用户的链接。)

  2. 当我有一些通知,因为我使用标签(用户ID)发送一个特定的用户发送。 (previously,我使​​用DB APNS设备令牌。)

这似乎是一个可行的解决方案,但在通知集线器文档它说:

It seems like a working solution, but in Notification Hubs documentation it's said:

要注意,登记是瞬变是很重要的。到PNS类似处理,它们含有,注册到期。您可以设置住了登记的通知中心,最多不超过90天的时间。这一限制意味着他们必须定期刷新,而且,他们不应该成为重要的信息的唯一存储。这种自动失效也简化了,当你的移动应用被卸载清理。

It is important to note that registrations are transient. Similar to the PNS handles that they contain, registrations expire. You can set the time to live for a registration on the Notification Hub, up to a maximum of 90 days. This limit means that they must be periodically refreshed, and also that they should not be the only store for important information. This automatic expiration also simplifies cleanup when your mobile application is uninstalled.

和这就是问题所在。有时候,我需要发送通知到没有更新标记为90天等登记设备。所以APNS令牌仍将活跃,但通知中心的注册将无效。于是我就失去了用户的沟通渠道。

And that is the problem. Sometimes I need to send notification to devices that haven't updated the token for 90 days and so forth the registration. So the APNS token will still be active, but Notification Hub's registration will be invalidated. So I just lose the communication channel for the user.

你是如何处理的?

当然,我仍然可以保存令牌DB和更新注册定期进行工作。但是,这不是你喜欢从轮毂的通知推送通知解决方案的期望。

Of course, I can still store tokens in DB and make a job that updates registrations periodically. But that's not what you expect from a push notification solution like Notification Hubs.

推荐答案

您可以从应用程序或从服务器刷新您的注册。如果您从您的应用程序做到这一点,应用程序必须由用户为了发起的注册被刷新。

You can either refresh your registrations from the application or from your server. If you do it from your application, the app must be launched by the user in order for the registration to be refreshed.

因此​​,如果您需要注册设备保持活跃,即使对于没有超过90天推出的应用程序,你必须通过你的服务器刷新注册,并运行在服务器的作业,将刷新令牌恍如你唯一的选择。

Therefore, if you require that device registrations remain active even for apps that weren't launched for over 90 days, you have to refresh the registration via your server, and running a job in your server that would refresh the tokens seems like your only option.

我同意,通知枢纽的决定到期令牌似乎很奇怪。也许他们心目中MPNS(微软推送通知服务)的通知渠道,这比APNS设备令牌或GCM注册ID到期更经常的行为。

I agree that Notification Hubs' decision to expire the tokens seems strange. Perhaps they had in mind the behavior of MPNS (Microsoft Push Notification Service) notification channels, which expire more often than APNS device tokens or GCM registration IDs.

这篇关于Azure的通知集线器注册生存时间(90天限制)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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