2

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());
     }
});
halfer
  • 19,824
  • 17
  • 99
  • 186
Rajeev Bhatia
  • 2,974
  • 1
  • 21
  • 29
  • 1
    Is the authentication working properly? Perhaps its not getting the user from TwitterService – Rhys Towey Aug 08 '13 at 11:23
  • Thanks Rhys. I don't think authentication is the problem because it is working fine on WP8 devices and emulator and WP7 emulator with the same credentials. It is just WP7 device on which it is failing. Plus I think authentication errors would throw a different HTTP error code than 404(not found) which is currently being thrown. I had reset my Lumia 710 a couple of days back and when I tried reinstalling the app, it suddenly started working. I am still tring to nail down the error! Thanks again – Rajeev Bhatia Aug 12 '13 at 05:02

0 Answers0