Giter Site home page Giter Site logo

react-native-idnow's Introduction

react-native-idnow

npm version npm total downloads npm monthly downloads

React Native IDnow binding for iOS/Android platforms.

Installation

Using npm:

npm install --save react-native-idnow

or using yarn:

yarn add react-native-idnow

Linking

Automatic

⚠️ Only follow this step if you are using react-native <= 0.59 as react-native >= 0.60 is using auto-linking.

react-native link react-native-idnow

Manual

iOS
  • See "Additional required steps"
  1. In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  2. Go to node_modulesreact-native-idnow and add RNIdnow.xcodeproj
  3. In XCode, in the project navigator, select your project. Add libRNIdnow.a to your project's Build PhasesLink Binary With Libraries
  4. Run your project (Cmd+R)
Android
  1. Open up android/app/src/main/java/[...]/MainActivity.java
  • Add import com.bitwala.idnow.RNIdnowPackage; to the imports at the top of the file
  • Add new RNIdnowPackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':react-native-idnow'
    project(':react-native-idnow').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-idnow/android')
    
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
      compile project(':react-native-idnow')
    
    also in dependencies
      implementation 'de.idnow.android.sdk:idnow-platform:4.12.0'    
    
  3. Add the following to repositories in android/build.gradle:
       maven {
          url "https://raw.githubusercontent.com/idnow/de.idnow.android.sdk/master"            
       }
       maven {
          url "https://raw.githubusercontent.com/idnow/de.idnow.android/de.idnow.android-5.0.12.1"
       }
    

Additional required steps:

Android

  • Update android/app/src/AndroidManifest.xml: add xmlns:tools="http://schemas.android.com/tools" to the manifest tag add tools:replace="android:icon,android:theme,android:allowBackup" to the application tag

  • See IDnow AndroidManifest section

  • (not required) To change colors, update colors.xml (see /demo/ReactNativeIDnowSample/android/app/src/main/res/values/colors.xml)

iOS

  • Add the following pod dependencies to your podfile:
use_frameworks! :linkage => :static
pod 'IDnowSDK', '5.0.12'
  • Then, run the following command:
pod install --repo-update

or

pod install
  • Add following to Info.plist:
	<key>NSCameraUsageDescription</key>
	<string>Need camera access for video streaming and identification</string>
	<key>NSMicrophoneUsageDescription</key>
	<string>Need microphone access for video identification</string>
  • Add RNIdnow.h and RNIdnow.m files to the ios project(see demo app)

Usage

import { IDnowManager } from 'react-native-idnow';

try {
	await IDnowManager.startVideoIdent({
		transactionToken: 'TST-XXXXX',
	});
} catch (e) {
	...
}

react-native-idnow's People

Contributors

arifaydogmus avatar dumip avatar emadgit avatar nyablo avatar pepf avatar pradel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

react-native-idnow's Issues

License model

Hi,

Could you please update the license model for this library?

Thanks,
Dumitru

NPM install crash on idnow 0.1.7

Hello,
I've been trying the react-native-idnow library with one of my clients, but I suddenly get an error when running npm install. When running yarn install, everything works and no error is shown.
Struggled to find a solution by also downgrading the ID now version but with no help.
We are using

    "react": "17.0.1",
    "react-native": "0.64.2",
    "react-native-idnow": "^0.1.7",

Do you have any idea? From the error it says that the dependency version of react-native from react-native-idnow cannot be resolved:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react-native
npm ERR!   react-native@"0.64.2" from the root project
npm ERR!   peer react-native@"*" from @intercom/[email protected]
npm ERR!   node_modules/@intercom/intercom-react-native
npm ERR!     @intercom/intercom-react-native@"^1.0.5" from the root project
npm ERR!   34 more (@react-native-async-storage/async-storage, ...)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react-native@"^0.41.2" from [email protected]
npm ERR! node_modules/react-native-idnow
npm ERR!   react-native-idnow@"^0.1.5" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: [email protected]
npm ERR! node_modules/react-native
npm ERR!   peer react-native@"^0.41.2" from [email protected]
npm ERR!   node_modules/react-native-idnow
npm ERR!     react-native-idnow@"^0.1.5" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

And on the logs we have:

Could not resolve dependency:
peer react-native@"^0.41.2" from [email protected]
node_modules/react-native-idnow
  react-native-idnow@"^0.1.5" from the root project

Conflicting peer dependency: [email protected]
node_modules/react-native
  peer react-native@"^0.41.2" from [email protected]
  node_modules/react-native-idnow
    react-native-idnow@"^0.1.5" from the root project

Fix the upstream dependency conflict, or retry
this command with --force, or --legacy-peer-deps
to accept an incorrect (and potentially broken) dependency resolution.

App crashes when flipper is enabled

Reproducing steps:

  • Enable flipper on iOS project
    use_flipper!()
  • Run flipper desktop on your laptop.
  • Build run the iOS app.
    ==> iOS app crashes

Any idea how to resolve this issue ?

Unable to build with the new XCode 15

ld: building for 'iOS-simulator', but linking in object file (/ios/Pods/IDnowSDK/libidnow-sdk-universal.a[x86_64][285](bands.o)) built for 'iOS'
clang: error: linker command failed with exit code 1 (use -v to see invocation)

After updating to the new XCode version I wasn't able to run my app because IDNow is failing.

App crashes if any other package call for camera access

When our 'react-native-share' package calls for Camera access, our app is crashing. When I checked the errors, I found out
Screenshot 2020-11-17 at 13 39 03

IdNow activity listener is throwing an error because can not handle properly other activity results.

fixe is #23

Android : Error: environment when calling startVideoIdent

Hello @NazarYablonskiy,
Thanks for your great work on this project. It works perfectly for me on iOS. However I can't get it to work on Android. When I call

try {
   await IDnowManager.startVideoIdent({
      transactionToken: kycID
   });
} catch (e) {
   logger.log("IDnow exception: ", e)
}

I get a runtime error:

IDnow exception:  Error: environment
    at createErrorFromErrorData (NativeModules.js:155)
    at NativeModules.js:104
    at MessageQueue.__invokeCallback (MessageQueue.js:414)
    at MessageQueue.js:127
    at MessageQueue.__guard (MessageQueue.js:314)
    at MessageQueue.invokeCallbackAndReturnFlushedQueue (MessageQueue.js:126)
    at e (RNDebuggerWorker.js:1)

I'm using react-native-idnow version 0.0.4

any help will be greatly appreciated

Package doesn't seem to be pulished on npm

In contrast to the readme the package doesn't seem to be published on npm:

$ npm install react-native-idnow --save
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/react-native-idnow - Not found
npm ERR! 404
npm ERR! 404  'react-native-idnow@latest' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

Thanks for open sourcing this bridge!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.