Apple PassKit, webservice invoked hundres of times

I'm trying to manage Apple loyalty cards. I'm using jpasskit to generate the pass (.pkpass bundle) and it works like a charm. Because I want to manage updates of the pass, I set the webServiceUrl.


I implemented all endpoints described in Apple's documentation but I'm facing two big issues:

  1. as soon I install the pass in my phone, Apple start to send me a LOT of register requests (just for one phone). Every request has a different
    deviceLibraryIdentifier
    (I know it's normal, it's not guaranteed that the phone sends the same identifier every time). With "a lot" I mean hundreds in few minutes. I reply with HTTP 201 because every request has a different
    deviceLibraryIdentifier
  2. When Apple call the endpoint GET request to
    webServiceURL/version/devices/deviceLibraryIdentifier/registrations/passTypeIdentifier?passesUpdatedSince=tag
    the
    passesUpdatedSince
    is always empty, even if I set it when I reply. I also checked the Apple server example and what I do it seems correct to me

These are my apache logs where you can see POST requests from Apple and the result code HTTP 201.


This is just a small extract from logs:


api-stage.com.test:443 xx.xx.xx.xx - - [15/Mar/2020:15:41:27 +0100] "GET /api/v1/public/apple/wallet/7606fc820e255dd6cbafb2cf56ca80a583d195d1a6793facb56261493215d187/v1/devices/f7cace9f54587f6bd97bd3d1a56257f6/registrations/pass.lo
yalty.cloud.test HTTP/1.1" 200 4503 "-" "passd/1.0 CFNetwork/1121.2.2 Darwin/19.3.0"
api-stage.com.test:443 xx.xx.xx.xx - - [15/Mar/2020:15:41:28 +0100] "GET /api/v1/public/apple/wallet/7606fc820e255dd6cbafb2cf56ca80a583d195d1a6793facb56261493215d187/v1/passes/pass.loyalty.cloud.test/9e2df4d5-824b-4ee0-a931-c0c674
92dbb5 HTTP/1.1" 200 962470 "-" "passd/1.0 CFNetwork/1121.2.2 Darwin/19.3.0"
api-stage.com.test:443 xx.xx.xx.xx - - [15/Mar/2020:15:41:29 +0100] "POST /api/v1/public/apple/wallet/c7d0e84d62aeb08fae867a0282756c7a7cb51460b7aa77868e5072b670b33ce8/v1/devices/1d50e6abd5d39c2e828630cb62a7a031/registrations/pass.l
oyalty.cloud.test/9e2df4d5-824b-4ee0-a931-c0c67492dbb5 HTTP/1.1" 201 4204 "-" "passd/1.0 CFNetwork/1121.2.2 Darwin/19.3.0"
api-stage.com.test:443 xx.xx.xx.xx - - [15/Mar/2020:15:41:29 +0100] "GET /api/v1/public/apple/wallet/c7d0e84d62aeb08fae867a0282756c7a7cb51460b7aa77868e5072b670b33ce8/v1/devices/1d50e6abd5d39c2e828630cb62a7a031/registrations/pass.lo
yalty.cloud.test HTTP/1.1" 200 4503 "-" "passd/1.0 CFNetwork/1121.2.2 Darwin/19.3.0"
api-stage.com.test:443 xx.xx.xx.xx - - [15/Mar/2020:15:41:30 +0100] "GET /api/v1/public/apple/wallet/c7d0e84d62aeb08fae867a0282756c7a7cb51460b7aa77868e5072b670b33ce8/v1/passes/pass.loyalty.cloud.test/9e2df4d5-824b-4ee0-a931-c0c674
92dbb5 HTTP/1.1" 200 962469 "-" "passd/1.0 CFNetwork/1121.2.2 Darwin/19.3.0"
api-stage.com.test:443 xx.xx.xx.xx - - [15/Mar/2020:15:41:31 +0100] "POST /api/v1/public/apple/wallet/6a96c74bb40236a16e7c881762b24359274f89a5bdd20d9418c7154d6466450d/v1/devices/5967d02cf3563d106c784498af11279f/registrations/pass.l
oyalty.cloud.test/9e2df4d5-824b-4ee0-a931-c0c67492dbb5 HTTP/1.1" 201 4204 "-" "passd/1.0 CFNetwork/1121.2.2 Darwin/19.3.0"
api-stage.com.test:443 xx.xx.xx.xx - - [15/Mar/2020:15:41:31 +0100] "GET /api/v1/public/apple/wallet/6a96c74bb40236a16e7c881762b24359274f89a5bdd20d9418c7154d6466450d/v1/devices/5967d02cf3563d106c784498af11279f/registrations/pass.lo
yalty.cloud.test HTTP/1.1" 200 4502 "-" "passd/1.0 CFNetwork/1121.2.2 Darwin/19.3.0"
api-stage.com.test:443 xx.xx.xx.xx - - [15/Mar/2020:15:41:32 +0100] "GET /api/v1/public/apple/wallet/6a96c74bb40236a16e7c881762b24359274f89a5bdd20d9418c7154d6466450d/v1/passes/pass.loyalty.cloud.test/9e2df4d5-824b-4ee0-a931-c0c674
92dbb5 HTTP/1.1" 200 962470 "-" "passd/1.0 CFNetwork/1121.2.2 Darwin/19.3.0"
api-stage.com.test:443 xx.xx.xx.xx - - [15/Mar/2020:15:41:33 +0100] "POST /api/v1/public/apple/wallet/8f17da01585e31f725de56205c55a74ff2e18d4c1fffffee7d9912ed7266ffe8/v1/devices/c9316a73d0343819de852ec508459bb1/registrations/pass.l
oyalty.cloud.test/9e2df4d5-824b-4ee0-a931-c0c67492dbb5 HTTP/1.1" 201 4204 "-" "passd/1.0 CFNetwork/1121.2.2 Darwin/19.3.0"
api-stage.com.test:443 xx.xx.xx.xx - - [15/Mar/2020:15:41:34 +0100] "GET /api/v1/public/apple/wallet/8f17da01585e31f725de56205c55a74ff2e18d4c1fffffee7d9912ed7266ffe8/v1/devices/c9316a73d0343819de852ec508459bb1/registrations/pass.lo
yalty.cloud.test HTTP/1.1" 200 4502 "-" "passd/1.0 CFNetwork/1121.2.2 Darwin/19.3.0"
api-stage.com.test:443 xx.xx.xx.xx - - [15/Mar/2020:15:41:34 +0100] "GET /api/v1/public/apple/wallet/8f17da01585e31f725de56205c55a74ff2e18d4c1fffffee7d9912ed7266ffe8/v1/passes/pass.loyalty.cloud.test/9e2df4d5-824b-4ee0-a931-c0c674
92dbb5 HTTP/1.1" 200 962470 "-" "passd/1.0 CFNetwork/1121.2.2 Darwin/19.3.0"
api-stage.com.test:443 xx.xx.xx.xx - - [15/Mar/2020:15:41:36 +0100] "POST /api/v1/public/apple/wallet/64f4fcfbc3c5f897dc18858de503fd413a73d5856cc811e51b479764ec0d37cc/v1/devices/2de84de20f3afdffd8ef101305f9e45e/registrations/pass.l
oyalty.cloud.test/9e2df4d5-824b-4ee0-a931-c0c67492dbb5 HTTP/1.1" 201 4204 "-" "passd/1.0 CFNetwork/1121.2.2 Darwin/19.3.0"
api-stage.com.test:443 xx.xx.xx.xx - - [15/Mar/2020:15:41:36 +0100] "GET /api/v1/public/apple/wallet/64f4fcfbc3c5f897dc18858de503fd413a73d5856cc811e51b479764ec0d37cc/v1/devices/2de84de20f3afdffd8ef101305f9e45e/registrations/pass.lo
yalty.cloud.test HTTP/1.1" 200 4502 "-" "passd/1.0 CFNetwork/1121.2.2 Darwin/19.3.0"
api-stage.com.test:443 xx.xx.xx.xx - - [15/Mar/2020:15:41:36 +0100] "GET /api/v1/public/apple/wallet/64f4fcfbc3c5f897dc18858de503fd413a73d5856cc811e51b479764ec0d37cc/v1/passes/pass.loyalty.cloud.test/9e2df4d5-824b-4ee0-a931-c0c674
92dbb5 HTTP/1.1" 200 962468 "-" "passd/1.0 CFNetwork/1121.2.2 Darwin/19.3.0"
api-stage.com.test:443 xx.xx.xx.xx - - [15/Mar/2020:15:41:38 +0100] "POST /api/v1/public/apple/wallet/1ef24ad8294860ad7e1e9fe6a097ff32146c1278cf43c391ba34d29d4461cad7/v1/devices/0b1814d6e7bad039f2f87d0ea6f2a329/registrations/pass.l
oyalty.cloud.test/9e2df4d5-824b-4ee0-a931-c0c67492dbb5 HTTP/1.1" 201 4204 "-" "passd/1.0 CFNetwork/1121.2.2 Darwin/19.3.0"
api-stage.com.test:443 xx.xx.xx.xx - - [15/Mar/2020:15:41:38 +0100] "GET /api/v1/public/apple/wallet/1ef24ad8294860ad7e1e9fe6a097ff32146c1278cf43c391ba34d29d4461cad7/v1/devices/0b1814d6e7bad039f2f87d0ea6f2a329/registrations/pass.lo
yalty.cloud.test HTTP/1.1" 200 4503 "-" "passd/1.0 CFNetwork/1121.2.2 Darwin/19.3.0"
api-stage.com.test:443 xx.xx.xx.xx - - [15/Mar/2020:15:41:38 +0100] "GET /api/v1/public/apple/wallet/1ef24ad8294860ad7e1e9fe6a097ff32146c1278cf43c391ba34d29d4461cad7/v1/passes/pass.loyalty.cloud.test/9e2df4d5-824b-4ee0-a931-c0c674
92dbb5 HTTP/1.1" 200 962466 "-" "passd/1.0 CFNetwork/1121.2.2 Darwin/19.3.0"
api-stage.com.test:443 xx.xx.xx.xx - - [15/Mar/2020:15:41:40 +0100] "POST /api/v1/public/apple/wallet/eca5ec7bb9ffd94ea54fbc7a49eba154575a803c4f30fc38068fc8d4e7ff5805/v1/devices/a78ad2681e9db6345e147aa98e584fdb/registrations/pass.l
oyalty.cloud.test/9e2df4d5-824b-4ee0-a931-c0c67492dbb5 HTTP/1.1" 201 4204 "-" "passd/1.0 CFNetwork/1121.2.2 Darwin/19.3.0"
api-stage.com.test:443 xx.xx.xx.xx - - [15/Mar/2020:15:41:40 +0100] "GET /api/v1/public/apple/wallet/eca5ec7bb9ffd94ea54fbc7a49eba154575a803c4f30fc38068fc8d4e7ff5805/v1/devices/a78ad2681e9db6345e147aa98e584fdb/registrations/pass.lo
yalty.cloud.test HTTP/1.1" 200 4502 "-" "passd/1.0 CFNetwork/1121.2.2 Darwin/19.3.0"
api-stage.com.test:443 xx.xx.xx.xx - - [15/Mar/2020:15:41:40 +0100] "GET /api/v1/public/apple/wallet/eca5ec7bb9ffd94ea54fbc7a49eba154575a803c4f30fc38068fc8d4e7ff5805/v1/passes/pass.loyalty.cloud.test/9e2df4d5-824b-4ee0-a931-c0c674
92dbb5 HTTP/1.1" 200 962470 "-" "passd/1.0 CFNetwork/1121.2.2 Darwin/19.3.0"
api-stage.com.test:443 xx.xx.xx.xx - - [15/Mar/2020:15:41:42 +0100] "POST /api/v1/public/apple/wallet/981006aec2e42801b6225709730e9a62bf153d86ce1c744336aec2055c181187/v1/devices/be13bd781f4a562b730e7e91297b791e/registrations/pass.l
oyalty.cloud.test/9e2df4d5-824b-4ee0-a931-c0c67492dbb5 HTTP/1.1" 201 4204 "-" "passd/1.0 CFNetwork/1121.2.2 Darwin/19.3.0"
api-stage.com.test:443 xx.xx.xx.xx - - [15/Mar/2020:15:41:42 +0100] "GET /api/v1/public/apple/wallet/981006aec2e42801b6225709730e9a62bf153d86ce1c744336aec2055c181187/v1/devices/be13bd781f4a562b730e7e91297b791e/registrations/pass.lo
yalty.cloud.test HTTP/1.1" 200 4502 "-" "passd/1.0 CFNetwork/1121.2.2 Darwin/19.3.0"
api-stage.com.test:443 xx.xx.xx.xx - - [15/Mar/2020:15:41:42 +0100] "GET /api/v1/public/apple/wallet/981006aec2e42801b6225709730e9a62bf153d86ce1c744336aec2055c181187/v1/passes/pass.loyalty.cloud.test/9e2df4d5-824b-4ee0-a931-c0c674
92dbb5 HTTP/1.1" 200 962472 "-" "passd/1.0 CFNetwork/1121.2.2 Darwin/19.3.0"
api-stage.com.test:443 xx.xx.xx.xx - - [15/Mar/2020:15:41:44 +0100] "POST /api/v1/public/apple/wallet/3d219f4af590fb708722603352d019fffdcc468a3b616f24f0a704ba61f5b529/v1/devices/733a9d529d4ceac53b8f18f98c7bd5df/registrations/pass.l
oyalty.cloud.test/9e2df4d5-824b-4ee0-a931-c0c67492dbb5 HTTP/1.1" 201 4204 "-" "passd/1.0 CFNetwork/1121.2.2 Darwin/19.3.0"
api-stage.com.test:443 xx.xx.xx.xx - - [15/Mar/2020:15:41:44 +0100] "GET /api/v1/public/apple/wallet/3d219f4af590fb708722603352d019fffdcc468a3b616f24f0a704ba61f5b529/v1/devices/733a9d529d4ceac53b8f18f98c7bd5df/registrations/pass.lo
yalty.cloud.test HTTP/1.1" 200 4502 "-" "passd/1.0 CFNetwork/1121.2.2 Darwin/19.3.0"
api-stage.com.test:443 xx.xx.xx.xx - - [15/Mar/2020:15:41:44 +0100] "GET /api/v1/public/apple/wallet/3d219f4af590fb708722603352d019fffdcc468a3b616f24f0a704ba61f5b529/v1/passes/pass.loyalty.cloud.test/9e2df4d5-824b-4ee0-a931-c0c674
92dbb5 HTTP/1.1" 200 962467 "-" "passd/1.0 CFNetwork/1121.2.2 Darwin/19.3.0"
api-stage.com.test:443 xx.xx.xx.xx - - [15/Mar/2020:15:41:46 +0100] "POST /api/v1/public/apple/wallet/c8332e193912bb852abd0b3aa66aa0081e2882e7d30e3242e28818a345954846/v1/devices/f23c49f1ec6a0059434877840275d5bc/registrations/pass.l
oyalty.cloud.test/9e2df4d5-824b-4ee0-a931-c0c67492dbb5 HTTP/1.1" 201 4204 "-" "passd/1.0 CFNetwork/1121.2.2 Darwin/19.3.0"
api-stage.com.test:443 xx.xx.xx.xx - - [15/Mar/2020:15:41:46 +0100] "GET /api/v1/public/apple/wallet/c8332e193912bb852abd0b3aa66aa0081e2882e7d30e3242e28818a345954846/v1/devices/f23c49f1ec6a0059434877840275d5bc/registrations/pass.lo
yalty.cloud.test HTTP/1.1" 200 4502 "-" "passd/1.0 CFNetwork/1121.2.2 Darwin/19.3.0"
api-stage.com.test:443 xx.xx.xx.xx - - [15/Mar/2020:15:41:47 +0100] "GET /api/v1/public/apple/wallet/c8332e193912bb852abd0b3aa66aa0081e2882e7d30e3242e28818a345954846/v1/passes/pass.loyalty.cloud.test/9e2df4d5-824b-4ee0-a931-c0c674
92dbb5 HTTP/1.1" 200 962469 "-" "passd/1.0 CFNetwork/1121.2.2 Darwin/19.3.0"
api-stage.com.test:443 xx.xx.xx.xx - - [15/Mar/2020:15:41:48 +0100] "POST /api/v1/public/apple/wallet/e20f85d8257d42155b93577de34cbc244b9ff0e18d2b853cd9526b751204ff53/v1/devices/1948a632494d98f052a9261f6e2127d0/registrations/pass.l
oyalty.cloud.test/9e2df4d5-824b-4ee0-a931-c0c67492dbb5 HTTP/1.1" 201 4204 "-" "passd/1.0 CFNetwork/1121.2.2 Darwin/19.3.0"
api-stage.com.test:443 xx.xx.xx.xx - - [15/Mar/2020:15:41:49 +0100] "GET /api/v1/public/apple/wallet/e20f85d8257d42155b93577de34cbc244b9ff0e18d2b853cd9526b751204ff53/v1/devices/1948a632494d98f052a9261f6e2127d0/registrations/pass.lo
yalty.cloud.test HTTP/1.1" 200 4502 "-" "passd/1.0 CFNetwork/1121.2.2 Darwin/19.3.0"


Any idea of what I could check to fix these problems? I'm testing all with an iphone 6s with iOS 13.3.1

I'm not exacly sure how the logged requests are supposed to match the defined webservice endpoints.
Did you already set up a log endpoint for your web service ? It's really helpful to set this up FIRST !! (Though it is only described at the end of the documentation.)


And: Try using millies as "tag". Our observation is, this tag may not be considered as "opaque" by wallets as described inside the docs…

Apple PassKit, webservice invoked hundres of times
 
 
Q