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

New Post: Problem with Tweeting

$
0
0
I am getting a tweet Id of -1 so I assume it is not working, but when I check with the ExceptionHandler I get a null result
and yes that twitter account has read and write premissions
TwitterCredentials.ExecuteOperationWithCredentials(credentials, () =>
                    {
                        byte[] file = FileToByteArray(@"C:\wus\temp\" + aImage.FileName);
                        var tweet = Tweet.CreateTweetWithMedia(TwMessage, file);
                        //var tweet = Tweet.CreateTweet(TwMessage + " " + aImage.FilePath);
                        var ex = ExceptionHandler.GetLastException();

                        Core.UpdateStatus(false, "Twitter.Process.Create", "Message Tweeted " + TwMessage);
                        if (tweet.Id > 0)
                        {
                            sReturn = "File Name " + aImage.FileName + " Send on Tweet " + tweet.Id.ToString();
                        }
                        else
                        {
                            sReturn = string.Format("ERROR: {0}: {1}", ex.StatusCode, ex.TwitterDescription);
                        }
                    });

Viewing all articles
Browse latest Browse all 4126

Trending Articles



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