Enabling Facebook Login¶
Note this step may be done any time before publishing your app, but your Facebook Login will not work until then.
To enable Facebook Login in your app, please follow below steps.
Set Up Facebook App¶
Log into Meta for developers and click
Create Appon the top right of the page.
Fill out your
APP contact emailthen click
Create App. Note you can change this later in the Settings.
Re-enter your developer's password and click
After turning to the main page, please click
set upicon on the
Select iOS and follow the instructions.
(1) Set up Your Development Environment: no need to change anything and click
(2) Fill in the Bundle ID, hit
You can find your Bundle ID in your
config.xmlfile on the root of your project.
yesfor Enable Single Sign On. Click
(4) Skip the following questions.
Quickstartunder Facebook Login on the left navigation menu. Select Android and follow the instructions.
Download the Facebook SDK for Androidand click
(2) Jump to the 3rd question and fill in the
Default Activity Class Name. Click
You can find the package name in config.xml file. Default activity class name is your package name plus
.MainActivity. For example, if your package name is
com.example.mobile, then your default activity class name will be
(3) Fill in the
Key Hashes. You can refer here for how to generate a key hash for developer environment.
yesfor Enable Single sing On. Click
(5) Skip the following questions.
Set Up Facebook Login Setting¶
Settingsunder Facebook Login on the left navigation menu.
Enter the following URL in the Valid OAuth redirect URIs field.
Make sure the
Client OAuth login,
Web OAuth login,
Use Strict Mode for redirect URIs,
Embedded Browser OAuth Login, and
Login from Devicesare enabled.
Finally, you must provide your App ID and App Secret to Exosite to enable your solution for Facebook Login. (You can find them on Settings → Basic.)
Update Your App Project¶
Update the APP_ID and the APP_NAME in your "package.json" and "config.xml" files.
Reinstall your app dependencies and platforms. Any time you change your "config.xml" or "package.json", you need to do the following remove commands and then reinstall the dependencies and platforms.
(1) Remove node_modules, plugins and platforms
cd hamv_mobile rm -rf node_modules rm -rf plugins rm -rf platforms
(2) Remove platform
ionic cordova platform rm android ionic cordova platform rm ios
(3) Reinstall project dependencies
(4) Reinstall platforms
ionic cordova platform add android ionic cordova platform add ios
Publish Your Facebook App¶
Go to Meta for developer and select your app.
Basicon the left navigation menu.
Complete the information needed and click
Once the settings are done, please switch the App mode to
Congratulations! Your app is now public.