如何在对话框而不是Safari网页中进行Facebook身份验证

时间:2011-07-26 02:26:37

标签: iphone ios facebook

当使用Facebook连接的iPhone应用程序时,我遵循SSO指南(http://developers.facebook.com/docs/guides/mobile/)但我讨厌SSO将我发送到Safari页面。我想在对话框中进行身份验证。

请告诉我你是否遇到过同样的问题。谢谢。

1 个答案:

答案 0 :(得分:1)

Facebook.m中,您需要更改以下代码:

- (void)authorize:(NSArray *)permissions
         delegate:(id<FBSessionDelegate>)delegate {

    [_permissions release];
    _permissions = [permissions retain];

    _sessionDelegate = delegate;

    /*  safariAuth should be NO  */
    [self authorizeWithFBAppAuth:NO safariAuth:NO];

    /*
         authorizeWithFBAppAuth: will launch the Facebook App
         safariAuth: will launch Mobile Safari

         When both of these are set to NO, the Facebook Login
         Dialog will appear inside of your app.
     */
}