Sending bulk notification to Apple Push Notification using Push Sharp in .Net

882 Views Asked by At

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

1

There are 1 best solutions below

0
On

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 !