FBSDKLoginManager logInWithReadPermissions?

后端 未结 4 661
滥情空心
滥情空心 2021-02-04 03:20

I\'m using FBSDKLoginButton to allow to user login using Facebook and using FBSDKLoginButton.readPermissions = @[@\"public_profile\",@\"email\",

相关标签:
4条回答
  • 2021-02-04 04:00

    I also have the same issue with user_posts permission for two weeks, but after some search i found the solution for this, if you still having this issue follow these steps

    1. Go to http://developers.facebook.com and logged in to your developer account.
    2. Select your app and go to Roles section.
    3. Add a tester in Testers section.
    4. Then re-install the app and login using that tester account.
    5. Now you try to get the required permissions from tester and tester will see all the permissions list.
    0 讨论(0)
  • 2021-02-04 04:05

    Facebook Login provides your app access to a person's public profile, friend list, and email address. These three permissions do not require review. Instead, your app's users will choose whether they want to grant access to this information.

    In order for your app to access additional elements of a person's Facebook profile (read permissions) or to publish content to Facebook on their behalf (write permissions), you will need to submit for review.

    Refer to : https://developers.facebook.com/docs/apps/review#submitlogin

    Updated :

    Apps should separate the request of read and publish permissions.

     FBSDKLoginManager *login = [[FBSDKLoginManager alloc] init];
    
        [login logInWithPublishPermissions:@[@"publish_actions"] handler:^(FBSDKLoginManagerLoginResult *result, NSError *error) {
            if (error) {
                // Process error
            } else if (result.isCancelled) {
                // Handle cancellations
            } else {
                // If you ask for multiple permissions at once, you
                // should check if specific permissions missing
                if ([result.grantedPermissions containsObject:@"publish_actions"]) {
                    // Do work
    
                    [login logInWithReadPermissions:@[@"user_likes",@"user_birthday"] handler:^(FBSDKLoginManagerLoginResult *result, NSError *error) {
                        if (error) {
                            // Process error
                        } else if (result.isCancelled) {
                            // Handle cancellations
                        } else {
                            // If you ask for multiple permissions at once, you
                            // should check if specific permissions missing
                            if ([result.grantedPermissions containsObject:@"user_birthday"]) {
                                // Do work
    
                                NSLog(@"Permission  2: %@",result.grantedPermissions);
                            }
                        }
                    }];
    
                }
            }
        }];
    

    You don't need public_profile in read permission as if granted permission to publish_actions it also gets permission for public_profile.

    0 讨论(0)
  • 2021-02-04 04:12

    As i seen you code that you are trying to use the "user_likes", "user_birthday", "public_profile" and "publish_actions" permissions.

    From 1st May 2015 facebook has only enabled "public_profile", "email" and "user_friends" are available without the approval process.

    For "user_likes", "user_birthday" and "publish_actions" you need to get approval from the facebook.

    For review process you can get help from Facebook Review.

    0 讨论(0)
  • 2021-02-04 04:24
    var login = FBSDKLoginManager()
    
    
    @IBAction func fbBtnPressed(_ sender: AnyObject) {
    
        login.logIn(withReadPermissions: ["email"], from: self) { (FBSDKLoginManagerLoginResult, Error) in
    
            if Error != nil {
                print("O Login via Facebook Falhou. Erro: \(Error)")
            } else {
                let accessToken = FBSDKAccessToken.current().tokenString
                self.gotoScreen() //Function for screen after login succesfull 
                print("Acesso concedido ao Facebook. \(accessToken)")
            }
    
        }
    
    }
    
    0 讨论(0)
提交回复
热议问题