v2.1.0-rc

Automated setup and cleanup

📘

React Native >= 0.8 supported
Automatically adopts UIScene lifecycle read more

Installation

EXPO GO is not supported

npx expo install @qore-id/[email protected]

Update Expo plugins

//app.json or app.config.js
{ "expo": {
   ...
  "plugins": ["@qore-id/react-native-qoreid-sdk/plugin"]
   ...
  }
}

If you are using local eas build:

npx expo prebuild && npx pod-install

Run your app

yarn ios
yarn android

Remove configurations and QoreID

yarn remove @qore-id/react-native-qoreid-sdk  

Permissions (app.json as required)

{
"expo": {
"name": "exponewtestapp",
"slug": "exponewtestapp",
"ios": {
  "bundleIdentifier": "com.qoreid.exponewtestapp",
  "infoPlist": {
    "NSCameraUsageDescription": "We need camera access to capture documents and selfies.",
    "NSPhotoLibraryUsageDescription": "We need photo library access to let you upload documents.",
    "NSMotionUsageDescription": "Required for accurate address verification using device motion.",
    "NSLocationWhenInUseUsageDescription": "Required for address verification services.",
    "NSLocationAlwaysAndWhenInUseUsageDescription": "Required for background location during address verification.",
    "UIBackgroundModes": ["location"]
  }
},
"android": {
  "package": "com.qoreid.exponewtestapp",
  "edgeToEdgeEnabled": true,
  "predictiveBackGestureEnabled": false,
  "permissions": [
    "CAMERA",
    "READ_EXTERNAL_STORAGE",
    "WRITE_EXTERNAL_STORAGE",
    "ACCESS_COARSE_LOCATION",
    "ACCESS_FINE_LOCATION",
    "ACCESS_BACKGROUND_LOCATION",
    "ACTIVITY_RECOGNITION"
  ]
   }
  }
}

Usage


    //App.tsx
    import React from 'react';
    import { Button, View } from 'react-native';
    import { useQoreIdSdk } from '@qore-id/react-native-qoreid-sdk';


    function App(){

      const callback = (data: any) => {
          console.debug(data);
        };

      const { launchQoreId } = useQoreIdSdk({
        onResult: callback,
      });

      function onSubmit() {
          const formData = {
            flowId: 0, /* Required for workflow */
            clientId: "", /* Required */
            productCode: "", /* Required for collection */
            customerReference: "", /* Required */
            applicantData: {
              firstName: "",
              middleName: "",
              lastName: "",
              gender: "",
              phoneNumber: "",
              email: "",
            },
            identityData: {
              idType: "",
              idNumber: "",
            },
            addressData: {
              address: "",
              city: "",
              lga: "",
            },
            ocrAcceptedDocuments:
              ['DRIVERS_LICENSE_NGA','VOTERS_CARD_NGA','NIN_SLIP_NGA','PASSPORT_NGA'],
          };

          launchQoreId(formData);
        }


      return (
          <View>
            <Button title="Launch QoreIdSdk" onPress={onSubmit} />
          </View>
        );
    }

iOS Capabilities Setup (required for verifind_4d)

Add Background Mode Capability