Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook sharing:- "An error occured.Please try again later" when sharing itunes link

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.

like image 539
Mayank Jain Avatar asked Jan 23 '26 14:01

Mayank Jain


1 Answers

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.

like image 191
Mayank Jain Avatar answered Jan 25 '26 02:01

Mayank Jain



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!