This project has moved and is read-only. For the latest updates, please go here.

Can't make a search in Windows Phone

Apr 7, 2013 at 9:34 PM
Edited Apr 7, 2013 at 10:18 PM

Hi, I'm just starting with Linq to Twitter. I'm developing an app where I need to search tweets for location, but I've found it to be different in W8 than in Windows Phone, and I haven't been able to do it.

Here´s my code:
private void GetTweets(object sender, RoutedEventArgs e)

            var auth = new SingleUserAuthorizer
                Credentials = new InMemoryCredentials
                    ConsumerKey = "",
                    ConsumerSecret = "",
                    OAuthToken = "",
                    AccessToken = ""
            using (var twitterCtx = new TwitterContext(auth))
                var search=
                    (from tweet in twitterCtx.Search
                     where  tweet.Type == SearchType.Search &&
                            tweet.GeoCode == "20.68593,-103.413942,10km"
                     select tweet).AsyncCallback(asyncResponse => {
                        //Not sure what'd go here

                    Console.WriteLine("search returned {0} statuses",search.Statuses.Count);
The thing here is that I'm not sure if it's due to the AsyncCallback, if I parse asyncResponse and assign it to a variable, it's always null.

Thanks in advance!

Edit: If it's an authentication problem, I don't want to use web auth, like in "MetroSearchDemo" Sample, is that possible? If not, how can I send a callback URL? I only found it on WinRtAuthorizer, not available on WP.
Apr 7, 2013 at 10:20 PM
Edited Apr 7, 2013 at 10:21 PM
I'm sorry I sent this, I was having a hard time with this. I found the solution in this link:
Search on Windows PHone

I had already seen it and tried what it tells, but I dont know why I couldnt make it work.

If this is just making SPAM please someone delete it.

Sorry for the inconvenience!
Apr 7, 2013 at 10:28 PM
Not a problem - glad you found a solution. :)