简体   繁体   English

Azure 通知中心 - 如何获取已注册活动设备的总数

[英]Azure Notification Hubs - How to get total count of active device registered

We are using Microsoft.Azure.NotificationHubs to create registration and send push requests.我们正在使用Microsoft.Azure.NotificationHubs创建注册和发送推送请求。 We are almost reached limit in 10 million devices and looking to the way to destribute our devices between 2, 3 hubs.我们几乎达到了 1000 万台设备的限制,并且正在寻找在 2、3 个集线器之间分配我们的设备的方法。

We need to get "Active Device Registered" value, I found that we can use azure.managment rest api with notification hub provider to get it.我们需要获取“Active Device Registered”值,我发现我们可以使用 azure.managment rest api 和通知中心提供商来获取它。 We also can try to "Read all registrations" with checking ContinuationToken to get registrations batches and calculate this value on our side.我们还可以尝试通过检查 ContinuationToken 来“读取所有注册”以获取注册批次并在我们这边计算该值。

So, do we have other options to get "Active Device Registered" value?那么,我们是否有其他选项来获取“Active Device Registered”值? 在此处输入图像描述

Active device registered can be seen in Overview blade from Azure Portal,可以在 Azure 门户的概览刀片中看到已注册的活动设备,

You may want to know that Active devices are devices eligible to receive notifications.您可能想知道活动设备是有资格接收通知的设备。 They are defined as unique registration IDs for devices using Google Cloud Messaging or Amazon Device Messaging, channel uniform resource identifiers (URI) for devices using Windows notification service or Microsoft push notification Service, or device tokens for devices using Apple push notification service.它们被定义为使用 Google Cloud Messaging 或 Amazon Device Messaging 的设备的唯一注册 ID ,使用 Windows 通知服务或 Microsoft 推送通知服务的设备的通道统一资源标识符 (URI),或使用 Apple 推送通知服务的设备的设备令牌。

And when active device quota is reached, All new registrations against any hubs within the namespace of whose active device quota is reached will be interrupted.并且当达到活动设备配额时,所有针对其活动设备配额达到其命名空间内的任何集线器的新注册都将被中断。

In order to add more active devices you would need to create another notification namespace if the current limit hits the maximum value as per the quota limit that is limited to namespace level.为了添加更多活动设备,如果当前限制达到最大值(根据仅限于命名空间级别的配额限制),则需要创建另一个通知命名空间。

If you need support for more than 10 million registered devices, you must partition your devices across multiple namespaces.如果您需要支持超过 1000 万个注册设备,则必须跨多个命名空间对设备进行分区。

Reference: What is resource structure ;参考: 什么是资源结构 FAQ , 常见问题,

See: Notification Hubs Pricing请参阅: 通知中心定价

Also If you do not want to increase to another pricing tear or create new namespaces when the current one reaches the maximum number, you may delete registrations.此外,如果您不想增加到另一个定价撕裂或在当前命名空间达到最大数量时创建新的命名空间,您可以删除注册。

Installations are not automatically removed from our end unless they expire.安装不会自动从我们端删除,除非它们过期。 The expiration is set at the hub level and will default to never expire;过期时间在 hub 级别设置,默认为永不过期; overriding this will give an expiration time to each device registered from the hub.覆盖这将为从集线器注册的每个设备提供一个过期时间。

See expirationTime property on the request body for creation of an installation.请参阅请求正文中的expirationTime属性以创建安装。

So, used this api request to get dailyMaxActiveDevices for all hubs in my namespace from our .net core app.因此,使用此 api 请求从我们的 .net 核心应用程序获取我命名空间中所有集线器的 dailyMaxActiveDevices。 https://learn.microsoft.com/en-us/rest/api/notificationhubs/notification-hubs/list?tabs=HTTP https://learn.microsoft.com/en-us/rest/api/notificationhubs/notification-hubs/list?tabs=HTTP

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

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