我正在使用最新的 SDK 并尝试将故事发布到 facebook,但由于某种原因它不起作用。它仅在我尝试使用此代码发布时才有效:
NSMutableDictionary<FBGraphObject> *action = [FBGraphObject graphObject];
action[@"funtone"] = @"http://samples.ogp.me/491689410900420";
[FBRequestConnection startForPostWithGraphPath:@"me/pelephoneil:listen_to"
graphObject:action
completionHandler:^(FBRequestConnection *connection,
id result,
NSError *error) {
// handle the result
}];
当我尝试使用此代码时它不起作用:
id<FBGraphObject> listenObject =
[FBGraphObject openGraphObjectForPostWithType:@"pelephoneil:listen_to"
title:@"FunTune"
image:@"https://example.com/cooking-app/images/Lamb-Vindaloo.png"
url:@"https://example.com/cooking-app/meal/Lamb-Vindaloo.html"
description:@"text for sample to sample"];
id<FBOpenGraphAction> songAction = (id<FBOpenGraphAction>)[FBGraphObject graphObject];
[songAction setObject:listenObject forKey:@"FunTone"];
[FBDialogs presentShareDialogWithOpenGraphAction:songAction
actionType:@"pelephoneil:listen_to"
previewPropertyName:@"FunTune"
handler:^(FBAppCall *call, NSDictionary *results, NSError *error) {
if(error) {
NSLog(@"Error: %@", error.description);
} else {
NSLog(@"Success!");
}
}];
有人可以告诉我似乎是什么问题吗?