Skip to content

Commit 20a60f9

Browse files
committed
Release 3.0.0
1 parent 2c10cb6 commit 20a60f9

3 files changed

Lines changed: 36 additions & 11 deletions

File tree

App.js

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ import {
1111
import IProov from '@iproov/react-native'
1212
import ApiClient, {
1313
CLAIM_TYPE_ENROL,
14-
ASSURANCE_TYPE_GENUINE_PRESENCE
14+
ASSURANCE_TYPE_GENUINE_PRESENCE,
15+
ASSURANCE_TYPE_LIVENESS
1516
} from './ApiClient.js'
1617
import uuid from 'react-native-uuid'
1718
import RNProgressHud from 'progress-hud'
@@ -27,7 +28,7 @@ export default class App extends Component {
2728
launchIProov = async () => {
2829
RNProgressHud.showWithStatus('Getting token')
2930
const response = await this.apiClient.getToken(
30-
ASSURANCE_TYPE_GENUINE_PRESENCE,
31+
ASSURANCE_TYPE_LIVENESS,
3132
CLAIM_TYPE_ENROL,
3233
uuid.v4()
3334
)
@@ -68,7 +69,23 @@ export default class App extends Component {
6869
break
6970

7071
case IProov.EVENT_FAILURE:
71-
RNProgressHud.showErrorWithStatus('Failed: ' + event.params.reason)
72+
// Log all reasons with their feedback codes
73+
if (event.params.reasons && Array.isArray(event.params.reasons)) {
74+
console.log('Failure reasons:')
75+
event.params.reasons.forEach((reasonObj, index) => {
76+
console.log(` ${index + 1}. Feedback Code: ${reasonObj.feedbackCode}, Reason: ${reasonObj.description}`)
77+
})
78+
79+
// Show first reason or summary
80+
const firstReason = event.params.reasons[0]
81+
const message = event.params.reasons.length > 1
82+
? `Failed: ${firstReason.description} (+ ${event.params.reasons.length - 1} more)`
83+
: `Failed: ${firstReason.description}`
84+
85+
RNProgressHud.showErrorWithStatus(message)
86+
} else {
87+
RNProgressHud.showErrorWithStatus('Failed: Unknown error')
88+
}
7289
break
7390

7491
case IProov.EVENT_SUCCESS:

README.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ The iProov Biometrics React Native SDK wraps iProov's native iOS (Swift) and And
2121
### Requirements
2222

2323
- React Native 0.73 and above
24-
- iOS 13.0 and above
24+
- iOS 15.0 and above
2525
- Android API Level 26 (Android 8 Oreo) and above
2626

2727
## Registration
@@ -34,7 +34,7 @@ You can obtain API credentials by registering on the [iProov Partner Portal](htt
3434

3535
```json
3636
"dependencies": {
37-
"@iproov/react-native": "2.1.0"
37+
"@iproov/react-native": "3.0.0"
3838
}
3939
```
4040

@@ -125,10 +125,19 @@ IProov.launch('wss://eu.rp.secure.iproov.me/ws', "< YOUR TOKEN >", options, even
125125

126126
case IProov.EVENT_FAILURE:
127127
// The user was not successfully verified/enrolled, as their identity could not be verified,
128-
// or there was another issue with their verification/enrollment. A reason (as a string)
129-
// is provided as to why the claim failed, along with a feedback code from the back-end.
130-
131-
let reason = event.params.reason
128+
// or there was another issue with their verification/enrollment. Reasons are provided
129+
// as to why the claim failed, each one having a feedback code and description from the back-end.
130+
131+
let failureReasons = event.params.reasons
132+
133+
let feedbackCodes = failureReasons.map(reason => {
134+
return reason.feedbackCode;
135+
});
136+
137+
let descriptions = failureReasons.map(reason => {
138+
return reason.description;
139+
});
140+
132141
let frame = event.params.frame // Optional property containing a single Base64 encoded frame
133142
break
134143

@@ -185,7 +194,6 @@ A summary of the support for the various SDK options in React Native is provided
185194
| `timeout` | `Number` (int) |||
186195
| `enableScreenshots` | `Boolean` | ||
187196
| `orientation` | `Options.(PORTRAIT\|LANDSCAPE\|REVERSE_PORTRAIT\|REVERSE_LANDSCAPE)`| ||
188-
| `camera` | `Options.(FRONT\|EXTERNAL)` | ||
189197
| `headerBackgroundColor` | `String` (#rgba) |||
190198
| `disableExteriorEffects` | `Boolean` |||
191199
| **`Options.genuinePresenceAssurance.`** | | | |

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"lint": "eslint ."
1111
},
1212
"dependencies": {
13-
"@iproov/react-native": "2.1.0",
13+
"@iproov/react-native": "3.0.0",
1414
"progress-hud": "1.3.2",
1515
"react": "18.2.0",
1616
"react-native": "0.73.0",

0 commit comments

Comments
 (0)