id<FBOpenGraphAction> action = (id<FBOpenGraphAction>)[FBGraphObject graphObject];
[action setObject:@"https://example.com/book/Snow-Crash.html"
forKey:@"book"];
[FBDialogs presentShareDialogWithOpenGraphAction:action
actionType:@"books.reads"
previewPropertyName:@"book"
handler:^(FBAppCall *call, NSDictionary *results, NSError *error) {
if(error) {
NSLog(@"Error: %@", error.description);
} else {
NSLog(@"Success!");
}
}];
我使用上面的代码在我的应用程序中显示一个 facebook shareDialog,但它在 ios 5.1 和 6.1 中都不起作用。我想知道原因。