io.ezto.verify.react.internal
v3.0.0
Published
io.ezto.verify.react.internal
Downloads
4
Readme
Ezto Verify
Wrapper for handling the ezto verify SDK in React Native Apps.
Installation
- Add
io.ezto.verify.react.internal
as local dependency in package.json
"dependencies": {
"io.ezto.verify.react.internal": "file:../io.ezto.verify.react.internal"
}
- Run
yarn
to install the dependencies
- For
Android
add below implementation tobuild.gradle
dependencies {
implementation "io.ezto.verify:sdk:1.0.15"
}
- Add below code to
repositories
section inbuild.gradle
maven {
url "https://gitlab.grootan.com/api/v4/projects/573/packages/maven"
credentials(HttpHeaderCredentials) {
name "Deploy-Token"
value "YourTokenHere"
}
authentication {
header(HttpHeaderAuthentication)
}
}
Note: This is an requirement to use Biometrics
Navigate to ios folder using
cd ios
and runpod install
Open
.xcworkspace
in xcodeGo to Build Phases => Link Binary With Libraries and add the below frameworks
node_modules/io.ezto.verify.react.internal/ios/debug/eztoverify_sdk.framework
node_modules/io.ezto.verify.react.internal/ios/release/eztoverify_sdk.framework
Add Required permissions
- For
Android
add below permissions toAndroidManifest.xml
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.VIDEO_CAPTURE" />
<uses-permission android:name="android.permission.AUDIO_CAPTURE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
- For
iOS
add required usage descriptions toinfo.plist
<key>NSFaceIDUsageDescription</key>
<string>FaceID is required for user authentication</string>
<key>NSMicrophoneUsageDescription</key>
<string>Mic access is required for user authentication</string>
<key>NSCameraUsageDescription</key>
<string>Camera access is required for user authentication</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>Location access is required for user authentication</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Location access is needed for user authentication.</string>
- Add
webcredentials
with your tenant url toios/Runner.entitlements
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>aps-environment</key>
<string>development</string>
<key>com.apple.developer.associated-domains</key>
<array>
<string>webcredentials:example.ezto.io</string>
<!-- Replace example.ezto.io with your ezto verify workspace url -->
</array>
</dict>
</plist>
Note: This is an requirement to use
Fido
Usage
const McWrapper = NativeModules.EztoVerifyServiceImpl;
const eventEmitter = new NativeEventEmitter(McWrapper);
export function MyListener(this: any) {
this.eventListener = eventEmitter.addListener(
'onClosed', // Don't change the eventType
(event: any) => {
//Transaction has completed
}
);
this.eventListener = eventEmitter.addListener(
'onError', // Don't change the eventType
(event: any) => {
//SDK has thrown some error
}
);
this.eventListener = eventEmitter.addListener(
'onResult', // Don't change the eventType
(event: any) => {
//This will be called if the Result Hook notification way in Ezto dashboard is set to Mobile_Sdk
//Only called if the authentication flow is completed successfully
}
);
this.eventListener = eventEmitter.addListener(
'onPermissionDenied', // Don't change the eventType
(event: any) => {
//The user has denied runtime permission
}
);
}
When push message is received call onPushReceived
method
import { onPushReceived } from 'io.ezto.verify.react.internal';
messaging().onMessage(async (remoteMessage) => {
//Push Support can be Firebase or HMS based on the push service used
onPushReceived(remoteMessage.data, encryptionString, 'firebase');
})
To launch the QR Scanner
import { launchQrScanner } from 'io.ezto.verify.react.internal';
//Push Support can be Firebase or HMS based on the push service used
launchQrScanner(encryptionString, 'firebase');