What are possible reasons for a mobile device to not receive a push notification?

There are several reasons for not receiving a push notification on a mobile device:

  • Incorrect or non-registered PEM Key from Apple - you can test the validity of your push certificates using a command line tool
  • Invalid push notification payload published as a message
  • In particular, valid APN payload cannot exceed 2KB and 4KB for a GCM payload
  • User disabled the receipt of push notifications for the app
  • Device unreachable by mobile push service within expiry window (1 hr for APN)
  • Running app was designed to handle notifications silently
  • Using an outdated PubNub SDK library
  • The device is not yet registered for push notifications on the channel you publish to
    • Verify that the channel is registered to the device using this query: http://pubsub.pubnub.com/v2/push/sub-key/[sub-key]/devices/[device]

You can perform some high level debugging of push notification issues. Add a "pn_debug":true to your message payload, as follows:

{
    "pn_apns": {
        "aps": {
            "alert": "foo"
        },
    }
    "pn_debug": true
}

Then if you subscribe to the channel-pndebug you will see some debug info. In other words, if channel name is foo you can use the Dev Console http://pubnub.com/console to subscribe to foo-pndebug to see any resulting push notification debug messages.

Example messages

  • "Devices found for ['mpns'] push notification"
  • "Invalid APNS notification format"
  • "Invalid GCM notification format"