用于iOS搜索的Facebook

用于iOS搜索的Facebook

本文介绍了用于iOS搜索的Facebook Graph API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用以下代码从GraphAPI搜索位置而没有运气。谁能请我的道路?

I am trying to search places from the GraphAPI using following code without luck. Can anybody please enlight my path ?

如果我尝试发布链接/消息/照片,它按预期工作,但在尝试获取位置时总是失败并给我 **操作无法完成。 (facebookErrDomain错误10000。)**

If I try to post link/message/photo it works as expected but when trying to get location it always fails and gives me **The operation couldn’t be completed. (facebookErrDomain error 10000.)**

//Following statement is using permissions
NSArray * permissions = [NSArray arrayWithObjects:@"publish_stream",@"user_checkins", @"friends_checkins", @"publish_checkins", nil];

[facebook authorize:FB_APP_ID permissions:permissions delegate:_delegate];
NSString *centerString = [NSString stringWithFormat: @"%f,%f", 37.76,-122.427];


        NSString *graphPath = @"search";
        NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                       @"coffee",@"q",
                                       @"place",@"type",
                                       centerString,@"center",
                                       @"1000",@"distance", // In Meters (1000m = 0.62mi)
                                       nil];

[facebook requestWithGraphPath:_path andParams:_params andHttpMethod:@"POST" andDelegate:_delegate];


推荐答案

没关系。从Facebook获取来自github的图形api的最新样本,其中包含相同的示例代码。

Never mind. Downloaded latest sample HackBook from facebook for graph api from github and it includes sample code for the same.

这篇关于用于iOS搜索的Facebook Graph API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 20:54