2013-04-24 30 views

Trả lời

12
FBLoginView *loginView = [[FBLoginView alloc] init]; 
loginView.readPermissions = @[@"email", @"user_likes"]; 
+1

Tôi đã làm điều này ,, nhưng trong lấy phương pháp dữ liệu im nhận null cho e-mail. tại sao vậy? Bạn có thể giúp tôi được không? – user2889249

+0

Rất tiếc, liên kết bạn theo dõi có thể bị hỏng hoặc trang có thể đã bị xóa. –

3

Hãy thử điều này:

- (BOOL)openSessionWithAllowLoginUI:(BOOL)allowLoginUI { 

      NSArray *permissions = [[NSArray alloc] initWithObjects: @"email", nil]; 
       return [FBSession openActiveSessionWithReadPermissions:permissions allowLoginUI:allowLoginUI completionHandler:^(FBSession *session, FBSessionState state, NSError *error) { 
      [self sessionStateChanged:session state:state error:error]; 
       }]; 
    } 

Gọi phương pháp này với YES, bạn có thể cho phép khác nhau như

[[NSArray arrayWithObjects: 
          @"email", 
          @"user_birthday", 
          @"user_likes", 
          @"user_location", 
          @"user_photos", 
          @"read_stream", 
          @"publish_stream", 
          @"publish_actions", 
          @"status_update", 
          @"user_about_me", 
          @"read_friendlists", 
          @"friends_about_me", 
          @"friends_birthday", 
          @"friends_photos", 
          nil] retain]; 
Các vấn đề liên quan