GooglePlayInstant/Editor/QuickDeploy/AccessTokenGetter.cs
/// <summary>
/// Handles received response from a token request by parsing the response to update access and refresh token
/// values if available, as well as throwing an error when there was a failure getting required tokens.
/// </summary>
/// <param name="completeTokenRequest">A www instance holding a token  request that has received a response.</param>
Handles received response from a token request by parsing the response to update access and refresh token
values if available, as well as throwing an error when there was a failure getting required tokens.
Handles received response from a token request by parsing the response to update access and refresh token values if available as well as throwing an error when there was a failure getting required tokens .
private static void HandleTokenResponse(WWW completeTokenRequest)
        {
            var responseError = completeTokenRequest.error;
            var responseText = completeTokenRequest.text;
            if (!string.IsNullOrEmpty(responseError))
            {
                throw new Exception(string.Format(
                    "Sent request to get access token and received response with error: \"{0}\", and text: \"{1}\"",
                    responseError,
                    responseText));
            }
            var tokenResponse = JsonUtility.FromJson<GcpAccessTokenResponse>(responseText);
            if (string.IsNullOrEmpty(tokenResponse.access_token))
            {
                throw new Exception(string.Format("Couldn't retrieve access token from response text: \"{0}\"",
                    responseText));
            }
            AccessToken = new GcpAccessToken(tokenResponse.access_token, tokenResponse.refresh_token,
                tokenResponse.expires_in);
        }
private static void HandleTokenResponse ( WWW completeTokenRequest ) { var responseError = completeTokenRequest . error ; var responseText = completeTokenRequest . text ; if ( ! string . IsNullOrEmpty ( responseError ) ) { throw new Exception ( string . Format ( " \" \" \" \" " , responseError , responseText ) ) ; } var tokenResponse = JsonUtility . FromJson < GcpAccessTokenResponse > ( responseText ) ; if ( string . IsNullOrEmpty ( tokenResponse . access_token ) ) { throw new Exception ( string . Format ( " \" \" " , responseText ) ) ; } AccessToken = new GcpAccessToken ( tokenResponse . access_token , tokenResponse . refresh_token , tokenResponse . expires_in ) ; }
Handles received response from a token request by parsing the response to update access and refresh token
values if available, as well as throwing an error when there was a failure getting required tokens.
Handles received response from a token request by parsing the response to update access and refresh token values if available as well as throwing an error when there was a failure getting required tokens .
completeTokenRequest
WWW
A www instance holding a token  request that has received a response.
A www instance holding a token request that has received a response .