$ npm install react-native-popdeem --save
$ react-native link react-native-popdeem
We use cocoapods to manage this library
- yarn add https://github.com/hoavo/popdeem-react-native
- move to ios folder: cd ios
- pod init
- pod 'RNPopdeem', :path => '../node_modules/react-native-popdeem'
- pod install
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import com.reactlibrary.RNPopdeemPackage;
to the imports at the top of the file - Add
new RNPopdeemPackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':react-native-popdeem' project(':react-native-popdeem').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-popdeem/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':react-native-popdeem')
To launch the social login popover from javascript, use the following:
popdeem.enableSocialLogin(3, function() {}, function() {});
The first parameter is the numberOfPrompts argument. The popover is dismissible by the user - this argument denotes the maximum number of times a user can see this popover.
To show the Popdeem Home flow from javascript, use the following:
popdeem.pushPopdeemHome(function() {}, function() {});
. Popdeem Home encapsulates all of Popdeem’s functionality.
We may need you to deliver a user token. If so, you can do this by using this method:
popdeem.deliverThirdPartyToken(“ThirdPartyToken", function() {}, function() {});
.
import {NativeModules} from 'react-native';
const RNPopdeem = NativeModules.RNPopdeem;
// TODO: What to do with the module?
RNPopdeem.init('api_key')
RNPopdeem.enableSocialLoginWithNumberOfPrompts(3);