How do you keep the token?
An imei phone request shall be sent, the token shall be returned, the current shall be retained when the application is out and started.
The problem is that the token is temporary and once an hour a new one.
This is the code that keeps the token, but is not updated. pastebin.com/vYsvs4kH
How do we solve this problem?
- If the token is used, if it's outdated, the server will report it.
- At this point, you have to erase the old token.
- And make a request for a new one.
- If you get a new one, you have to write it again.
- You can record the timeStamp before you get it. But it's not gonna help if you start transferring hours/zones, so you can't do it.