Silent push notifications only delivered if device is charging and/or app is foreground

后端 未结 8 933
囚心锁ツ
囚心锁ツ 2020-11-30 18:26

I have implemented silent push notifications but I have noticed some strange behaviour. The silent push notifications are handled via:

- (void)application:(         


        
8条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-30 18:57

    I've been experiencing this problem for some time, and am very grateful for this question and @Kevin D. sharing their understanding. I'm beginning to think that https://stackoverflow.com/a/30834566/1449799 and https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/CommunicatingWIthAPS.html#//apple_ref/doc/uid/TP40008194-CH101-SW4 (see priority in one of the tables) are describing why my app is having trouble:

    It is an error to use this priority for a push that contains only the content-available key.

    To send the notifications, I'm using node-apn where the default (which i also need) is to set the priority to max (10 [beware, it looks like only 10 and 5 are correct values at this time]), but since i wanted a silent notification, i don't have alert, badge, or sound set.

提交回复
热议问题