{ if (intent != null) { LogUtil.d("Weibo_SSO_login", (new StringBuilder("Login failed: ")).append(intent.getStringExtra("error")).toString()); mAuthListener.onWeiboException(new WeiboDialogException(intent.getStringExtra("error"), intent.getIntExtra("error_code", -1), intent.getStringExtra("failing_url"))); return; } else { LogUtil.d("Weibo_SSO_login", "Login canceled by user."); mAuthListener.onCancel(); return; } }
{ if (s.equals("access_denied") || s.equals("OAuthAccessDeniedException")) { LogUtil.d("Weibo_SSO_login", "Login canceled by user."); mAuthListener.onCancel(); return; } String s1 = intent.getStringExtra("error_description"); if (s1 != null) { s = (new StringBuilder(String.valueOf(s))).append(":").append(s1).toString(); } LogUtil.d("Weibo_SSO_login", (new StringBuilder("Login failed: ")).append(s).toString()); mAuthListener.onWeiboException(new WeiboDialogException(s, j, s1)); return; }
/** * 向好友发送邀请。支持登录用户向自己的微博互粉好友发送私信邀请、礼物。 * * @param uid 被邀请人的 Uid,需要为当前用户互粉好友 * @param jsonData 邀请数据。以 {@link JSONObject} 数据填充 * @param listener 邀请接口对应的回调 */ public void sendInvite(String uid, JSONObject jsonData, RequestListener listener) { if (!TextUtils.isEmpty(uid) && jsonData != null && !TextUtils.isEmpty(jsonData.toString())) { WeiboParameters params = new WeiboParameters(); params.put("uid", uid); params.put("data", jsonData.toString()); requestAsync(INVITE_URL, params, HTTPMETHOD_POST, listener); } else { LogUtil.d(TAG, "Invite args error!"); } }
@Override public void onError(WeiboException e) { LogUtil.e(TAG, "WeiboException: " + e.getMessage()); }
@Override public void onIOException(IOException e) { LogUtil.e(TAG, "onIOException: " + e.getMessage()); }
@Override public void onComplete4binary(ByteArrayOutputStream responseOS) { LogUtil.e(TAG, "onComplete4binary..."); }
{ LogUtil.d("Weibo_SSO_login", "Failed to receive access token by SSO"); mWeibo.anthorize(mAuthListener); return; }
if (oauth2accesstoken != null && oauth2accesstoken.isSessionValid()) { LogUtil.d("Weibo_SSO_login", (new StringBuilder("Login Success! ")).append(oauth2accesstoken.toString()).toString()); mAuthListener.onComplete(bundle); return; } else