How to update access token with the help of refresh token , so that the previous request is repeated? I execute a request to the server, the server responds that the token is not active, you need to send a request to update the token and then re-send the previous request. I use AFNetworking .

    1 answer 1

    One option is to store the queries in an array, for example, and not just as NSString or NSURL but to front a query string in an NSDictionary with two keys, the query string itself and a boolean variable until the query is executed (whether it’s a network error or not valid token), then the boolean variable is set to NO , if the request is successful, then we set the boolean variable to YES and delete the request from the "stack". Or you can do it with a timestamp, the choice is yours :)