使用Facebook C#SDK搜索位置

本文关键字:位置 搜索 C#SDK Facebook 使用 | 更新日期: 2023-09-27 17:57:42

我想使用Facebook C#SDK 在Open Graph上运行搜索

https://graph.facebook.com/search?q=coffee&type=place&中心=37.76,-122.427&距离=1000&access_token=

但我不确定我是否应该使用查询、POST或某种形式的FQL。

更新:据我所知,我可以构建这样的查询:

   var result = fb.Get(String.Empty,
                         new Dictionary<string, string>()
                              .SelectFields(new[] { "picture" })
                              .SelectIds(new[] { "123741737666932", "100001241534829" })
                              .SelectField("id"));

我可以换联邦调查局。去联邦调查局。Get("搜索"),但我不确定之后要选择什么。

使用Facebook C#SDK搜索位置

此代码将为您提供您想要的东西:

Dictionary<string,object> searchParams = new Dictionary<string,object>();  
searchParams.Add("q", "coffee");     
searchParams.Add("center", "37.76,-122.427");     
searchParams.Add("type", "place");     
searchParams.Add("distance", "1000");
FacebookClient fbClient = new FacebookClient(token);
var searchedPlaces = fbClient.Get("/search", searchParams); 

想明白了。

Dictionary<string, string> dict = new Dictionary<string, string>();
dict.Add("q", "coffee");
dict.Add("type", "place");
dict.Add("center", "-37.01,31.0015");
dict.Add("distance", "5");
var result = fb.Get("search", dict);