Apns is returning 200 to curl request but no push notification sent

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

Accepted Answer

The curl request (in general) is correct, and looks like the push was delivered to the device successfully.

I am not sure what your expectations are. A wallet update push will not create a visual notification on its own. It will simply instruct the device to contact your server for an update to a wallet item. If you are not seeing the item(s) getting updated, this is likely an issue between the device and your server at that stage.

You may want to try and debug and see if the device is able to contact your servers at all, and if your server is correctly responding with updated passes, and the updated data.

I'm facing the same problem. I get an HTTP 200 response but don't receive a callback to my server to get the updated pass.

I'm using the same certificate which was used to sign the pass, and sending a header of "apns-topic" with the PassTypeIdentifier (pass.something.com)

Any idea what's wrong?

Apns is returning 200 to curl request but no push notification sent
 
 
Q