【问题标题】:Sending bulk notification to Apple Push Notification using Push Sharp in .Net在 .Net 中使用 Push Sharp 向 Apple Push Notification 发送批量通知
【发布时间】:2016-02-15 10:21:13
【问题描述】:

我们能否在 .Net 中向 Push Sharp Apple Notification Service 发送批量通知。如果我想将类似的消息发送到多个设备,我该如何在 .net 中发送。我知道如何发送到单个设备,但要求是发送到多个设备

【问题讨论】:

    标签: c# .net push-notification apple-push-notifications pushsharp


    【解决方案1】:

    是的!有可能,只是不要在单个通知上设置多个设备令牌。您需要将每个设备推送到 QueueNotification。循环只是将这些设备添加到队列中,它会批量发送通知。

                       foreach (IosDevice device in devices)
                            {
                                push.QueueNotification(new AppleNotification()
                               .ForDeviceToken(device.DeviceToken)
                               .WithAlert(DateTime.Now.ToString())                        
                               .WithBadge(device.BadgeCount + 1)
                               .WithSound(notification.SoundFile));
                            }
    

    希望这会有所帮助!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-01-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多