I am using fb graph api, When I m trying to share my app's itunes link FbWebDialog shows "An error occured.Please try again later".
here is my code:-
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
@"mayank", @"name",
@"test sharing", @"caption",
@"example", @"description",
@"https://itunes.apple.com/in/app/myApp/id12345", @"link",
nil];
// Show the feed dialog
[FBWebDialogs presentFeedDialogModallyWithSession:nil
parameters:params
handler:^(FBWebDialogResult result, NSURL *resultURL, NSError *error) {
if (error) {
//error
} else {
if (result == FBWebDialogResultDialogNotCompleted) {
} else {
// Handle the publish feed callback
NSDictionary *urlParams = [self parseURLParams:[resultURL query]];
if (![urlParams valueForKey:@"post_id"]) {
// User cancelled.
} else {
// User clicked the Share button
NSString *result = [NSString stringWithFormat: @"Posted story, id: %@", [urlParams valueForKey:@"post_id"]];
}
}
}
}];
when I remove or change link parameter, sharing done perfectly.
Use this for sharing itunes link on FB. https://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=xyz replace xyz with your itunes app id.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With