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:
- Created 3 years ago
- Comments:8 (4 by maintainers)
Top GitHub Comments
I also found this. Give it a check: https://stackoverflow.com/a/47548514/2929433
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:
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.