PushSharp Push在停止之前不会处理队列

时间:2021-05-29 21:14:10

PushSharp only processes the queue when stop is called. Does anyone have an idea how often push sharp will process the queue or flush it? I don't want to have to call stop and start every time I want to send a notification to conserve resources.

PushSharp仅在调用stop时处理队列。有没有人知道push sharp会处理队列或刷新队列的频率?每次我想发送通知以节省资源时,我都不想打电话停止和启动。

            pushService = new PushService();
            pushService.StartApplePushService(new ApplePushChannelSettings(prod,  cert.InputStream.ReadToEnd(), passConfig.Value));
  pushService.QueueNotification(
                NotificationFactory.Apple().ForDeviceToken("mydeviceid").WithAlert("Notifications Started!").WithSound("default").WithBadge(7));


            pushService.StopAllServices(true);

1 个解决方案

#1


6  

I'm a complete and utter idiot...

我是一个完整而彻底的白痴......

The main thread was completing execution before the queue timer could process the notification. StopAllServices forced the thread to wait... Maybe this will help someone else.

主线程在队列计时器处理通知之前完成执行。 StopAllServices迫使线程等待......也许这会帮助其他人。

#1


6  

I'm a complete and utter idiot...

我是一个完整而彻底的白痴......

The main thread was completing execution before the queue timer could process the notification. StopAllServices forced the thread to wait... Maybe this will help someone else.

主线程在队列计时器处理通知之前完成执行。 StopAllServices迫使线程等待......也许这会帮助其他人。