[英]Not able to create Custom Open Graph Stories using FB SDK in iOS
我正在尝试使用Facebook SDK的Graph API通过我的应用发布故事。 我已经在其App控制台上配置了动作,对象和故事,并实现了以下代码来实现相同的目的。
NSURL *imageURL = [NSURL URLWithString:@"https://fbstatic-a.akamaihd.net/images/devsite/attachment_blank.png"];
FBSDKSharePhoto *photo = [FBSDKSharePhoto photoWithImageURL:imageURL userGenerated:NO];
NSDictionary *properties = @{
@"og:type": @"abc-holdings:glc",
@"og:title": @"Sample GLC",
@"og:description": @"Test Geo",
@"og:url": @"http://samples.ogp.me/147425295593678",
@"og:image": @[photo],
@"abc-holdings:location:longitude":@(-58.381667),
@"abc-holdings:location:latitude":@(23.381667)
};
FBSDKShareOpenGraphObject *object = [FBSDKShareOpenGraphObject objectWithProperties:properties];
FBSDKShareOpenGraphAction *action = [FBSDKShareOpenGraphAction actionWithType:@"abc-holdings:has_a_glc" object:object key:@"glc"];
[action setString:@"true" forKey:@"fb:explicitly_shared"];
// Create the content
FBSDKShareOpenGraphContent *content = [[FBSDKShareOpenGraphContent alloc] init];
content.action = action;
content.previewPropertyName = @"glc";
// Share the content
FBSDKShareAPI *shareAPI = [[FBSDKShareAPI alloc] init];
shareAPI.shareContent = content;
shareAPI.delegate = self;
[shareAPI share];
但是这个问题是它回应我如下
Error Domain=com.facebook.sdk.share Code=201 "The operation couldn’t be completed. (com.facebook.sdk.share error 201.)" UserInfo=0x7fb9e1749190 {com.facebook.sdk:FBSDKErrorDeveloperMessageKey=Error sharing Open Graph content, NSUnderlyingError=0x7fb9e14c5210 "The operation couldn’t be completed. (com.facebook.sdk.core error 8.)"}
有任何想法吗?
您应该转到Facebook上的应用程序。 选择“打开图形”设置,选择操作类型,向下滚动到最后。 在那里您将看到一些复选框您的操作功能
选中最后一个复选框,然后尝试再次共享您的内容。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.