Posts

Post not yet marked as solved
0 Replies
169 Views
Hey have a few questions regarding updating apple wallet passes using APNS. What happens if the receiving device is switched off? Is the notification sent again by apple or do I need to send again myself? On booting the phone are passes automatically updated? e.g. Do they make the request to my server for a new design - or will the user need to force refresh / send the apns notification again. Does low power mode affect any of the pass update flow? Thanks!
Posted
by che_irish.
Last updated
.
Post marked as solved
1 Replies
252 Views
Hi all, I've written the endpoint that returns a list of updatable passes serial numbers as outlined in this documentation: https://developer.apple.com/documentation/walletpasses/get_the_list_of_updatable_passes When I send the apns request to my phone (using push token, pass identifier and certificate) my phone reaches this endpoint and receives a list of serialnumbers it has that can be updated. return new JsonResponse([ 'serialNumbers' => $serialNumbers, 'lastUpdated' => Now::getTimestamp() ], Codes::HTTP_OK); Serial numbers is the array containing the correct numbers from the database. I have another endpoint that sends the correct passes back to the phone. I can see this by pulling down and force updating the pass - the endpoint is hit, sends the new pass and the pass updates on the phone. The problem is that my phone won't call the second endpoint automatically when it receives the list of passes back - it only updates when I force it too. This means the route must be correct I believe. The pass also has Automatic Updates turned on. Am I missing something? Is the response malformed or something? Thanks in advance :)
Posted
by che_irish.
Last updated
.
Post marked as solved
1 Replies
468 Views
I'm sending using this code: curl -v -d "{ \"aps\" : { \"alert\" : \"Hello\" } }" -H "apns-topic: <my-pass-identifier>" --http2 --cert <my-pass-pem-certificate> https://api.push.apple.com/3/device/<my-push-token> to an apple wallet pass I have on my phone. I'm getting this as a response: * TCP_NODELAY set * Connected to api.push.apple.com (17.188.162.78) port 443 (#0) * ALPN, offering h2 * ALPN, offering http/1.1 * successfully set certificate verify locations: * CAfile: /etc/ssl/certs/ca-certificates.crt CApath: /etc/ssl/certs * TLSv1.3 (OUT), TLS handshake, Client hello (1): * TLSv1.3 (IN), TLS handshake, Server hello (2): * TLSv1.3 (IN), TLS Unknown, Certificate Status (22): * TLSv1.3 (IN), TLS handshake, Unknown (8): * TLSv1.3 (IN), TLS handshake, Request CERT (13): * TLSv1.3 (IN), TLS handshake, Certificate (11): * TLSv1.3 (IN), TLS handshake, CERT verify (15): * TLSv1.3 (IN), TLS handshake, Finished (20): * TLSv1.3 (OUT), TLS change cipher, Client hello (1): * TLSv1.3 (OUT), TLS Unknown, Certificate Status (22): * TLSv1.3 (OUT), TLS handshake, Certificate (11): * TLSv1.3 (OUT), TLS Unknown, Certificate Status (22): * TLSv1.3 (OUT), TLS handshake, CERT verify (15): * TLSv1.3 (OUT), TLS Unknown, Certificate Status (22): * TLSv1.3 (OUT), TLS handshake, Finished (20): * SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384 * ALPN, server accepted to use h2 * Server certificate: * subject: CN=api.push.apple.com; OU=management:idms.group.887777; O=Apple Inc.; ST=California; C=US * start date: Mar 24 17:21:08 2021 GMT * expire date: Apr 23 17:21:07 2022 GMT * subjectAltName: host "api.push.apple.com" matched cert's "api.push.apple.com" * issuer: CN=Apple Public Server RSA CA 12 - G1; O=Apple Inc.; ST=California; C=US * SSL certificate verify ok. * Using HTTP2, server supports multi-use * Connection state changed (HTTP/2 confirmed) * Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0 * TLSv1.3 (OUT), TLS Unknown, Unknown (23): * TLSv1.3 (OUT), TLS Unknown, Unknown (23): * TLSv1.3 (OUT), TLS Unknown, Unknown (23): * Using Stream ID: 1 (easy handle 0x55e534069600) * TLSv1.3 (OUT), TLS Unknown, Unknown (23): > POST /3/device/<my-token> HTTP/2 > Host: api.push.apple.com > User-Agent: curl/7.58.0 > Accept: */* > apns-topic: <my-pass-identifier> > Content-Type: application/json > Content-Length: 33 > * TLSv1.3 (OUT), TLS Unknown, Unknown (23): * We are completely uploaded and fine * TLSv1.3 (IN), TLS Unknown, Certificate Status (22): * TLSv1.3 (IN), TLS handshake, Newsession Ticket (4): * TLSv1.3 (IN), TLS handshake, Newsession Ticket (4): * TLSv1.3 (IN), TLS Unknown, Unknown (23): * Connection state changed (MAX_CONCURRENT_STREAMS updated)! * TLSv1.3 (OUT), TLS Unknown, Unknown (23): * TLSv1.3 (IN), TLS Unknown, Unknown (23): * TLSv1.3 (OUT), TLS Unknown, Unknown (23): * TLSv1.3 (IN), TLS Unknown, Unknown (23): < HTTP/2 200 < apns-id: A63D160A-20D0-6880-8B97-5FD0A7923753 < * Connection #0 to host api.push.apple.com left intact I think is successful - I'm getting a 200 response and an apns-id, but I'm not getting a push notification or anything on my phone. Is there anything wrong with this curl request or something else? Thanks
Posted
by che_irish.
Last updated
.