I’ve gone through literally every single tutorial there is about using the twitter api for WP7. It’s my first time using oauth and it can quite confusing. I’m trying to make it so my users can tweet a message and a picture. I went through this tutorial on oauth and several other ones (but am using this one atm):
Also found some great help on stackoverflow about posting photos here:
Upload image directly to twitter
But for the authentication portion described in the blog post above I keep on getting a “KeyNotFoundException” on the line “OAuthTokenKey = parameters["oauth_token"];” I’ve tried to figure it out but can’t come up with anything being my first time doing this. There doesn’t seem to be much help anywhere else because every tutorial is uses different techniques that are hard to put together, so I came to you guys. If you know a fix, please let me know! Or if you know of a recent tutorial out there that works great right now please let me know!
I updated the code at Upload image directly to twitter for the LINQ to Twitter sample, repeated here for convenience:
There’s a sample on this page that you can load and test:
http://linqtotwitter.codeplex.com/wikipage?title=LINQ%20to%20Twitter%20Samples
I think part of the problem might have been that I posted a synchronous sample on the previous page, which works with client and Web apps, but isn’t appropriate for WP7.
An important tip when doing OAuth in Windows Phone is that you must set the clock on the emulator to your current time. Watch the time zone too, which can throw things off. OAuth uses a time stamp that must be in sync with the Twitter Server.
I also recently fixed a couple problems related to recent changes in Twitter, so if you run into problems on other queries, the downloadable source is here, where you can get the latest changes:
http://linqtotwitter.codeplex.com/SourceControl/list/changesets
Joe