我正在尝试运行 facebook 提供的 Open Graph Action 示例,但没有任何反应。调试时,我看到该操作已创建,但在 [FBDialogs presentShareDialog...] 它只是跳过并跳转到函数的末尾。你为什么认为这是?我读到 shareddialog 不能在 IOS 模拟器中运行,但不应该产生错误或什么?或者如果我在模拟器上运行它应该什么都不会发生?
-(IBAction)ShareFB:(id)sender{
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!");
}
}];
参考文字:https ://developers.facebook.com/docs/ios/share-dialog/#tips