Exemplo n.º 1
0
    private void OnPostSuccess()
    {
        TWResult res = new TWResult(true, null);

        dispatch(TwitterEvents.POST_SUCCEEDED, res);
        OnPostingCompleteAction(res);
    }
Exemplo n.º 2
0
    private void OnUserDataLoadFailed()
    {
        TWResult res = new TWResult(false, null);

        dispatch(TwitterEvents.USER_DATA_FAILED_TO_LOAD, res);
        OnUserDataRequestCompleteAction(res);
    }
Exemplo n.º 3
0
    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);
	}
Exemplo n.º 5
0
    private void OnAuthFailed()
    {
        TWResult res = new TWResult(false, null);

        dispatch(TwitterEvents.AUTHENTICATION_FAILED, res);
        OnAuthCompleteAction(res);
    }
Exemplo n.º 6
0
    private void OnAuthSuccess()
    {
        _IsAuthed = true;
        TWResult res = new TWResult(true, null);

        OnAuthCompleteAction(res);
    }
Exemplo n.º 7
0
 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);
     }
 }
Exemplo n.º 9
0
    private void OnAuthSuccess()
    {
        _IsAuthed = true;
        TWResult res = new TWResult(true, null);

        dispatch(TwitterEvents.AUTHENTICATION_SUCCEEDED, res);
        OnAuthCompleteAction(res);
    }
Exemplo n.º 10
0
    private void OnUserDataLoaded(string data)
    {
        _userInfo = new TwitterUserInfo(data);

        TWResult res = new TWResult(true, data);

        OnUserDataRequestCompleteAction(res);
    }
Exemplo n.º 11
0
 void OnAuthCompleteAction(TWResult result)
 {
     if (result.IsSucceeded)
     {
         //user authed
         OnAuth();
     }
 }
Exemplo n.º 12
0
 void OnTwitterInitedAction(TWResult result)
 {
     if (AndroidTwitterManager.Instance.IsAuthed)
     {
         //user authed
         OnAuth();
     }
 }
Exemplo n.º 13
0
    private void OnUserDataLoaded(string data)
    {
        _userInfo = new TwitterUserInfo(data);

        TWResult res = new TWResult(true, data);

        dispatch(TwitterEvents.USER_DATA_LOADED, res);
        OnUserDataRequestCompleteAction(res);
    }
Exemplo n.º 14
0
    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);
    }
Exemplo n.º 15
0
	private void OnTWInited(TWResult result) {
		_controller.OnTwitterInitedAction -= OnTWInited;

		if(_controller.IsAuthed) {
			OnTWAuth(null);
		} else {
			_controller.OnAuthCompleteAction += OnTWAuth;
			_controller.AuthenticateUser();
		}
	}
Exemplo n.º 16
0
    // --------------------------------------
    // Twitter
    // --------------------------------------

    private static void HandleOnAuthCompleteAction(TWResult res)
    {
        if (!res.IsSucceeded)
        {
            SocialLogin(AN_SoomlaEventType.SOOMLA_EVENT_CNACELED, AN_SoomlaSocialProvider.TWITTER);
        }
        else
        {
            AndroidTwitterManager.Instance.LoadUserData();
        }
    }
Exemplo n.º 17
0
    // --------------------------------------
    // 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");
     }
 }
Exemplo n.º 19
0
 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);
     }
 }
Exemplo n.º 20
0
 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.");
     }
 }
Exemplo n.º 21
0
 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");
     }
 }
Exemplo n.º 23
0
    // --------------------------------------
    // 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);
    }
Exemplo n.º 24
0
    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);
    }
Exemplo n.º 25
0
    // --------------------------------------
    // 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");
        }
    }
Exemplo n.º 26
0
 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");
        }
    }
Exemplo n.º 28
0
    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);
        }
    }
Exemplo n.º 29
0
    private void OnTWInited(TWResult result)
    {
        _controller.OnTwitterInitedAction -= OnTWInited;

        if (_controller.IsAuthed)
        {
            OnTWAuth(new TWResult(true, "Auth Success"));
        }
        else
        {
            _controller.OnAuthCompleteAction += OnTWAuth;
            _controller.AuthenticateUser();
        }
    }
Exemplo n.º 30
0
    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);
        }
    }
Exemplo n.º 31
0
    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);
    }
Exemplo n.º 32
0
    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();
            }
        }
    }
Exemplo n.º 33
0
	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();
		}
	}
Exemplo n.º 35
0
	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();
		}
	}