io.ezto.verify.react.internal
TypeScript icon, indicating that this package has built-in type declarations

3.0.0 • Public • Published

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
  1. For Android add below implementation to build.gradle
dependencies {
    implementation "io.ezto.verify:sdk:1.0.15"
}
  1. Add below code to repositories section in build.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 run pod install

  • Open .xcworkspace in xcode

  • Go 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

  1. For Android add below permissions to AndroidManifest.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" />
  1. For iOS add required usage descriptions to info.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>
  1. Add webcredentials with your tenant url to ios/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');

Package Sidebar

Install

npm i io.ezto.verify.react.internal

Repository

google.com

Weekly Downloads

0

Version

3.0.0

License

MIT

Unpacked Size

12.3 MB

Total Files

71

Last publish

Collaborators

  • ezto