public async Task <bool> Tweet(Tweet tweet) { try { Auth.SetCredentials(new TwitterCredentials(ConsumerKey, ConsumerSecret, AccessToken, AccessSecret)); var result = await Task.Run(() => Tweetinvi.Tweet.PublishTweet(Tweetinvi.Tweet.CreatePublishTweetParameters(tweet.Message)) ); return(result.IsTweetPublished); } catch (Exception e) { throw; } }
public async Task <bool> TweetWithCoordinates(Tweet tweet) { try { Auth.SetCredentials(new TwitterCredentials(ConsumerKey, ConsumerSecret, AccessToken, AccessSecret)); var result = await Task.Run(() => Tweetinvi.Tweet.PublishTweet(Tweetinvi.Tweet.CreatePublishTweetParameters(tweet.Message, new PublishTweetOptionalParameters() { Coordinates = new Coordinates(tweet.Latitude, tweet.Longitude) })) ); return(result.IsTweetPublished); } catch (Exception e) { throw; } }