/// <summary> /// When AccessToken is invalid then refresh new one replace /// </summary> /// <param name="platformType">Platform Type</param> public void RefreshInValidAccessToken(PlatformType platformType) { AuthorizeConfig oauthConfig = GetAuthorizeConfig(platformType); DataRequestHelper dataRequestHelper = new DataRequestHelper(); string requestUrl = string.Empty; if (platformType == PlatformType.Tencent) { #region refresh new accesstoke tencent accesstoken AccessTokenData tencentToken = IsolatedStorageSettings.ApplicationSettings["tencenttoken"] as AccessTokenData; TencentSocialHelper tencentSocialHelper = new TencentSocialHelper(); requestUrl = tencentSocialHelper.GetRefreshAccessTokenUrl(oauthConfig.Url, oauthConfig.AppKey, tencentToken.RefreshToken); if (tencentSocialHelper.PostArgumentList != null) { dataRequestHelper.ExcuteAsyncRequest(requestUrl, Method.POST, tencentSocialHelper.PostArgumentList); } else { dataRequestHelper.ExcuteAsyncRequest(requestUrl, Method.POST); } dataRequestHelper.AsyncResponseComplated += (responseData, ex) => { if (!string.IsNullOrEmpty(responseData.ToString())) { } }; #endregion } else if (platformType == PlatformType.Sina) { } }
/// <summary> /// When AccessToken is invalid then refresh new one replace /// </summary> /// <param name="platformType">Platform Type</param> public void RefreshInValidAccessToken(PlatformType platformType) { AuthorizeConfig oauthConfig = GetAuthorizeConfig(platformType); DataRequestHelper dataRequestHelper = new DataRequestHelper(); string requestUrl = string.Empty; if (platformType == PlatformType.Tencent) { #region refresh new accesstoke tencent accesstoken AccessTokenData tencentToken = IsolatedStorageSettings.ApplicationSettings["tencenttoken"] as AccessTokenData; TencentSocialHelper tencentSocialHelper = new TencentSocialHelper(); requestUrl = tencentSocialHelper.GetRefreshAccessTokenUrl(oauthConfig.Url, oauthConfig.AppKey, tencentToken.RefreshToken); if (tencentSocialHelper.PostArgumentList != null) dataRequestHelper.ExcuteAsyncRequest(requestUrl, Method.POST, tencentSocialHelper.PostArgumentList); else dataRequestHelper.ExcuteAsyncRequest(requestUrl, Method.POST); dataRequestHelper.AsyncResponseComplated += (responseData, ex) => { if (!string.IsNullOrEmpty(responseData.ToString())) { } }; #endregion } else if (platformType == PlatformType.Sina) { } }