0

I'm using pretty much the exact example code that's found on the page for the Facebook iOS SDK component.

If I remove the ids_for_business it works fine. The thing is, I need either ids_for_business or token_for_business.

I tested the following using the Facebook Graph API Explorer and it works fine.

me?fields=ids_for_business,token_for_business

Here's the permissions I'm requesting:

List<string> readPermissions = new List<string> { 
     "public_profile","name","email","first_name","last_name", "ids_for_business" };

And here's the method I'm calling:

private void ShowLogin()
{
    // If was send true to Profile.EnableUpdatesOnAccessTokenChange method
    // this notification will be called after the user is logged in and
    // after the AccessToken is gotten
    Profile.Notifications.ObserveDidChange((sender, e) => {
        if (e.NewProfile == null)
            return;               
    });

    // Set the Read and Publish permissions you want to get
    loginView = new LoginButton(new CGRect(51, Element.Height / 2, 218, 46))
    {
        LoginBehavior = LoginBehavior.Native,
        ReadPermissions = readPermissions.ToArray(),              
    };

    // Handle actions once the user is logged in
    loginView.Completed += (sender, e) => {
        if (e.Error != null)
        {
            // Handle if there was an error
            System.Diagnostics.Debug.WriteLine($"Facebook Login Failed! {e.Error.DebugDescription}");
            login.FacebookNotAuthenticated();
        }

        if (e.Result.IsCancelled)
        {
            // Handle if the user cancelled the login request
            login.FacebookNotAuthenticated();
        }
        else
            System.Diagnostics.Debug.WriteLine("Facebook Login Success!");
    };

    // Handle actions once the user is logged out
    loginView.LoggedOut += (sender, e) => {
        // Handle your logout
    };

    View.AddSubview(loginView);
}
BrutalDev
  • 6,181
  • 6
  • 58
  • 72
jbassking10
  • 833
  • 4
  • 15
  • 42

1 Answers1

0

Please check the documentation: Permissions Reference - Facebook Login, this lists all permission keys we can require. But I didn't find ids_for_business nor token_for_business, it's not a legal string on facebook. So it will return invalid scope. Is business_management what you need?

Please refer to this documentation to find the corresponding permission string. Moreover notice that only public_profile, user_friends, and email do not require Review, all other permissions do.

Ax1le
  • 6,563
  • 2
  • 14
  • 61