2012-12-07 23 views
3

PushSharp僅在調用停止時處理隊列。有沒有人有一個想法多久推動鋒利將處理隊列或沖洗它?每次我想發送通知以節約資源時,我都不想每次都停止並啓動。PushSharp Push不會處理隊列,直到停止

  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); 

回答

6

我是個徹頭徹尾的白癡...

主線程執行完畢之前,隊列定時器可以處理通知。 StopAllServices強制線程等待...也許這會幫助別人。