puzzl-rn-onboarding
Puzzl onboarding for React Native
Installation
npm install puzzl-rn-onboarding
or
yarn add puzzl-rn-onboarding
#### iOS
* Make your app target iOS 11.0 or higher by adding this line to your Podfile: `platform :ios, '11.0'`
* Include Swift code in your project.
If your project does not already include Swift code, then create a new empty Swift file in the base of your project using Xcode and add the bridging header if Xcode offers.
* Add the following to your Info.plist:
...
NSCameraUsageDescription
Access to camera is needed for user identification purposes
NSMicrophoneUsageDescription
Access to microphone is needed for video identification
```
Android
- Add a new maven destination to the repositories in the
allprojects
section ofbuild.gradle
:
allprojects {
repositories {
// ... local react native repos
maven { url "https://cdn.veriff.me/android/" }
google()
jcenter()
}
}
Usage
This library exports a single component called PuzzlOnboarding with the following props:
interface OnboardingProps {
APIKey: string;
companyID: string;
employeeID?: string; // (optional) employeeID or contractorID is required
contractorID?: string; // (optional) employeeID or contractorID is required
onCancel: () => void | Promise<void>;
onFinished: () => void | Promise<void>;
onError?: (error) => any; // (optional; falls back to onCancel)
showError?: boolean; // (optional; default: true) Allow the component to display its own error message before cancelling onboarding
errorMessage?: string; // (optional) Personalize the error message
profile?: bool; // toggle profile info, defaults to true
contractor_acct?: bool; // toggle add contractor account, defaults to true
}
import PuzzlOnboarding from "puzzl-1099-onboarding";
// ...
<PuzzlOnboarding
companyID="..."
contractorID="..."
APIKey="..."
onCancel={() => hide()}
onError={(error) => {console.log(error)}}
onFinished={() => {
// Onboarding completed successfully!
hide()
}}
profile={true}
contracot_acct={true}
/>