Facebook SDK iOS-共享自定义故事
我想分享一个Facebook SDK为iOS定制的故事。我试着用这些方法,但没有一种有效: 不记录任何内容Facebook SDK iOS-共享自定义故事,ios,objective-c,facebook-graph-api,Ios,Objective C,Facebook Graph Api,我想分享一个Facebook SDK为iOS定制的故事。我试着用这些方法,但没有一种有效: 不记录任何内容 [FBGraphObject openGraphObjectForPostWithType:@"Lorem ipsum" title:@"Lorem ipsum" image:@"https://example.com/cookin
[FBGraphObject openGraphObjectForPostWithType:@"Lorem ipsum"
title:@"Lorem ipsum"
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> action = (id<FBOpenGraphAction>)[FBGraphObject graphObject];
[action setObject:cell.params forKey:slugs[self.categoryID]];
[FBDialogs presentShareDialogWithOpenGraphAction:action
actionType:[NSString stringWithFormat:@"Lorem ipsum:%@", slugs[self.categoryID]]
previewPropertyName:slugs[self.categoryID]
handler:^(FBAppCall *call, NSDictionary *results, NSError *error) {
if(error) {
NSLog(@"Error: %@", error.description);
} else {
NSLog(@"Success!");
}
}];
单元格参数
[FBSession openActiveSessionWithAllowLoginUI:NO];
FBRequest *request = [FBRequest requestForPostWithGraphPath:@"/me/Lorem ipsum" graphObject:@{@"object": cell.params}];
[request setHTTPMethod:@"POST"];
[request startWithCompletionHandler:^(FBRequestConnection *connection, id result, NSError *error)
{
if (!error)
{
// Sucess! Include your code to handle the results here
NSLog(@"result: %@", result);
NSString *alertTitle = @"Object successfully created";
NSString *alertText = @"An object has been created";
[[[UIAlertView alloc] initWithTitle:alertTitle
message:alertText
delegate:self
cancelButtonTitle:@"OK!"
otherButtonTitles:nil] show];
}
else
{
NSLog(@"%@", [error localizedDescription]);
}
}];
cell.params = [FBGraphObject openGraphObjectForPostWithType:[NSString stringWithFormat:@"Lorem ipsum:%@", slugs[self.categoryID]]
title:@"Lorem ipsum"
image:[NSString stringWithFormat:@"https://example.com/cooking-app/images/%@.png", slugs[self.categoryID]]
url:@"https://example.com"
description:@"Lorem ipsum"];
cell.params[@"Lorem ipsum"] = @{@"minutes": @5, @"seconds": @37, @"hours": @1};