0

As I see here Look at the passes table, and determine which passes have changed since the given tag But what should I send if I get the wrong tag, for example with Future date like 01.01.2020

1) Should I send status NotModified or should I send NoContent, or I should send every serial with the latest tag?

2) And If I get the situation when a tag has date/information, in my case I have a timestamp, but anyway, If wasn't any wallet modification yet but I got a new tag? should I send something?

Like UpdateSinceTag = 1200 In wallet, I have 3 passes with tags 950,900,200. What should I send now? It close to first my question.

Dred
  • 1,076
  • 8
  • 24
  • How did 1200 get sent? Apple will only send you a tag that you have provided. You can use any tag you like, but most of us just use a unix timestamp. – PassKit Jul 19 '19 at 11:07
  • The call comes direct from the device, so it tells you the device is already holding the pass with the tag 1200. – PassKit Jul 19 '19 at 11:17
  • @PassKit, Yes, I acctualy send timestamp. But I get in my log something like `for SN =` **here is my SN** `evaluatePreconditions If-Modified-Since = Tue, 23 May 2023 21:08:08 GMT If-Unmodified-Since = null lastModified = Fri Jul 19 14:01:14 MSK 2019 serial =` **here is my SN** – Dred Jul 19 '19 at 11:26
  • But how are you sending the tags? – PassKit Jul 19 '19 at 11:27
  • Actually, I still don't know how pushes are sent, But when I get `/devices/{deviceLibraryIdentifier}/registrations/{passTypeIdentifier}` I check: **1)** Have I any serials for that dives -- if Not then send **NoContent** then **2)** I check have I any wallets connected to that serials, if Not I send **NoContent** then **3)** I check TAG, If `tag==null || tag<=0` I get 1 the latest tag (from each wallets) and all serials and send it like **Response.OK**, Otherwise, `tag>0` I check if any modified wallets(I actually mean wallet, not pass) which was modified before `Tag` – Dred Jul 19 '19 at 11:37
  • @PassKit If I find anyone serial so, I send array of serials and time when it serial (wallet) was modified. If I didn't find any, I send **NotModified** But should I send Empty array with current timestamp instead? – Dred Jul 19 '19 at 11:39
  • The `Getting the Serial Numbers for Passes Associated with a Device` endpoint is only ever hit after you send a push request to Apple. `/devices/{deviceLibraryIdentifier}/registrations/{passTypeIdentifier}` is a registration request. You should just send a 200 or 201 response to that and record the device token in the payload. – PassKit Jul 19 '19 at 11:42
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/196703/discussion-between-dred-and-passkit). – Dred Jul 19 '19 at 11:43
  • From [here](https://developer.apple.com/library/archive/documentation/PassKit/Reference/PassKit_WebService/WebService.html#//apple_ref/doc/uid/TP40011988-CH0-SW2) **Registering a Device to Receive Push Notifications for a Pass** `webServiceURL/version/devices/deviceLibraryIdentifier/registrations/passTypeIdentifier/serialNumber` but **Getting the Serial Numbers for Passes Associated with a Device** is `webServiceURL/version/devices/deviceLibraryIdentifier/registrations/passTypeIdentifier?passesUpdatedSince=tag` – Dred Jul 19 '19 at 11:46
  • @PassKit *How did 1200 get sent? Apple will only send you a tag that you have provided.* Where Should I provide it? in **/devices/{deviceLibraryIdentifier}/registrations/{passTypeIdentifier}** ? And which `tag` should I send if none SN I found? – Dred Jul 22 '19 at 09:40

1 Answers1

0

As I have tested, It doesn't matter should I send in Response null as serialNumbers or some new Object as new ArrayList() or String[], it doesn't matter. I will always get error from APNs like

ERROR Error REST из apple wallet [2019-08-13 11:21:15 +0300] Web service error for pass.team.id (https://backend.myendpoint.ru): Device received spurious push. Request for passesUpdatedSince '1584219668000' returned no serial numbers. (Device = 735fe3b6ce8dcc2111)

But that answer still doesn't satisfy me, I hope on the better answer.

Dred
  • 1,076
  • 8
  • 24