Good afternoon) I am doing one of the test projects to create a PKPASS and a server to update this file on the device, as well as sending PUSH-a. APN service is used with JWT Bearer token. The server is written in Java Springboot.
We try to send push notification, pkpass update happens, response from APN 200 OK. But there is no notification, can you please tell me why this is happening?
I am also sending you a sample request:
curl -v -X POST
-H "apns-push-type: alert"
-H "apns-id: 5af474c5-a212-42f3-9f99-70a9e587e1e2"
-H "apns-topic: pas.example225"
-H "apns-expiration: 0"
-H "authorization: bearer eyJraWQiOiJGQ0pQVFFMV1ZNIiwiYWxnIjoiRVMyNTYifQ.eyJpc3MiOiI2N0ZGUTY1TEQzIiwiaWF0IjoxNzMwMzY3NzQ4fQ.FGXSLCR6mxkQyi7bNliZKZbVdN3m0xQzFSMUDRFU4aAYIgsgflk5MDEkS9k5riMHp10wpr80b20uq9cuPnoQqw"
--data '{"aps":{"alert":{"title":"title","subtitle":"subtitle","body":"body"}}}' \
P.S. I checked JWT on the page: https://icloud.developer.apple.com JWT was built correctly.
Thank you for your reply)
Translated with DeepL.com (free version)
You can’t send arbitrary notifications to wallet passes. And if you want to show a visible notification when the pass is updated, using the “alert” key is not the way to do it.
To show a visible notification when the pass is updated, you need to add a changeMessage
field to your update JSON.
Like so
"fields": {
"PassField1": {
"changeMessage": "Your flight is now at %@",
"value": "5:45",
"label": "Flight time"
}
}
}
As you said pass update happens, I will assume you have everything else configured correctly.