question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot receive notifications on pass content update

See original GitHub issue

@figuerb @alexandercerutti Thanks for all the info. I am facing a slightly different but relating to not getting notifications issue.

I have setup PK WebServices as per docs. Im able to update my pass Ie: Touch to pull on back of pass says “Updated just now” and shows the changes. But dont get notifications of changes.

In “Get Pass” api call I have this header "Last-Modified": new Date().toUTCString() set.

On Get Serial function, I am returning in the body like below:

body: {
      serialNumbers: ["12312312", "123123"],
      lastUpdated : new Date().toUTCString()
}

Using Node APN for push https://github.com/node-apn/node-apn

Created a token from Apple Dev portal. https://developer.apple.com/account/resources/authkeys/list

var apnProvider = new apn.Provider({
    token: {
      key: AuthKey_xxx.p8", // Path to the key p8 file
      keyId: "xxx", // The Key ID of the p8 file
      teamId: "nnn", // The Team ID of your Apple Developer Account
    },
    production: true,
  });

var notification = new apn.Notification();
notification.topic = passTypeIdentifier;
notification.payload = { };

I get this response:

{
    "sent": [
        {
            "device": "8cxxx4"
        }
    ],
    "failed": []
}

So Apple sent it successfully I dont get any notifications. I have all fields with ChangeMessage set

{
    "key": "aux1",
    "label": "Aux1",
    "value": "Value",
    "row":0,
    "textAlignment": "PKTextAlignmentLeft",
    "changeMessage": "This changed to %@"
}

Now the logs call says there is an error in Get Serial function. Logs only show when there was an error, dont have any logs on success. Dont get any logs during device register, Pass Get or update.

Get serial #s task (for device xxx, pass type pass.com.xxx.xxx, last updated (null); with web service url https://xxx ) encountered error: Unexpected response code 502

“Get serial” call was getting / couldnt read “last updated (null)”. Am I missing some thing very obvious!

_Originally posted by @Dicondur in https://github.com/alexandercerutti/passkit-generator/issues/33#issuecomment-643078377_

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
alexandercerutticommented, Jun 13, 2020

I also found this. Give it a check: https://stackoverflow.com/a/47548514/2929433

1reaction
alexandercerutticommented, Jun 13, 2020

Sorry for the delay, but it took me a while to create a response with few details after creating the new issue topic.


Well, everything looks fine to me, but I actually don’t know what might be wrong… I’ve never created a server for passes updates.

The logs say that the server responded at that endpoint with code 502… so there’s kinda a problem with your webserver, I think? I don’t know if that might be depending on Node-APN configuration or not.


Also:

According to Node-APN’s Provider docs:

Being sent does not guaranteed the notification will be delivered, other unpredictable factors - including whether the device is reachable - can ultimately prevent delivery.


Now the logs call says there is an error in Get Serial function. Logs only show when there was an error, dont have any logs on success. Dont get any logs during device register, Pass Get or update.

So are you able to get pass? Can you see some logs you own (like CLI console.log) from Apple Wallet at webServiceURL/version/passes/passTypeIdentifier/serialNumber endpoint you created?

I’m asking you this because it feels like, according to the schema that Apple provided, that it is failing on the second step, so “Get changes”.

About last updated (null);, does this happen every time or only the first time? I found this topic on Stack Overflow while doing some researches.

Let me know.

Read more comments on GitHub >

github_iconTop Results From Across the Web

notifications after iOS 15.4 update - Apple Community
Hi! I am having a problem with my iPhone XR notifications after iOS15.4 update. I receive no notifications unless I open the app...
Read more >
Fix subscriber notification problems - YouTube Help
Viewer notification settings cause almost all notification issues. Ask viewers to use the notifications troubleshooter if they aren't getting notifications.
Read more >
Why am I not receiving notification emails? - Azure DevOps
Not getting emails from subscriptions or notifications · Check other email folders · Locate the subscription and ensure it's enabled · Closely ...
Read more >
Manage Xbox and app pop-up notifications
Sign in to your account in the Xbox app. · Select your gamertag and then Settings. · Select Notifications. · Update the checkboxes...
Read more >
Apple Passes in Wallet don't update on push notifications
When I do manual update, the pass updates and an update notification shows. I cannot get what I did wrong... P.S. I use...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found