我正在尝试创建一个在Facebook上分享帖子的分享按钮。我在Facebook开发者页面上的Dialogs和UI控件下找到了以下代码。它工作得很好。唯一的问题是,在Facebook帖子页面上几秒钟后,它会自动返回到应用程序,而不会点击任何内容。以下代码是我在Facebook plist
Facebook应用信息旁添加的与Facebook相关的所有内容。
为什么它会自动返回应用程序?
代码:
id<FBGraphObject> mealObject =
[FBGraphObject openGraphObjectForPostWithType:@"cooking-app:meal"
title:@"Lamb Vindaloo"
image:@"https://example.com/cooking-app/images/Lamb-Vindaloo.png"
url:@"https://example.com/cooking-app/meal/Lamb-Vindaloo.html"
description:@"Spicy curry of lamb and potatoes"];
id<FBOpenGraphAction> cookAction = (id<FBOpenGraphAction>)[FBGraphObject graphObject];
[cookAction setObject:mealObject forKey:@"meal"];
[FBDialogs presentShareDialogWithOpenGraphAction:cookAction
actionType:@"cooking-app:cook"
previewPropertyName:@"meal"
handler:^(FBAppCall *call, NSDictionary *results, NSError *error) {
if(error) {
NSLog(@"Error: %@", error.description);
} else {
NSLog(@"Success!");
}
}];