Example #1
0
        /*
         *  initialize with token.
         */
        public static void InitWithToken(string accessToken, string accessSecret)
        {
            InitializeTwitterPlugin();

            // load component.
            GenerateInstanceIfNeed();

            // initialize twitter connector.
            _component._connector = new TwitterConnector(TwitterSettings.ConsumerKey, TwitterSettings.ConsumerSecret, accessToken, accessSecret);
            _state = TKState.APIReady;
        }
Example #2
0
        /*
         *  initialize with login.
         */
        public static void InitWithLogin(Action <string, string, string> successCallback, Action <int, string> failureCallback)
        {
            InitializeTwitterPlugin();

            // load component.
            GenerateInstanceIfNeed();

            _component.loginSuccessAction = (nickname, token, secret) =>
            {
                // API Connectorの初期化
                _component._connector = new TwitterConnector(TwitterSettings.ConsumerKey, TwitterSettings.ConsumerSecret, token, secret);
                _state = TKState.APIReady;

                successCallback(nickname, token, secret);
            };
            _component.loginFailureAction = failureCallback;
            _twitter.LogIn();
        }