FBWebDialogs没有显示 - 没有反应

时间:2014-10-02 21:08:15

标签: ios iphone xcode facebook-sdk-3.1

如果您有任何人可以帮助我使用这个Facebook SDK。我不知道发生了什么,问题是当点击facebook的按钮时没有显示任何内容 - FBWebDialog已经死了但#34;当应用程序被激活时,Xcode中的内存管理/消费栏该操作后的额外内存(约22 MB)。我已经按照官方教程:https://developers.facebook.com/docs/ios/share并重新安装了facebook SDK,添加了AppID等内容。即便如此,我也没有帮助过。那有什么不对?

我正在使用iphone模拟器和ios 8和Xcode 6.0。大约2 mounths之前一切正常。到目前为止,应用程序中显示了弹出窗口。 任何有关这方面的帮助将不胜感激。

更新:

我的代码:

[FBLoginView class];

            FBLinkShareParams *params = [[FBLinkShareParams alloc] init];
            params.link = [NSURL URLWithString:@"https://developers.facebook.com/docs/ios/share/"];

            // If the Facebook app is installed and we can present the share dialog
            if ([FBDialogs canPresentShareDialogWithParams:params]) {
                // Present the share dialog
                [FBDialogs presentShareDialogWithLink:params.link
                                              handler:^(FBAppCall *call, NSDictionary *results, NSError *error) {
                                                  if(error) {
                                                      // An error occurred, we need to handle the error
                                                      // See: https://developers.facebook.com/docs/ios/errors
                                                      NSLog(@"Error publishing story: %@", error.description);
                                                  } else {
                                                      // Success
                                                      NSLog(@"result %@", results);
                                                  }
                                              }];
            } else {
                // Present the feed dialog
                // Put together the dialog parameters
                NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                               @"Sharing Tutorial", @"name",
                                               @"Build great social apps and get more installs.", @"caption",
                                               @"Allow your users to share stories on Facebook from your app using the iOS SDK.", @"description",
                                               @"https://developers.facebook.com/docs/ios/share/", @"link",
                                               @"http://i.imgur.com/g3Qc1HN.png", @"picture",
                                               nil];

                // Show the feed dialog
                [FBWebDialogs presentFeedDialogModallyWithSession:nil
                                                       parameters:params
                                                          handler:^(FBWebDialogResult result, NSURL *resultURL, NSError *error) {
                                                              if (error) {
                                                                  // An error occurred, we need to handle the error
                                                                  // See: https://developers.facebook.com/docs/ios/errors
                                                                  NSLog(@"Error publishing story: %@", error.description);
                                                              } else {
                                                                  if (result == FBWebDialogResultDialogNotCompleted) {
                                                                      // User cancelled.
                                                                      NSLog(@"User cancelled.");
                                                                  } else {
                                                                      // Handle the publish feed callback
                                                                      NSDictionary *urlParams = [self parseURLParams:[resultURL query]];

                                                                      if (![urlParams valueForKey:@"post_id"]) {
                                                                          // User cancelled.
                                                                          NSLog(@"User cancelled.");

                                                                      } else {
                                                                          // User clicked the Share button
                                                                          NSString *result = [NSString stringWithFormat: @"Posted story, id: %@", [urlParams valueForKey:@"post_id"]];
                                                                          NSLog(@"result %@", result);
                                                                      }
                                                                  }
                                                              }
                                                          }];
            }

来自Facebook网站的标准代码,但仍然没有反应。

0 个答案:

没有答案