Facebook对话框在设备中出现问题,未在设备中正确显示

时间:2011-07-06 11:16:19

标签: iphone objective-c ios4 iphone-sdk-3.0 facebook-graph-api

我成功地将Facebook集成到我的App中。它在模拟器和Iphone上运行良好,使用对话框。

但是当我在我的Iphone.On共享功能中从Itunes安装facebook官方应用程序时,它会将我的应用程序资源带到该App.with以下页面。当我删除Facebook官方App.Its再次工作正常。

enter image description here

enter image description here

任何解决方案????提前致谢

1 个答案:

答案 0 :(得分:0)

注释掉以下功能代码行

- (void)authorizeWithFBAppAuth:(BOOL)tryFBAppAuth safariAuth:(BOOL)trySafariAuth 

在Facebook.m中:

UIDevice *device = [UIDevice currentDevice];
if ([device respondsToSelector:@selector(isMultitaskingSupported)] && [device isMultitaskingSupported]) {
if (tryFBAppAuth) {
  NSString *scheme = kFBAppAuthURLScheme;
  if (_localAppId) {
    scheme = [scheme stringByAppendingString:@"2"];
  }
  NSString *urlPrefix = [NSString stringWithFormat:@"%@://%@", scheme, kFBAppAuthURLPath];
  NSString *fbAppUrl = [FBRequest serializeURL:urlPrefix params:params];
  didOpenOtherApp = [[UIApplication sharedApplication] openURL:[NSURL URLWithString:fbAppUrl]];
}
if (trySafariAuth && !didOpenOtherApp) {
  NSString *nextUrl = [self getOwnBaseUrl];
  [params setValue:nextUrl forKey:@"redirect_uri"];

  NSString *fbAppUrl = [FBRequest serializeURL:loginDialogURL params:params];
  didOpenOtherApp = [[UIApplication sharedApplication] openURL:[NSURL URLWithString:fbAppUrl]];
}
}

这将始终向用户显示一个对话框。