2012-12-07 6 views
3

PushSharp는 stop이 호출 될 때만 대기열을 처리합니다. 누구나 얼마나 자주 날카로운 물건을 처리하거나 그것을 내뿜을 지 생각하는 사람 있습니까? 리소스를 절약하기 위해 알림을 보내려고 할 때마다 중지하고 전화를 걸지 않으려합니다. 큐 타이머가 통지를 처리하기 전에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는 쓰레드를 기다려야 만했다. 아마도 다른 누군가에게 도움이 될 것이다.