Skip to content

Commit

Permalink
Release 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Braden Hancock committed Dec 1, 2023
1 parent 50136ce commit c00c43f
Show file tree
Hide file tree
Showing 110 changed files with 7,244 additions and 9,320 deletions.
File renamed without changes.
37 changes: 28 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@
#
.DS_Store

# node.js
#
node_modules/
npm-debug.log
yarn-error.log

# Xcode
#
build/
Expand All @@ -26,7 +20,6 @@ DerivedData
*.hmap
*.ipa
*.xcuserstate
project.xcworkspace

# Android/IntelliJ
#
Expand All @@ -35,11 +28,37 @@ build/
.gradle
local.properties
*.iml
*.hprof

# node.js
#
node_modules/
npm-debug.log
yarn-error.log

# BUCK
buck-out/
\.buckd/
*.keystore
!debug.keystore

# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/

*/fastlane/report.xml
*/fastlane/Preview.html
*/fastlane/screenshots

# Bundle artifact
*.jsbundle

# Ruby / CocoaPods
/ios/Pods/
/vendor/bundle/

# VSCode
.vscode/.react
# API Client credetials
credentials.js
12 changes: 0 additions & 12 deletions .prettierignore

This file was deleted.

6 changes: 0 additions & 6 deletions .prettierrc.js

This file was deleted.

38 changes: 0 additions & 38 deletions .vscode/launch.json

This file was deleted.

3 changes: 0 additions & 3 deletions .vscode/settings.json

This file was deleted.

File renamed without changes.
File renamed without changes.
9 changes: 6 additions & 3 deletions example/App.js β†’ App.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import {
View,
Button,
Alert,
SafeAreaView
SafeAreaView,
NativeEventEmitter
} from 'react-native'
import IProov from 'iproov-react-native'
import IProov from '@iproov/react-native'
import ApiClient, {
CLAIM_TYPE_ENROL,
ASSURANCE_TYPE_GENUINE_PRESENCE
Expand Down Expand Up @@ -43,7 +44,9 @@ export default class App extends Component {
var options = new IProov.Options()
options.enableScreenshots = true

IProov.launch('wss://' + config.baseUrl + '/ws', body.token, options, (event) => {
const eventEmitter = new NativeEventEmitter(IProov.IProovReactNative)

IProov.launch('wss://' + config.baseUrl + '/ws', body.token, options, eventEmitter, (event) => {
switch (event.name) {
case IProov.EVENT_CONNECTING:
RNProgressHud.showWithStatus('Connecting')
Expand Down
5 changes: 5 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
source 'https://rubygems.org'
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby ">= 3.2.0"
gem 'cocoapods', '~> 1.13'
gem 'activesupport', '~> 7.0', '<= 7.0.8'
99 changes: 99 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.6)
rexml
activesupport (7.0.8)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
addressable (2.8.5)
public_suffix (>= 2.0.2, < 6.0)
algoliasearch (1.27.5)
httpclient (~> 2.8, >= 2.8.3)
json (>= 1.5.1)
atomos (0.1.3)
claide (1.1.0)
cocoapods (1.13.0)
addressable (~> 2.8)
claide (>= 1.0.2, < 2.0)
cocoapods-core (= 1.13.0)
cocoapods-deintegrate (>= 1.0.3, < 2.0)
cocoapods-downloader (>= 1.6.0, < 2.0)
cocoapods-plugins (>= 1.0.0, < 2.0)
cocoapods-search (>= 1.0.0, < 2.0)
cocoapods-trunk (>= 1.6.0, < 2.0)
cocoapods-try (>= 1.1.0, < 2.0)
colored2 (~> 3.1)
escape (~> 0.0.4)
fourflusher (>= 2.3.0, < 3.0)
gh_inspector (~> 1.0)
molinillo (~> 0.8.0)
nap (~> 1.0)
ruby-macho (>= 2.3.0, < 3.0)
xcodeproj (>= 1.23.0, < 2.0)
cocoapods-core (1.13.0)
activesupport (>= 5.0, < 8)
addressable (~> 2.8)
algoliasearch (~> 1.0)
concurrent-ruby (~> 1.1)
fuzzy_match (~> 2.0.4)
nap (~> 1.0)
netrc (~> 0.11)
public_suffix (~> 4.0)
typhoeus (~> 1.0)
cocoapods-deintegrate (1.0.5)
cocoapods-downloader (1.6.3)
cocoapods-plugins (1.0.0)
nap
cocoapods-search (1.0.1)
cocoapods-trunk (1.6.0)
nap (>= 0.8, < 2.0)
netrc (~> 0.11)
cocoapods-try (1.2.0)
colored2 (3.1.2)
concurrent-ruby (1.2.2)
escape (0.0.4)
ethon (0.16.0)
ffi (>= 1.15.0)
ffi (1.16.3)
fourflusher (2.3.1)
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
httpclient (2.8.3)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
json (2.6.3)
minitest (5.20.0)
molinillo (0.8.0)
nanaimo (0.3.0)
nap (1.1.0)
netrc (0.11.0)
public_suffix (4.0.7)
rexml (3.2.5)
ruby-macho (2.5.1)
typhoeus (1.4.0)
ethon (>= 0.9.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
xcodeproj (1.23.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.3.0)
rexml (~> 3.2.4)

PLATFORMS
arm64-darwin-22

DEPENDENCIES
activesupport (~> 7.0, <= 7.0.8)
cocoapods (~> 1.13)

RUBY VERSION
ruby 3.2.1p31

BUNDLED WITH
2.4.13
62 changes: 19 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
![iProov: Flexible authentication for identity assurance](https://github.com/iProov/react-native/raw/main/images/banner.jpg)
# iProov Biometrics React Native SDK (Preview)
# iProov Biometrics React Native SDK

## Table of contents

Expand All @@ -18,20 +18,12 @@
## Introduction
The iProov Biometrics React Native SDK wraps iProov's native iOS (Swift) and Android (Java) SDKs behind a JavaScript interface for use from within your React Native iOS or Android app.

> ⚠️ **IMPORTANT:** The iProov Biometrics React Native SDK is currently in preview, which means that there may be missing/broken functionality, and the API is still subject to change. Please contact us to provide your feedback regarding the iProov Biometrics React Native SDK Preview.
### Requirements

- React Native 0.60 and above
- iOS 12 and above
- React Native 0.72 and above
- iOS 12.4 and above
- Android API Level 21 (Android 5 Lollipop) and above

## Repository contents
- **src** - contains the React Native bindings for the SDK
- **android** - contains the Android-specific bindings
- **ios** - contains the iOS-specific bindings
- **example** - a basic React Native example app

## Registration

You can obtain API credentials by registering on the [iProov Partner Portal](https://portal.iproov.net).
Expand All @@ -42,7 +34,7 @@ You can obtain API credentials by registering on the [iProov Partner Portal](htt

```json
"dependencies": {
"iproov-react-native": "git+ssh://[email protected]:iProov/react-native.git#0.3.0"
"@iproov/react-native": "1.0.0"
}
```

Expand All @@ -56,33 +48,14 @@ You can obtain API credentials by registering on the [iProov Partner Portal](htt

1. Add an `NSCameraUsageDescription` entry to your app's Info.plist, with the reason why your app requires camera access (e.g. β€œTo iProov you in order to verify your identity.”)

2. You need to make various modifications to your Podfile to support iProov:

1. **Enable frameworks** - Cocoapods by default builds static libraries rather than frameworks. You should add the following to your Podfile:
2. You need to **Enable frameworks** - Cocoapods by default builds static libraries rather than frameworks. You should add the following to your Podfile:

```ruby
use_frameworks!
```
Please note that [Flipper](https://fbflipper.com/docs/getting-started/react-native/) does not work with `use_frameworks`, so you should remove `use_flipper()` if you have it enabled.
```ruby
use_frameworks!
```
Please note that [Flipper](https://fbflipper.com/docs/getting-started/react-native/) does not work with `use_frameworks`, so you should remove it if you have it enabled.

2. **Ensure React Native builds static frameworks, except for iProov** - Since `use_frameworks!` will now build everything as frameworks, you now need to explicitly set everything to build as static frameworks except for iProov and its dependencies which are dynamic, so you must add this `pre_install` step (or add it to your existing `pre_install` step if you have one already):
```ruby
pre_install do |installer|
installer.pod_targets.each do |pod|
if !['iProov'].include?(pod.name)
def pod.static_framework?;
true
end
def pod.build_type;
Pod::BuildType.static_library
end
end
end
end
```
2. In your React Native app `ios` directory, run:
3. In your React Native app `ios` directory, run:

```sh
pod install
Expand All @@ -107,7 +80,8 @@ allprojects {
Once you have a valid token (obtained via the React Native API client or your own backend-to-backend call), you can `launch()` an iProov capture and handle the callback events as follows:

```javascript
import IProov from 'iproov-react-native'
import IProov from '@iproov/react-native'
import NativeEventEmitter from 'react-native'

let options = new IProov.Options()
options.filter = {
Expand All @@ -117,7 +91,9 @@ options.filter = {
backgroundColor: '#32a852'
}

IProov.launch('wss://eu.rp.secure.iproov.me/ws', "< YOUR TOKEN >", options, (event) => {
const eventEmitter = new NativeEventEmitter(IProov.IProovReactNative)

IProov.launch('wss://eu.rp.secure.iproov.me/ws', "< YOUR TOKEN >", options, eventEmitter, (event) => {
switch(event.name) {

case IProov.EVENT_CONNECTING:
Expand Down Expand Up @@ -174,7 +150,7 @@ IProov.launch('wss://eu.rp.secure.iproov.me/ws', "< YOUR TOKEN >", options, (eve
})
```

πŸ‘‰ You should now familiarise yourself with the following resources:
πŸ‘‰ You should now familiarize yourself with the following resources:

- [iProov Biometrics iOS SDK documentation](https://github.com/iProov/ios)
- [iProov Biometrics Android SDK documentation](https://github.com/iProov/android)
Expand Down Expand Up @@ -292,7 +268,7 @@ String localization is handled by adding translations to both native components,

The React Native API Client provides a convenient wrapper to call iProov's REST API v2 from a React Native app. It is a useful tool to assist with testing, debugging and demos, but should not be used in production mobile apps.

The React Native API client can be found in `ApiClient.js` in the example project.
The React Native API client can be found in `ApiClient.js`.

To setup your credentials, copy `credentials.example.js` to `credentials.js` and add them to the example project.

Expand Down Expand Up @@ -332,9 +308,9 @@ You can then launch the iProov SDK with this token.

For a simple iProov experience that is ready to run out-of-the-box, check out the React Native example project which also makes use of the React Native API Client.

In the example app folder, copy the `credentials.example.js` file to `credentials.js` and add your credentials obtained from the [iProov portal](https://portal.iproov.com/).
Copy the `credentials.example.js` file to `credentials.js` and add your credentials obtained from the [iProov portal](https://portal.iproov.com/).

Once you have completed the [installation](#installation) instructions, to run the example app, you should run the following commands from the example project directory:
Once you have completed the [installation](#installation) instructions, to run the example app, you should run the following commands:

```sh
npx react-native run-android # Run on Android
Expand Down
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit c00c43f

Please sign in to comment.