private void OnPostSuccess() { TWResult res = new TWResult(true, null); dispatch(TwitterEvents.POST_SUCCEEDED, res); OnPostingCompleteAction(res); }
private void OnUserDataLoadFailed() { TWResult res = new TWResult(false, null); dispatch(TwitterEvents.USER_DATA_FAILED_TO_LOAD, res); OnUserDataRequestCompleteAction(res); }
private void OnPostFailed() { TWResult res = new TWResult(false, null); dispatch(TwitterEvents.POST_FAILED, res); OnPostingCompleteAction(res); }
private void OnTWAuthFailed() { _controller.removeEventListener(TwitterEvents.AUTHENTICATION_FAILED, OnTWAuthFailed); _controller.removeEventListener(TwitterEvents.AUTHENTICATION_SUCCEEDED, OnTWAuth); TWResult res = new TWResult(false, "Auth failed"); dispatch(BaseEvent.COMPLETE, res); }
private void OnAuthFailed() { TWResult res = new TWResult(false, null); dispatch(TwitterEvents.AUTHENTICATION_FAILED, res); OnAuthCompleteAction(res); }
private void OnAuthSuccess() { _IsAuthed = true; TWResult res = new TWResult(true, null); OnAuthCompleteAction(res); }
void OnPostingCompleteAction(TWResult result) { if (result.IsSucceeded) { if (tweetCompletedEvent != null) { tweetCompletedEvent.Invoke(true); } tweetCompletedEvent = null; if (PS_Plugin.Instance.isDebugMode && isDebugLog) { Debug.Log("Congrats. You just posted something to Twitter!"); } } else { if (tweetCompletedEvent != null) { tweetCompletedEvent.Invoke(false); } tweetCompletedEvent = null; if (PS_Plugin.Instance.isDebugMode && isDebugLog) { Debug.Log("Oops! Posting failed. Something went wrong."); } } isInvoking = false; }
private void OnInit(TWResult res) { if (SPTwitter.instance.IsAuthed) { OnAuth(null); } }
private void OnAuthSuccess() { _IsAuthed = true; TWResult res = new TWResult(true, null); dispatch(TwitterEvents.AUTHENTICATION_SUCCEEDED, res); OnAuthCompleteAction(res); }
private void OnUserDataLoaded(string data) { _userInfo = new TwitterUserInfo(data); TWResult res = new TWResult(true, data); OnUserDataRequestCompleteAction(res); }
void OnAuthCompleteAction(TWResult result) { if (result.IsSucceeded) { //user authed OnAuth(); } }
void OnTwitterInitedAction(TWResult result) { if (AndroidTwitterManager.Instance.IsAuthed) { //user authed OnAuth(); } }
private void OnUserDataLoaded(string data) { _userInfo = new TwitterUserInfo(data); TWResult res = new TWResult(true, data); dispatch(TwitterEvents.USER_DATA_LOADED, res); OnUserDataRequestCompleteAction(res); }
private void OnTWInited(TWResult result) { _controller.OnTwitterInitedAction -= OnTWInited; if(_controller.IsAuthed) { OnTWAuth(null); } else { _controller.OnAuthCompleteAction += OnTWAuth; _controller.AuthenticateUser(); } }
// -------------------------------------- // Twitter // -------------------------------------- private static void HandleOnAuthCompleteAction(TWResult res) { if (!res.IsSucceeded) { SocialLogin(AN_SoomlaEventType.SOOMLA_EVENT_CNACELED, AN_SoomlaSocialProvider.TWITTER); } else { AndroidTwitterManager.Instance.LoadUserData(); } }
// -------------------------------------- // EVENTS // -------------------------------------- private void OnInited(string data) { if (data.Equals("1")) { _IsAuthed = true; } TWResult res = new TWResult(true, null); OnTwitterInitedAction(res); }
void OnPostingCompleteAction(TWResult result) { if (result.IsSucceeded) { Debug.Log("Congrats, you just posted something to twitter"); } else { Debug.Log("Oops, post failed, something was wrong"); } }
private static void TW_PostCompleted(TWResult res) { if (res.IsSucceeded) { SocialShare(AN_SoomlaEventType.SOOMLA_EVENT_FINISHED, AN_SoomlaSocialProvider.TWITTER); } else { SocialShare(AN_SoomlaEventType.SOOMLA_EVENT_FAILED, AN_SoomlaSocialProvider.TWITTER); } }
void OnPostingCompleteAction(TWResult result) { if (result.IsSucceeded) { Debug.Log("Congrats. You just posted something to Twitter!"); } else { Debug.Log("Oops! Posting failed. Something went wrong."); } }
private static void HandleOnUserDataRequestCompleteAction(TWResult res) { if (res.IsSucceeded) { SocialLoginFinished(AN_SoomlaSocialProvider.TWITTER, AndroidTwitterManager.Instance.userInfo.id); } else { SocialLogin(AN_SoomlaEventType.SOOMLA_EVENT_FAILED, AN_SoomlaSocialProvider.TWITTER); } }
private void OnPost(TWResult res) { if (res.IsSucceeded) { Debug.Log("Congrats, you just postet something to twitter"); } else { Debug.Log("Opps, post failed, something was wrong"); } }
// -------------------------------------- // EVENTS // -------------------------------------- private void OnInited(string data) { if (data.Equals("1")) { _IsAuthed = true; } TWResult res = new TWResult(true, null); dispatch(TwitterEvents.TWITTER_INITED, res); OnTwitterInitedAction(res); }
public void Post(string status) { if (!_IsAuthed) { Debug.LogWarning("Auth user before posting data, fail event generated"); TWResult res = new TWResult(false, null); OnPostingCompleteAction(res); return; } AndroidNative.TwitterPost(status); }
// -------------------------------------- // EVENTS // -------------------------------------- void OnUserDataRequestCompleteAction(TWResult result) { if (result.IsSucceeded) { IsUserInfoLoaded = true; AndroidTwitterManager.Instance.userInfo.LoadProfileImage(); AndroidTwitterManager.Instance.userInfo.LoadBackgroundImage(); } else { Debug.Log("Opps, user data load failed, something was wrong"); } }
void OnUserDataRequestCompleteAction(TWResult result) { AndroidTwitterManager.Instance.OnUserDataRequestCompleteAction -= OnUserDataRequestCompleteAction; if (result.IsSucceeded) { Debug.Log("userName" + userName); userName = AndroidTwitterManager.Instance.userInfo.name; } else { Debug.Log("Opps, user data load failed, something was wrong"); } }
// -------------------------------------- // EVENTS // -------------------------------------- private void OnUserDataLoaded(TWResult res) { if (res.IsSucceeded) { IsUserInfoLoaded = true; SPTwitter.Instance.userInfo.LoadProfileImage(); SPTwitter.Instance.userInfo.LoadBackgroundImage(); } else { Debug.Log("Opps, user data load failed, something was wrong"); } }
public void LoadUserData() { if (_IsAuthed) { AndroidNative.LoadUserData(); } else { Debug.LogWarning("Auth user before loadin data, fail event generated"); TWResult res = new TWResult(false, null); OnUserDataRequestCompleteAction(res); } }
private void OnTWInited(TWResult result) { _controller.OnTwitterInitedAction -= OnTWInited; if (_controller.IsAuthed) { OnTWAuth(new TWResult(true, "Auth Success")); } else { _controller.OnAuthCompleteAction += OnTWAuth; _controller.AuthenticateUser(); } }
public void LoadUserData() { if (_IsAuthed) { AndroidNative.LoadUserData(); } else { Debug.LogWarning("Auth user before loadin data, fail event generated"); TWResult res = new TWResult(false, null); dispatch(TwitterEvents.USER_DATA_FAILED_TO_LOAD, res); OnUserDataRequestCompleteAction(res); } }
public void Post(string status, Texture2D texture) { if (!_IsAuthed) { Debug.LogWarning("Auth user before posting data, fail event generated"); TWResult res = new TWResult(false, null); OnPostingCompleteAction(res); return; } byte[] val = texture.EncodeToPNG(); string bytesString = System.Convert.ToBase64String(val); AndroidNative.TwitterPostWithImage(status, bytesString); }
void OnAuthCompleteAction(TWResult result) { if (result.IsSucceeded) { //user authed IsAuthenticated = true; string AccessToken = AndroidTwitterManager.Instance.AccessToken; string AccessTokenSecret = AndroidTwitterManager.Instance.AccessTokenSecret; if (PS_Plugin.Instance.isDebugMode && isDebugLog) { Debug.Log("Twiitterへのログインが完了!"); } if (TwitterApplicationOnlyToken.Instance.currentToken == null) { Debug.LogError("TwitterApplicationOnlyToken.Instance.currentToken is null"); } if (logInType == TwitterLoginType.ToukouWithImage) { if (PS_Plugin.Instance.isDebugMode && isDebugLog) { Debug.Log("ログインしたので投稿する"); } this.logInType = TwitterLoginType.ToukouWithImage; StartCoroutine(PostScreenshot()); return; } else if (logInType == TwitterLoginType.Follow) { if (PS_Plugin.Instance.isDebugMode && isDebugLog) { Debug.Log("ログインしたのでチェックフォロー"); } TW_FollowersIdsRequest r = TW_FollowersIdsRequest.Create(); r.ActionComplete += OnIdsLoaded; r.AddParam("screen_name", followPageName); r.Send(); } } }
private void OnTWAuth(TWResult result) { _controller.OnAuthCompleteAction -= OnTWAuth; if(result.IsSucceeded) { _controller.OnPostingCompleteAction += OnPost; if(_texture != null) { _controller.Post(_status, _texture); } else { _controller.Post(_status); } } else { TWResult res = new TWResult(false, "Auth failed"); ActionComplete(res); } }
void OnTwitterInitedAction (TWResult result) { if(AndroidTwitterManager.instance.IsAuthed) { //user authed OnAuth(); } }
private void OnPost(TWResult res) { _controller.OnPostingCompleteAction -= OnPost; ActionComplete(res); }
// -------------------------------------- // EVENTS // -------------------------------------- void OnUserDataRequestCompleteAction (TWResult result) { if(result.IsSucceeded) { IsUserInfoLoaded = true; AndroidTwitterManager.instance.userInfo.LoadProfileImage(); AndroidTwitterManager.instance.userInfo.LoadBackgroundImage(); } else { Debug.Log("Opps, user data load failed, something was wrong"); } }
void OnPostingCompleteAction (TWResult result) { if(result.IsSucceeded) { Debug.Log("Congrats. You just posted something to Twitter!"); } else { Debug.Log("Oops! Posting failed. Something went wrong."); } }
void OnAuthCompleteAction (TWResult result) { if(result.IsSucceeded) { //user authed OnAuth(); } }