On the following code, when I try to share OG story via Share Dialog, and when I get to the share dialog, the "Post" button isn't enabled (even after I enter text).
I had "something went wrong..." in the FB app, but now I don't have it at all
The rest of the post seems OK.
Another important thing:
Almost a similar variant of this code, but with user generated photo works perfectly, but here the photo is a URL and is not user_generated
The code:
NSString *FacebookAppNamespace = @"my_fb_namespace";
id<FBGraphObject> object = [FBGraphObject openGraphObjectForPost];
FBOpenGraphActionParams *params = [[FBOpenGraphActionParams alloc] init];
id<FBOpenGraphAction> action = (id<FBOpenGraphAction>)[FBGraphObject graphObject];
NSString *previewPropertyName;
url = [NSString stringWithFormat:@"%@/facebook.html?al_applink_data=type%%3Drecipe%%26id%%3D%@",APPLINKS_LINK,self.recipeID];
name = self.recipeTitle;
image = self.recipeImage;
description = self.recipeTitle;
object[@"title"] = name;
object[@"type"] = [NSString stringWithFormat:@"%@:recipe",FacebookAppNamespace];
object[@"description"] = description;
object[@"image"] = @[@{@"url": image}]; //NOTE: tried a lot of variants here, thinking this is the cause
object[@"url"] = url;
[action setObject:object forKey:@"recipe"];
params.action = action;
params.actionType = [NSString stringWithFormat:@"%@:cook",FacebookAppNamespace];
previewPropertyName = @"recipe";
if([FBDialogs canPresentShareDialogWithOpenGraphActionParams:params]) {
[FBDialogs presentShareDialogWithOpenGraphAction:action
actionType:params.actionType
previewPropertyName:previewPropertyName
handler:dialogAppErrorHandler];
}