Facebook分享: - “发生错误。请稍后再试”分享itunes链接

时间:2014-02-28 10:07:21

标签: ios iphone objective-c facebook facebook-graph-api

我正在使用fb graph api,当我试图分享我的应用程序的itunes链接FbWebDialog显示"发生错误。请稍后重试"。

这是我的代码: -

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"]];

                                            }
                                          }
                                        }
                                      }];

当我删除或更改链接参数时,完美地完成共享。

1 个答案:

答案 0 :(得分:3)

用它来共享FB上的itunes链接。 https://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=xyz 用您的itunes app id替换xyz。