我有一个相当简单的应用程序,它使用两个标签、他们的 ID 和他们的语言向 Azure 通知中心注册了一些用户 Android 和 iOS 用户。但是,我注意到在向大型群组发送消息时,只有几个应该接收消息的 iOS 设备会收到消息。但是,如果我遍历所有帐户并使用他们的 ID 标签发送消息,每个 iOS 设备都会收到消息。
我知道无法保证 iOS 交付,但只有大约 10 台 iOS 设备,如果我使用 ID 标签,我已经能够向每台设备发送推送,但如果我使用语言标签或进行无标签推送,则不能.
我在 Basic 层级,有 1 个保留单位和 9 个最大单位。Azure 门户不会报告任何传递、网络或负载错误。
服务器端注册看起来有点像这样(按照 Azure此处列出的示例):
foreach(var user in users)
{
//ID is a long and unique per user
//Language is an int - all accounts being tested have language of 0
var tags = new HashSet<string>();
tags.Add("ID-" + user.ID);
tags.Add("Language-" + user.Language);
//Register or update based on user.Device
client.CreateAppleNativeRegistrationAsync(user.pushID, tags);
client.CreateGcmNativeRegistrationAsync(user.pushID, tags);
}
以下命中是所有 Android 设备,但并非始终如一地命中 iOS 设备。iOS 设备仅在十次左右的尝试中看到该消息。语言标记和无标记推送在 iOS 设备上的交付率大致相同。
string apnsMessage = "{\"aps\":{\"alert\":\"" + message + "\"}}";
string gcmMessage = "{\"data\":{\"message\":\"" + message + "\"}}";
//Language Tag
client.SendAppleNativeNotificationAsync(apnsMessage, "Language-0");
client.SendGcmNativeNotificationAsync(gcmMessage, "Language-0");
//Tagless Push
client.SendAppleNativeNotificationAsync(apnsMessage);
client.SendGcmNativeNotificationAsync(gcmMessage);
以下适用于所有 Android 和 iOS 设备。每台设备都在几秒钟内收到消息,99% 的时间。
string apnsMessage = "{\"aps\":{\"alert\":\"" + message + "\"}}";
string gcmMessage = "{\"data\":{\"message\":\"" + message + "\"}}";
foreach(var user in users)
{
client.SendAppleNativeNotificationAsync(apnsMessage, "ID-" + user.ID);
client.SendGcmNativeNotificationAsync(gcmMessage, "ID-" + user.ID);
}
问:是什么导致发送到大型组的通知无法一致地发送到该组中的所有设备,当使用他们的唯一标签发送给个人用户时可以正常工作?