Facebook Login

Estimated reading: 3 minutes 334 views
  • Log in to your Facebook account.
  • Go to Facebook for Developers, click on My Apps and press Create App.
  • Select Consumer. and click Next.
  • Set the Display Name of your application.
  • Enter the Contact Email.
  • Click on Create App.
  • Navigate to Facebook Login and press the Set up button.
  • Select Android from the displayed platforms.
  • Add your package name that uniquely identifies your Android app, and add Activity Class Name {packageName}.LoginActivity
  •  Add Key Hashes, you can get this from LoginActivity.cs on the code:
    string hashId = Methods.App.GetKeyHashesConfigured(this);
  • Enable Single Sign On
  • Add in the file analytic.xml string elements with the names facebook_app_idfb_login_protocol_scheme and facebook_client_token, and set the values to your App ID and Client Token.
  • Then go to the Settings on the left nav bar section and choose Basic.
  • In the appeared menu some of the fields are generated automatically. All you need to do is fill in the rest of them, such as App DomainsContact EmailPrivacy Policy URL, and Terms Of Service in particular.
    1. App Domains – Enter your domain name, without HTTP or HTTPS (example.com, www.example.com).
    2. Privacy Policy URL Enter your website’s privacy policy URL (example.com/terms/privacy).
    3. Terms of Service URL Enter your website’s Terms of Service URL (example.com/terms/terms).
    4. User Data Deletion Enter your website’s Terms of Service URL (example.com/terms/terms).
    5. Category – Choose your app category (Social networks & dating).
  • Click on Save changes.
  • Go to the left nav bar section and choose Facebook Login then click on Settings.
  • Scroll down a bit and find Valid OAuth Redirect URIs
  • Add the following Redirect URIs:
    1. https://yourwebsite.com/login-with.php?provider=Facebook
    2. https://www.yourwebsite.com/login-with.php?provider=Facebook
  • Click on Save changes
  • On the top, you’ll see this message Your app has Standard Access to public_profile. To use Facebook Login, switch public_profile to Advanced Access Click on Get Advanced Access
    1. Enter email in the search box, then click Get Advanced Access, and confirm the form.
    2. Enter public_profile in the search box, then click Get Advanced Access, and confirm the form.
  • The last step is to set the app mode to Live
    1. On the top navbar, you’ll find App Mode, click the toggle, and set the app to Live
    2. Complete Data Use Checkup (If required)
Note

You can activate and deactivate your app by setting the variable ShowFacebookLogin.

For more details, you can see the video

Leave a Comment