gpt4 book ai didi

ios - iOS在对象上发布赞无法正常使用-Facebook

转载 作者:行者123 更新时间:2023-12-01 16:33:41 25 4
gpt4 key购买 nike

使用Facebook文档中的示例代码,但无法正常工作

FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
initWithGraphPath:@"/{object-id}/likes"
parameters:nil
HTTPMethod:@"POST"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
id result,
NSError *error) {
// Handle the result
}];

它给
*
error =         {
code = 100;
message = "(#100) The parameter url is required";
type = OAuthException;
};
};*

最佳答案

Facebook为“喜欢”自定义对象提供了两种不同的实现。

1在这里:https://developers.facebook.com/docs/graph-api/reference/v2.3/object/likes#publish

另一个在这里
https://developers:facebook.com/docs/reference/opengraph/action-type/og.likes#create

它在第二个链接中的代码实际上有效

NSDictionary *params = @{
@"object": @"http://samples.ogp.me/226075010839791",
};
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
initWithGraphPath:@"/me/og.likes"
parameters:params
HTTPMethod:@"POST"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
id result,
NSError *error) {
// Handle the result
}];

关于ios - iOS在对象上发布赞无法正常使用-Facebook,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30188106/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com