Search code examples
iosswiftapple-push-notifications

iOS Silent Push notifications are failing with message


I am trying to make Silent push notifications work in my app and I am not seeing the notification being received when the app is in background but when the app is in foreground the notification method gets called.

When I checked in console logs, I could see that my notifications are indeed being received by the phone but iOS doesn't show them. This is the log I get when the notification is not received,

com.apple.pushLaunch.<bundle id>:439286:[
    {name: NetworkQualityPolicy, policyWeight: 11.400, response: {Decision: Absolutely Must Not Proceed, Score: 0.00, Rationale: [{[unconstrainedNetworkAvailable]: Required:1.00, Observed:0.00},{requestsLaunch == 1}]}}
 ], FinalDecision: Absolutely Must Not Proceed}

Any one here has an idea about this "NetworkQualityPolicy" which is not allowing my notification to be shown?


Solution

  • It is working now, I was using api.sandbox.push.apple.com:443 which is mentioned in https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/sending_notification_requests_to_apns/

    when I switched to api.development.push.apple.com:443, it works fine