Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/templates/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Facebook graph api &引用;例如;使用FacebookGraphAPI的页面,Objective C_Facebook Graph Api_Facebook Like - Fatal编程技术网

Facebook graph api &引用;例如;使用FacebookGraphAPI的页面,Objective C

Facebook graph api &引用;例如;使用FacebookGraphAPI的页面,Objective C,facebook-graph-api,facebook-like,Facebook Graph Api,Facebook Like,我正在尝试允许iOS应用程序的用户使用以下代码“喜欢”页面: NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"access_token",[[NSUserDefaults standardUserDefaults] objectForKey:@"fb_accessToken"], nil]; [facebook requestWithGraphPath:@"PAGE_ID/lik

我正在尝试允许iOS应用程序的用户使用以下代码“喜欢”页面:

NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"access_token",[[NSUserDefaults standardUserDefaults] objectForKey:@"fb_accessToken"], nil];

[facebook requestWithGraphPath:@"PAGE_ID/likes" andParams:params andHttpMethod:@"POST" andDelegate:self];
我收到错误消息:

Error Domain=facebookErrDomain Code=10000 "The operation couldn’t be completed. (facebookErrDomain error 10000.)" UserInfo=0x624d560 {error=<CFBasicHash 0x6243fb0 [0x171e400]>{type = mutable dict, count = 2,
        entries =>
            2 : <CFString 0x624cec0 [0x171e400]>{contents = "type"} = <CFString 0x624bc40 [0x171e400]>{contents = "OAuthException"}
            3 : <CFString 0x624aaf0 [0x171e400]>{contents = "message"} = <CFString 0x6248b50 [0x171e400]>{contents = "(#3) Application does not have the capability to make this API call."}
        }
        }
Error Domain=facebookerdomain code=10000“操作无法完成。(facebookerdomain Error 10000。)”UserInfo=0x624d560{Error={type=mutable dict,count=2,
条目=>
2:{contents=“type”}={contents=“OAuthException”}
3:{contents=“message”}={contents=“(#3)应用程序没有进行此API调用的功能。“}
}
}

这应该是GraphAPI的一部分,因为它说您可以使用它来“喜欢”具有/Likes连接的任何对象。有什么帮助吗?

很抱歉,你带来了坏消息,但显然你不喜欢代表用户的页面。但是,您可以代表用户发送帖子、评论和照片

希望这是有意义的,我已经花了过去几个小时试图做simular

丰富的

就像一个帖子

NSMutableDictionary* dict = [[[NSMutableDictionary alloc]initWithObjectsAndKeys:PostId,@"post_id",nil]autorelease];

[AppDelegate.facebook requestWithMethodName:@"stream.addLike" andParams:dict andHttpMethod:@"POST"  andDelegate:self];
然后像

NSMutableDictionary* dict = [[[NSMutableDictionary alloc]initWithObjectsAndKeys:PostId,@"post_id",nil]autorelease];

[AppDelegate.facebook requestWithMethodName:@"stream.removeLike" andParams:dict andHttpMethod:@"POST"  andDelegate:self];`

我花了10个小时来解决这个问题


但不幸的是,没有办法。。甚至他们在“喜欢”图形api中也提到了“任何对象”,但仅限于“用户、帖子、评论和照片”。

这似乎最近有所改变,但现在有了一个新的api-请参阅以了解详细信息。

Eric Kassan链接的页面第二段指出:“og.likes操作可以引用任何打开的图形对象或URL,除了Facebook页面或照片。“

普遍的共识似乎是,你不能代表用户喜欢一个页面,而我只是有一个ios游戏,就像代表我的页面一样。极限公路之旅成功地让你喜欢他们自己的页面。我希望我现在做这件事时能多加注意……嗨,华莱士!我正在寻找同样的情况下,喜欢应用程序的facebook页面从ios应用程序。你有没有从应用程序本身中找到喜欢应用程序自己页面的方法?facebook的内置类操作只允许喜欢对象(评论、帖子、照片),而不允许喜欢页面。有什么建议吗?@wallacer!如果你遇到同样的问题,你能回答我的问题吗。谢谢