/// <summary> /// Authenticate the current user for use in Twitter /// </summary> /// <param name="AuthType"></param> /// <returns></returns> private async Task <bool> AuthenticateTwitterUser(int AuthType) { bool AuthenticationStatus = false; TweetAuthType _selectedAuth = Convert.ToInt32(TweetAuthType.AppAuth) == AuthType ? TweetAuthType.AppAuth : TweetAuthType.OAuth; oauthTwitter = new TweetOAuth(_consumerKey, _consumerSecret, _selectedAuth); try { if (oauthTwitter.AuthenticationType == TweetAuthType.AppAuth) { await oauthTwitter.AuthenticateTwitterbyAppAuth(); } else { await oauthTwitter.AuthenticateTwitterByOAuth(); } //else await oauthTwitter.AuthenticateTwitterByOAuth(); AuthenticationStatus = true; } catch (Exception ex) { throw new Exception(ex.Message); } return(AuthenticationStatus); }
public TweetAPICall() { _tweetAuthObj = new TweetOAuth(); _tweetReturn = new ObservableCollection <Tweet>(); }