Android - Facebook登录iOS示例

时间:2014-07-11 15:03:40

标签: android facebook facebook-login

我想知道是否有人知道如何在Android上登录Facebook?它在iPhone上非常简单,但我注意到Android有点困难。这就是我在iPhone上所做的,任何人都可以让我知道我需要为android做什么:

[FBSession openActiveSessionWithReadPermissions:@[@"public_profile", @"user_birthday", @"email"]
                                       allowLoginUI:YES
                                  completionHandler:
     ^(FBSession *session, FBSessionState state, NSError *error) {

         AppDelegate* appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
         [appDelegate sessionStateChanged:session state:state error:error];


         if (session.state == FBSessionStateOpen)
         {
             //DO Action
         }
    }];

1 个答案:

答案 0 :(得分:0)

您可以在此处获得Android Facebook SDK:https://developers.facebook.com/docs/android/login-with-facebook/v2.0

享受!