I created a custom open object, action, and story on the Facebook developers site, and then completed a tutorial to publish it through the official FB app (without accessing the app). This is the code:
NSMutableDictionary<FBGraphObject> *object;
NSString *returnUrl = [NSString stringWithFormat:@"http://tettomante.it/questions?%@",
[NSString stringWithURLParams:@{@"answer": _answerLabel.text, @"divination": [self divinationNickname]}]];
object = [FBGraphObject openGraphObjectForPostWithType:@"boobs-teller:question"
title:_questionTextView.text
image:@"https://d1rdorpdffwq56.cloudfront.net/icona_tettomante.jpg"
url:returnUrl
description:_answerLabel.text];
NSMutableDictionary<FBOpenGraphAction> *action = (NSMutableDictionary<FBOpenGraphAction> *) [FBGraphObject openGraphActionForPost];
action[@"question"] = object;
FBOpenGraphActionShareDialogParams *params = [[FBOpenGraphActionShareDialogParams alloc] init];
params.action = action;
params.actionType = @"boobs-teller:ask";
params.previewPropertyName = @"question";
if([FBDialogs canPresentShareDialogWithOpenGraphActionParams:params]) {
[FBDialogs presentShareDialogWithOpenGraphActionParams:params
clientState:nil
handler:^(FBAppCall *call, NSDictionary *results, NSError *error) {
if(error) {
NSLog(@"Error publishing story: %@", error.description);
}
else {
NSLog(@"result %@", results);
}
}];
}
, FB 10 , "" ( ) . , . , , ( , ), , . , FB , , . , .