Reputation: 93
Can we send bulk notification to Push Sharp Apple Notification Service in .Net. If I want to send the similar message to multiple devices, how can I send this in .net. I know how to send to single device, but requirement is to send to multiple devices
Upvotes: 0
Views: 882
Reputation: 159
Yes ! it is possible, Just don't set multiple device tokens on a single notification. You need to puch each device to QueueNotification. Loop is just to add those devices to queue, it sends the notification in bulk.
foreach (IosDevice device in devices)
{
push.QueueNotification(new AppleNotification()
.ForDeviceToken(device.DeviceToken)
.WithAlert(DateTime.Now.ToString())
.WithBadge(device.BadgeCount + 1)
.WithSound(notification.SoundFile));
}
Hope this helps !
Upvotes: 1