I am trying to extend my app to include Twitter user timeline functionality. I was using Twitter API v1 previously and that fetched the user timeline properly. Since API 1.1 was deprecated, I have been using TweetSharp.
However my code runs perfectly on Windows Phone 7 and 8 Emulators, Windows Phone 8 device but fails on my Windows Phone 7.1 Lumia 710 device with a NotFound Exception.
The following is my code:-
TwitterService service = new TwitterService(_consumerKey, _consumerSecret);
service.AuthenticateWith(_accessToken, _accessTokenSecret);
ListTweetsOnUserTimelineOptions listTweetsOnUserTimelineOptions = new ListTweetsOnUserTimelineOptions();
listTweetsOnUserTimelineOptions.ScreenName = "twitter";
service.ListTweetsOnUserTimeline(listTweetsOnUserTimelineOptions, (statuses, response) =>
{
if (response.StatusCode == HttpStatusCode.OK)// THIS IS WHERE I AM GETTING STATUS CODE NOTFOUND
{
foreach (var status in statuses)
{
TwitterStatus tweet = status;
//Dispatcher.BeginInvoke(() => tweets.Items.Add(tweet));
Debug.WriteLine(tweet.Text);
}
}
else
{
throw new Exception(response.StatusCode.ToString());
}
});