puzzl-rn-onboarding
Puzzl onboarding for React Native
Installation
npm install puzzl-w2-onboarding
or
yarn add puzzl-w2-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:
<dict>
...
<key>NSCameraUsageDescription</key>
<string>Access to camera is needed for user identification purposes</string>
<key>NSMicrophoneUsageDescription</key>
<string>Access to microphone is needed for video identification</string>
</dict>
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;
onCancel: () => void | Promise<void>;
onFinished: () => void | Promise<void>;
onError?: () => 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
employee_acct?: bool; // toggle add employee account, defaults to true
id_scan?:bool; // toggle verify id, defaults to true
i9_form?:bool; // toggle i9 form, defaults to true
}
import PuzzlOnboarding from "puzzl-w2-onboarding";
// ...
<PuzzlOnboarding
companyID="..."
APIKey="..."
employeeID="..."
onCancel={() => hide()}
onFinished={() => {
// Onboarding completed successfully!
hide()
}}
onError={(error) => {console.log(error)}}
profile={true}
employee_acct={true}
id_scan={true}
i9_form={false}
/>