Quantcast
Channel: Tweetinvi a friendly Twitter C# library
Viewing all articles
Browse latest Browse all 4126

New Post: How to run actions on multiple twitter accounts without setting static TwitterCredentials.SetCredentials

$
0
0
I don't really understand the use of all the static helper objects, such as
TwitterCredentials.SetCredentials(this.oAuthToken, this.OAuthTokenSecret, this.ApiKey, this.ApiSecret);
From what I understand this sets the credentials, application wide. But I want to allow multiple users to run actions in the application.

So I created an object credentials
var cred = TwitterCredentials.CreateCredentials(this.oAuthToken, this.OAuthTokenSecret, this.ApiKey, this.ApiSecret);
that is used to created an User
var twitterUser = User.GetLoggedUser(this.Credentials);
so far so good, but now when I try and follow another user for example,
var followThisUser = User.GetUserFromScreenName(usernameToFollow);
var success = twitterUser.FollowUser(follow)
I receive an exception, saying I MUST call
var cred = TwitterCredentials.CreateCredentials(this.oAuthToken, this.OAuthTokenSecret, this.ApiKey, this.ApiSecret);
which, if I do, does fix the exception. But I have no set a single users auth data app wide, which I don't want.


Is there anywhere that explains how run actions for multiple users?

Viewing all articles
Browse latest Browse all 4126

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>