DeviceCheck API is setting bits independently of TransID

351 Views Asked by At

I search all question and tutorial available on Net, but not able to find any working solution.

I have checked the Apple documentation which is not explaining clearly.

DeviceCheck api for Query/validate will take: device_token, transaction_id and TimeStamp.

For update, it will take: device_token, transaction_id ,timestamp , bit0, bit1

I have followed a tutorial written by Marinosoftware.com here

I have following question.

  1. What is the use of transaction_id ? because I had used update API with different transaction_id to update bits, But when I use "query", bits state received from Apple was one which are updated last irrespective of transaction_id.

  2. Why apple is asking for transaction_id and timestamp for Querying the bit state, If they are setting the bits independently of transaction_id and timestamp.

1

There are 1 best solutions below

0
On

The transID is a unique transaction identifier for this interaction between your server and Apple; I.e. it is expected to change each time you initiate a communication with Apple's server.

Presumably it is used for some internal purpose with Apple's system such as correlating queries and responses, detecting duplicate queries or simply logging.

Similarly with the timestamp; presumably Apple distributed the DeviceCheck function over many servers. The time stamp field permits requests to be processed consistently where updates and queries may occur in quick succession and be dispatched to different server instances at Apple.

The values of the device check bits are related to the device token which is unique and consistent for your app on a given device.