Let’s Learn Step By Step Process For React Native Application.
- hats create-react-native-app
- react-native-starter-app
- react-native-webpack-starter-kit
- react-native-redux-starter-kit
- ignite cli
- expo cli
Facebook Log In Through API Integration
react-native-oauth
- Github
- Slack
Features
- Isolates the OAuth experience to a few simple methods.
- Automatically stores the tokens for later retrieval
- Works with many providers and simple to add new providers
- Works on both Android and iOS
- Makes calling API methods a snap
- Integrates seamlessly with Firestack (but can be used without it)
Installation
Android setup
Creating the manager
Configuring The Providers
- The provider name, such as facebook
- The provider’s individual credentials
Implemented providers
Facebook (Android)
For Android, we also need to add the app package name.
Also, we need to add the Key hash for development and production mode in the setting of Facebook login
Authenticating Against Our Providers
- The provider we wish to authenticate against ( Facebook)
- The list of options on a per-provider basis (optional)
Calling A Provider’s API
We can use OAuthManager to make requests to endpoints from our providers as well. If our user has been authorized for the request, we can execute the request using the credentials stored by the OAuthManager.
-
The provider we’re making a request to.
-
The URL (or path) we want to make the request.
-
Any additional options.
get post put delete head options trace
To add more data to our requests, we can pass a third argument:
To add more data to our requests, we can pass the third argument:
deauthorize()
We can deauthorize() our user’s from using the provider by calling the deauthorize() method. It accepts a single parameter:
The provider we want to remove from our user credentials.
manager.deauthorize(‘facebook’);
Now you have successfully created a Facebook login for your app. So if a user lands on your app they can log in through Facebook. This the page they will be redirected to when they click on login through Facebook.
Learn more about the technical aspects of creating digital properties in our upcoming Content Management Systems blog series.