0

we are trying to implement silent push notifications in our react native app. Unfornately we get some strange trouble with iOS. After all we could find 3 cases, where push notifications arent received at our test iPhones properly.

We have also tested our new feature on Android but apparently these issues only occur on iOS. We found the same question on stackoverflow (iOS Silent Push Notification not delivered after device reboot) but the answers were not quite helpful.

In our first case we discovered that the delivery of Push Notifications to multiple iPhones doesnt seem reliable. We tested this problem with 2 phones (iOS 15 + iOS 16), where one of them doesnt receive messages correctly. On the one hand the messages were not displayed after starting our app and on the other hand the notifications didnt show up at all. We couldnt find any reasons for that and we are pretty sure that React Native is not the problem here. We could only find this strange log:

"com.apple.pushLaunch.de.example.app:37D069:[{name: ApplicationPolicy, policyWeight: 50.000,
response: {Decision: Absolutely Must Not Proceed, Score: 0.00, 
Rationale: [{[pushDisallowed]: Required:0.00, Observed:1.00},]}}
{name: BootTimePolicy, policyWeight: 0.010, response: 
{Decision: Must Not Proceed, Score: 0.00, 
Rationale: [{[Minimum seconds after boot]: Required:120.00, Observed:68.56},]}}
{name: , policyWeight: 1.000, response: {Decision: Must Not Proceed, Score: 0.00, 
Rationale: [{timeSinceThunderingHerdTriggerEvent < 300}]}}], 
FinalDecision: Absolutely Must Not Proceed}"

Our second problem occur when we send a push notification to an inactive phone. After sending the message and booting our phone, we are not able to receive the message at all except the user start the app. This problem always occur when the phone was off.

The third problem is quite similar to the second one. First we reboot our test device and send after that a push notification via APNS. The user will not receive any messages, if the app is not started. We could find this log:

"Daemon Canceling Activities: {(com.apple.pushLaunch.de.example.app:E7F648)}"

"CANCELED:com.apple.pushLaunch.de.example.app:E7F648 at priority 5 <private>!"
 
"com.apple.pushLaunch.de.example.app:71F21A:[
{name: ApplicationPolicy, policyWeight: 50.000, response: 
{Decision: Absolutely Must Not Proceed, Score: 0.00, 
Rationale: [{[pushDisallowed]: Required:0.00, Observed:1.00},]}}
{name: ThunderingHerdPolicy, policyWeight: 1.000, response: 
{Decision: Must Not Proceed, Score: 0.00,
Rationale: [{timeSinceThunderingHerdTriggerEvent < 300}]}}], 
FinalDecision: Absolutely Must Not Proceed}"

Our payload has only the content-availability header set to true. There is no other header specified in the payload. The response of the Apns is always 200.

All these problems seems to be an hotfix but we could not find any useful informations by apple. Any ideas would be very helpful.

For Android and iOS we use the react native libraries:

em_ag
  • 9
  • 2
  • A silent push notification will not launch an app that isn't running. Silent push notifications are also rate limited, so they may not always be delivered depending on how many you send to a particular device and over what time frame. Finally, device push tokens can change. Does your code correctly capture push token changes? – Paulw11 Dec 16 '22 at 19:35
  • Thanks for helping, Paul. Yes, we have implemented an update function for our device token. We have tested it on android as well and it worked fine. In my tests i send only 3 messages for 2 devies at the same time. Is there a diffrent way to solve this problem? We have figured out that the ThunderingHeardPolicy is only available for 6 min. The ApplicationPolicy is the only one left. I dont understand the pushDisallowed error message in this policy. Is this a permission error? – em_ag Dec 19 '22 at 17:25

0 Answers0