简体   繁体   English

移动(xamarin)应用通知Azure

[英]Mobile (xamarin) App notifications Azure

Using Azure Notification Hub for registering devices and sending push notifications for the App we are developing (iOS/Android) I have two questions : 使用Azure通知中心注册设备并为我们正在开发的应用(iOS / Android)发送推送通知我有两个问题:

  1. How can I set the Expire Date of a registration or installation? 如何设置注册或安装的到期日期? I think I want to set this expire Date to 30 days after registering the device with Azure in order for housekeeping to take place. 我想将过期日期设置为在Azure中注册设备后的30天,以便进行内部整理。 Or is there another mechanism for Azure for self-cleaning registrations/installations? 还是Azure可以使用另一种机制来进行自清理注册/安装? setting installation.ExpireTime to a specific date time does not seem to do the trick. 设置installation.ExpireTime到特定的日期时间似乎不起作用。

  2. Say the requested PNS Handle received from Google Cloud Messaging changes, how do I know exactly what registration/installation to update, given the fact that after deleting the App (and getting a new PNS Handle) I no longer know the "old" PNS Handle because the local storage for this app is empty? 假设从Google Cloud Messaging收到请求的PNS句柄更改,鉴于删除应用程序(并获得新的PNS句柄)后我不再知道“旧” PNS句柄,我如何确切知道要更新的注册/安装因为此应用程序的本地存储空间为空? The user is not unique since the user can have multiple devices. 用户不是唯一的,因为用户可以具有多个设备。 In other words : How do I uniquely identify the device? 换句话说:如何唯一标识设备?

  1. Check out this answer about Expiry date 查看有关有效期的答案
  2. I haven't tried that myself, but it looks like there're ways to persist local storage across re-installations . 我自己还没有尝试过,但是看起来好像有方法可以在重新安装期间保持本地存储 But even if you don't do that, what's going to happen is you would register the same handle twice with different registration IDs and the first will just stay for some time within ANH, but you're still going to be using the second one and the device will keep receiving notifications. 但是,即使您不这样做,也将发生相同的情况:您将使用相同的注册ID两次注册相同的句柄,而第一个将在ANH中保留一段时间,但是您仍将使用第二个设备将继续接收通知。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM