@Override public void sendGetProfileRequest(BaseActivity activity, String authData) { // first step - get access token showWaitDialog(); PostTwitterData requestPairs = getRequestPostPairs(); String verifier = getURLQueryParameter(authData, "\\?", "oauth_verifier"); requestPairs.setOauth_verifier(verifier); requestPairs.setOauth_token(oauth_request_token); String signature = createRequestSignature( requestPairs, GET_TOKEN_URL, POST_REQUEST, oauth_request_token_secret); requestPairs.setOauth_signature(signature); sendAdditionalDataRequest(activity, GET_TOKEN_URL, requestPairs); }
@Override public void setAdditionalParameters(String params) { // TODO Auto-generated method stub hideWaitDialog(); if (oauth_request_token == null) { JSONObject obj; try { obj = new JSONObject(params); oauth_request_token_secret = obj.getString("oauth_token_secret"); oauth_request_token = obj.getString("oauth_token"); } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); } // real show auth dialog super.showAuthDialog(activity, listener); } else if (oauth_access_token == null) { JSONObject obj; try { obj = new JSONObject(params); oauth_access_token_secret = obj.getString("oauth_token_secret"); oauth_access_token = obj.getString("oauth_token"); } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); } // need to send get profile request PostTwitterData post = getRequestPostPairs(); post.setOauth_token(oauth_access_token); String signature = createRequestSignature(post, GET_PROFILE_URL, GET_REQUEST, oauth_access_token_secret); post.setOauth_signature(signature); super.sendGetProfileRequest( activity, new GsonBuilder().disableHtmlEscaping().create().toJson(post)); } }