【问题标题】:Facebook dialog Problem in Device,Not Properly Showing in Device设备中的 Facebook 对话框问题,设备中未正确显示
【发布时间】:2011-07-06 11:16:19
【问题描述】:

我成功地将 Facebook 集成到我的应用程序中。它在模拟器和 Iphone 上也可以正常工作,带有对话框。

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

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

【问题讨论】:

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


    【解决方案1】:

    注释掉函数下面几行代码

    - (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]];
    }
    }
    

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

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-07-19
    • 1970-01-01
    • 2012-06-02
    • 2013-06-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多