This question has already been answered:

A request is sent from the imei phone, a token is returned in response, the token should be saved when you exit and start the application.

The problem is that the token is temporary and a new one is issued every hour.

Here is the code that saves the received token, but is not updated with the new one. pastebin.com/vYsvs4kH

How to solve this problem?

Reported as a duplicate by members of Vladyslav Matviienko , cheops , Bald , dirkgntly , lexxl 4 Aug '16 at 7:29 .

A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .

  • @metalurgus, how to update it - Martinez Toni
  • @metalurgus, how to update it - Martinez Toni
  • как обновить его whom? - Vladyslav Matviienko 6:02 pm
  • @metalurgus update token - Martinez Toni
  • one
    in the same way as save - rewrite - Vladyslav Matviienko

1 answer 1

  1. When using a token, if it is outdated, the server will report this.
  2. At this point, you need to erase the old token
  3. And make a request for a new one.
  4. Having received a new one, it must be recorded again.
  5. Immediately after receiving, you can also record timeStamp before which it will be valid. But this will not help if you start to transfer clocks / zones, so you can not do it