使用Facebook Open Graph Stories,我可以将多张照片作为对象的一部分发布吗?

时间:2015-11-02 17:21:02

标签: ios facebook facebook-graph-api

我在iOS应用中发布了一个Open Graph故事。到目前为止,一切都运行良好,但我希望将帖子扩展到vanilla实现之外,我无法找到任何我想要尝试的文档。现在,我想在故事帖中添加多张照片。这是我目前正在运行的代码:

FBSDKSharePhoto *fbphoto = [[FBSDKSharePhoto alloc] init];
fbphoto.image = newImage;
fbphoto.userGenerated = YES;

//Harvest Photo Action
//
NSString *typeKey = self.mapViewEngine.event.facebookAnimalORM.Name;
NSString *type = [NSString stringWithFormat:@"%@:%@", kFacebookNamespace, typeKey];
NSString *actionType = [NSString stringWithFormat:@"%@:%@", kFacebookNamespace, kFacebookHarvestAction];

NSDictionary *properties = @{
@"og:type": type,
@"og:title": @"Harvest Photo",
@"og:description": @"Harvest photo post.",
@"og:url": self.mapViewEngine.event.facebookAnimalORM.Details,
@"og:image": @[fbphoto]
};
FBSDKShareOpenGraphObject *object = [FBSDKShareOpenGraphObject objectWithProperties:properties];

FBSDKShareOpenGraphAction *action = [[FBSDKShareOpenGraphAction alloc] init];
action.actionType = actionType;
[action setObject:object forKey:typeKey];

FBSDKShareOpenGraphContent *content = [[FBSDKShareOpenGraphContent alloc] init];
content.action = action;
content.previewPropertyName = typeKey;

[FBSDKShareDialog showFromViewController:self.mapViewEngine.mapVC
withContent:content
delegate:self];

到目前为止,我尝试在属性字典中包含一个额外的@"og:image"标记,但Facebook只接受了第一个键/值对。我还尝试在@"og:image"数组值中添加第二张照片,但这破坏了代码,帖子从未进入我的时间轴。

我希望Facebook文档只是弱点,我错过了答案,但也许这不可能?或者有没有办法扩展我没有看到的基本Open Graph功能?

0 个答案:

没有答案