Facebook Login
This section explains how you can create an app with user registration using Facebook Login and Parse Server core features through Back4App.
After following this tutorial, you will be able to do this:
At any time, you can access the complete Ionic Project built with this tutorial at our GItHub repository.
To complete this quickstart, you need:
- An app created at Back4App.
To start using Facebook functions, you need to:
- At the left panel, click on Settings > Basic. In this page:
- Take note of your App ID
- Add a Privacy Police URL
- Select a Category
- Scroll down and hit Save changes
4. At the top of the same page, click on the Off button and Confirm to make your app live.
5. Scroll down at the same page and click on Add platform.
- For this tutorial, let’s choose Android.
- Add your Google Play Package Name which in our case is com.back4app.myapp
- Add the Key Hashes of your machine (run keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64 to find out yours)
- Save changes
6. At the left panel, to back to Dashboard, scroll down and click on Facebook Login.
- Find the “Facebook Login” block and click on Settings. The “Facebook Login” block looks like this:
3. Add the Facebook App ID taken note in the previous step.
In this tutorial, we will be starting from where we left off in the previous User registration with email verification one.
Let’s first install Facebook cordova plugins:
Now, let’s implement the facebookLogin() method:
Finally, let’s add a button to our Login page and make it call the method we just created:
- Since Facebook log in does’t work on a browser, test your app by running ionic cordova run android.
- Find your app and click on Dashboard > Core > Browser > User to see the user that you’ve created!
At this stage, you can log in, register and log out of your app with Facebook using Parse Server core features through Back4App!