Apple Wallet Pass is not receiving push notifications

Hi!

I have set up an APNS API that sends push notifications to update my Apple Wallet pass. I am using the APN library and a .p8 key for APNS push notifications. I keep getting 200 responses and "sent successfully" logs, but Apple Wallet is not receiving the notification.

Which configuration or payload should I check to make it work?

Thanks

Answered by DTS Engineer in 856036022

Hi @nobodybert,

You wrote:

I have set up an APNS API that sends push notifications to update my Apple Wallet pass. I am using the APN library and a .p8 key for APNS push notifications. I keep getting 200 responses and "sent successfully" logs, but Apple Wallet is not receiving the notification.[...] Which configuration or payload should I check to make it work?

To send a pass update push notification, perform the following steps:

  1. Find the registered devices for the updated pass.
  2. Create and send a push notification for each registered device.
  3. Verify your notification matches the following criteria:
    • uses the same certificate and private key that the creator of the original pass used for signing
    • the push token registered by the device
    • contains an empty JSON dictionary for the notification payload.

Note: A push notification for a pass update works only in the production environment. The sandbox environment will not deliver notifications of this type.

For invalid push token errors, delete the associated device from APNs.

If the above steps don't resolve your issue, please review the post below so I can begin my investigation:

Gathering Required Information for Troubleshooting Wallet Issues https://developer.apple.com/forums/thread/766778

If you do need me to investigate this issue, once you submit your Feedback report, reply here with its Feedback ID.

Cheers,

Paris X Pinkney |  WWDR | DTS Engineer

Hi, this is my setup — hope it works for you:

In a service file, I have the following import and constructor:

import apn from 'apn';

private apnProvider: any;

constructor() { const keyPath = path.resolve(__dirname, ${process.env.APNS_KEY_PATH}); const key = fs.readFileSync(keyPath); const keyId: string = process.env.KEY_IDENTIFIER || ""; const teamId: string = process.env.TEAM_IDENTIFIER || "";

if (!keyId || !teamId) {
  throw new Error("Missing APNS key identifier or team identifier.");
}

this.apnProvider = new apn.Provider({
  token: {
    key,
    keyId,
    teamId,
  },
  production: true,
});

}

Then I call a method that triggers the APNS as follows

private async sendPushNotification(devicePushToken: string, passTypeIdentifier: string): Promise<void> { const notification = new apn.Notification(); notification.topic = passTypeIdentifier; notification.contentAvailable = true;

try {
  const result = await this.apnProvider.send(notification, devicePushToken);
  console.log("APNs response:", result);

  if (result.failed.length > 0) {
    console.error('Failed to send push notification:', result.failed);
    await insertWebLog('error', result.failed, `sendPushNotification on push-notification.service.ts`);
  } else {
    console.log('Push notification sent successfully');
  }
} catch (error) {
  console.error('Error sending push notification:', error);
  throw new Error(`Error sending push notification: ${error}`);
}

}

Hi @nobodybert,

You wrote:

I have set up an APNS API that sends push notifications to update my Apple Wallet pass. I am using the APN library and a .p8 key for APNS push notifications. I keep getting 200 responses and "sent successfully" logs, but Apple Wallet is not receiving the notification.[...] Which configuration or payload should I check to make it work?

To send a pass update push notification, perform the following steps:

  1. Find the registered devices for the updated pass.
  2. Create and send a push notification for each registered device.
  3. Verify your notification matches the following criteria:
    • uses the same certificate and private key that the creator of the original pass used for signing
    • the push token registered by the device
    • contains an empty JSON dictionary for the notification payload.

Note: A push notification for a pass update works only in the production environment. The sandbox environment will not deliver notifications of this type.

For invalid push token errors, delete the associated device from APNs.

If the above steps don't resolve your issue, please review the post below so I can begin my investigation:

Gathering Required Information for Troubleshooting Wallet Issues https://developer.apple.com/forums/thread/766778

If you do need me to investigate this issue, once you submit your Feedback report, reply here with its Feedback ID.

Cheers,

Paris X Pinkney |  WWDR | DTS Engineer

Apple Wallet Pass is not receiving push notifications
 
 
Q