Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Identify24/react-native-identify-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

!!IMPORTANT!!

This repository is deprecated. Please use our new react-native sample bridge: https://github.com/business-service-solution-gmbh/id24.tr-react-sample

react-native-identify-sdk

Add this line to package.json file and run npm install

Adding to Project

"react-native-identify-sdk": "git+https://github.com/Identify24/react-native-identify-sdk.git",

Usage

/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 *
 * @format
 */

import { NavigationContainer } from '@react-navigation/native';
import { TransitionPresets, createStackNavigator } from '@react-navigation/stack';
import React from 'react';
import { Button, Text, View } from 'react-native';
import {IdentifyComponent} from 'react-native-identify-sdk';
import { IdentifyModuleScreenTypes } from 'react-native-identify-sdk';
import { IdentifyNetworkOptions, IdentifyOptions } from 'react-native-identify-sdk';
import { AddressScreen } from 'react-native-identify-sdk';
import { IdCardScreen } from 'react-native-identify-sdk';
import { LivenessScreen } from 'react-native-identify-sdk';
import { NfcScreen } from 'react-native-identify-sdk';
import { SelfieScreen } from 'react-native-identify-sdk';
import { SignitureScreen } from 'react-native-identify-sdk';
import { SpeechScreen } from 'react-native-identify-sdk';
import { VideoRecordScreen } from 'react-native-identify-sdk';
import { WaitScreen } from 'react-native-identify-sdk';
import { Camera } from 'react-native-vision-camera';
import { PermissionsPage } from 'react-native-identify-sdk';
import { IdentifyScreens } from 'react-native-identify-sdk/lib/typescript/src/module_interfaces/IdentifyNavigationProps';
import RNScreens from 'react-native-screens';

RNScreens.enableScreens()
const ProfileStack = createStackNavigator()



function SettingsScreen({ navigation }: any) {
  return <View style={{ height: 500 }}>
    <Text>
      "SettingsScreen"
    </Text>

    <Button title="Permission" onPress={async () => {

      const cameraPermission = await Camera.getCameraPermissionStatus()
      const microphonePermission = await Camera.getMicrophonePermissionStatus()
      if (cameraPermission === "granted" && microphonePermission === "granted") { navigation.navigate("Profile") }
      else {
        navigation.navigate("PermissionScreenIdentify")
      }
    }}></Button>
  </View>
}




function IdentifySdkScreen() {
  const screensOrder = [
    IdentifyModuleScreenTypes.TAKE_SELFIE,
    IdentifyModuleScreenTypes.AGENT_CALL,
    IdentifyModuleScreenTypes.IDENTIFICATION_INFORMATION_WITH_NFC,
    IdentifyModuleScreenTypes.IDENTIFICATION_INFORMATION_WITH_CARD_PHOTO,
    IdentifyModuleScreenTypes.LIVENESS_TEST,
    IdentifyModuleScreenTypes.SPEECH_TEST,
    IdentifyModuleScreenTypes.VIDEO_RECORD,
  
    IdentifyModuleScreenTypes.SIGNATURE,
    IdentifyModuleScreenTypes.VALIDATE_ADDRESS,
  ]

//if you want you can change this pages with custom pages.
  const identifyScreens: IdentifyScreens = {
    waitScreen: WaitScreen,
    nfcScreen: NfcScreen,
    idCardScreen: IdCardScreen,
    speechScreen: SpeechScreen,
    livenessDetectionScreen: LivenessScreen,
    selfieScreen: SelfieScreen,
    videoRecordScreen: VideoRecordScreen,
    signatureScreen: SignitureScreen,
    addressConfScreen: AddressScreen,
    //if you want I can use custom modules
    customModuleList: undefined
  }

  const identifyOptions: IdentifyOptions = {
    identId: "",
    language: "tr",
    screensOrder: screensOrder,
    screens: identifyScreens
  };

  const networkOptions: IdentifyNetworkOptions = {
    baseUrl: '',
    socketUrl: '',
    socketPort: '',
    stun: '',
    stunPort: '',
    turn: '',
    turnPort: '',
    turnUsername: '',
    turnPassword: '',
  }

  return (
    <IdentifyComponent
      options={identifyOptions}
      stack={ProfileStack}
      network={networkOptions}
    />
  );
}


function App(): JSX.Element {

  const RootStack = createStackNavigator();
  return (
    <NavigationContainer>
      <RootStack.Navigator initialRouteName="Settings" >
        <RootStack.Screen name="Settings" component={SettingsScreen} />
        <RootStack.Screen name="Profile" options={{
          headerShown: false,
          ...TransitionPresets.SlideFromRightIOS,
        }}
          component={IdentifySdkScreen} />
        <RootStack.Screen name="PermissionScreenIdentify" component={PermissionsPage} />
      </RootStack.Navigator>
    </NavigationContainer>

  );
}

export default App;

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library

About

No description, website, or topics provided.

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •