Hi i Facing strange issue with Post image using Facebook feed share dialog. I am using this bellow code:-
-(IBAction)shaerFacebook
{
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *savedImagePath = [documentsDirectory stringByAppendingPathComponent:@"savedImage2.png"];
NSURL *imageFileURL =[NSURL fileURLWithPath:savedImagePath];
UIImage *imagetoshare=[UIImage imageWithData:[NSData dataWithContentsOfURL:imageFileURL]];
if ([FBDialogs canPresentShareDialogWithParams:params]) {
// Present share dialog
id<FBGraphObject> pictureObject =
[FBGraphObject openGraphObjectForPostWithType:@"mypicture:picture"
title:@"title"
image:imagetoshare
url:imagetoshare
description:@""];
id<FBOpenGraphAction> action = (id<FBOpenGraphAction>)[FBGraphObject graphObject];
[action setObject:pictureObject forKey:@"picture"];
[FBDialogs presentShareDialogWithOpenGraphAction:action
actionType:@"Photoshare:cook"
previewPropertyName:@"picture"
handler:^(FBAppCall *call, NSDictionary *results, NSError *error) {
if(error) {
NSLog(@"Error: %@", error.description);
} else {
NSLog(@"Success");
}
}];
// If the Facebook app is NOT installed and we can't present the share dialog
}
}
it will navigate facebook
native app show the dialog with image and withing one second it will redirect to my app i can not able to post. i do lots of Google but not getting solution. please help me out in this where did i mistake.
Is there any specific change in to facebook app.?