user1696555
user1696555

Reputation: 93

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

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

Answers (1)

Arun Thapa
Arun Thapa

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

Related Questions