forked from Expensify/App
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path@onfido+react-native-sdk+10.6.0.patch
1320 lines (1240 loc) · 53.9 KB
/
@onfido+react-native-sdk+10.6.0.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
diff --git a/node_modules/@onfido/react-native-sdk/.yarnrc b/node_modules/@onfido/react-native-sdk/.yarnrc
new file mode 100644
index 0000000..08b5d85
--- /dev/null
+++ b/node_modules/@onfido/react-native-sdk/.yarnrc
@@ -0,0 +1 @@
+registry "https://registry.npmjs.org"
\ No newline at end of file
diff --git a/node_modules/@onfido/react-native-sdk/CHANGELOG.md b/node_modules/@onfido/react-native-sdk/CHANGELOG.md
index 6491cb5..398e154 100644
--- a/node_modules/@onfido/react-native-sdk/CHANGELOG.md
+++ b/node_modules/@onfido/react-native-sdk/CHANGELOG.md
@@ -5,6 +5,20 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
+## [10.7.0] - 2024-02-01
+
+### Changed:
+
+- Updated underlying Onfido native SDK version:
+ - iOS 29.7.x (up from 29.6.x)
+ - Android 19.6.x (up from 19.5.x)
+
+### Fixed:
+
+- Fixed the behaviour when using the configuration option `allowedDocumentTypes`:
+ - The order of steps (and SDK screens) has now been aligned with the native SDKs, for both Android and iOS. The order to be used is: Welcome - Document capture - Proof of address - Face capture - Final screen.
+ - The Welcome screen now correctly takes into account the `welcome` (boolean) flag in the configuration.
+
## [10.6.0] - 2023-12-11
### Changed:
diff --git a/node_modules/@onfido/react-native-sdk/README.md b/node_modules/@onfido/react-native-sdk/README.md
index 03fb8da..0159a6f 100644
--- a/node_modules/@onfido/react-native-sdk/README.md
+++ b/node_modules/@onfido/react-native-sdk/README.md
@@ -30,9 +30,7 @@
- [Introduction](#introduction)
- [Implementation](#implementation)
- [User data](#user-data)
-- [Creating checks](#creating-checks)
- - [1. Obtaining an API token](#1-obtaining-an-api-token-1)
- - [2. Creating a check](#2-creating-a-check)
+- [Generating verification reports](#generating-verification-reports)
- [Theme Customization](#theme-customization)
- [Android](#android-1)
- [iOS](#ios-1)
@@ -57,7 +55,7 @@ This SDK provides a drop-in set of screens and tools for react native applicatio
>
> If you are integrating using Onfido Studio please see our [Studio integration guide](ONFIDO_STUDIO.md)
-\* **Note**: the SDK is only responsible for capturing and uploading photos/videos. You still need to access the [Onfido API](https://documentation.onfido.com/) to create and manage checks.
+\* **Note**: The SDK is only responsible for capturing and uploading document photos, live selfies, live videos and motion captures. You still need to access the [Onfido API](https://documentation.onfido.com/) to manage applicants and [Onfido Studio](https://developers.onfido.com/guide/onfido-studio-product) to build verification workflows.
* Supports iOS 11+
* Supports Xcode 13+
@@ -600,34 +598,17 @@ let byteArrayString = mediaResult.fileData;
let base64FileData = Onfido.byteArrayStringToBase64(byteArrayString);
```
-## Creating checks
+## Generating verification reports
-As the SDK is only responsible for capturing and uploading photos/videos, you would need to start a check on your backend server using the [Onfido API](https://documentation.onfido.com/).
+While the SDK is responsible for capturing and uploading document photos, live selfies, live videos and motion captures, identity verification reports themselves are generated based on workflows created using [Onfido Studio](https://developers.onfido.com/guide/onfido-studio-product).
-### 1. Obtaining an API token
-
-All API requests must be made with an API token included in the request headers. You can find your API token (not to be mistaken with the mobile SDK token) inside your [Onfido Dashboard](https://onfido.com/dashboard/api/tokens).
-
-Refer to the [Authentication](https://documentation.onfido.com/#authentication) section in the API documentation for details. For testing, you should be using the sandbox, and not the live, token.
-
-### 2. Creating a check
-
-You will need to create a check by making a request to the [create check endpoint](https://documentation.onfido.com/#create-check), using the applicant id. If you are just verifying a document, you only have to include a [document report](https://documentation.onfido.com/#document-report) as part of the check. On the other hand, if you are verifying a document and a face photo/live video, you will also have to include a [facial similarity report](https://documentation.onfido.com/#facial-similarity-report) with the corresponding values: `facial_similarity_photo` for the photo option and `facial_similarity_video` for the video option.
-
-```shell
-$ curl https://api.onfido.com/v3/checks \
- -H 'Authorization: Token token=YOUR_API_TOKEN' \
- -d 'applicant_id=YOUR_APPLICANT_ID' \
- -d 'report_names=[document,facial_similarity_photo]'
-```
-
-**Note**: You can also submit the POST request in JSON format.
+For a step-by-step walkthrough of creating an identity verification using Onfido Studio and our SDKs, please refer to our [Quick Start Guide](https://developers.onfido.com/guide/quick-start-guide).
-You will receive a response containing the check id instantly. As document and facial similarity reports do not always return actual [results](https://documentation.onfido.com/#results) straightaway, you need to set up a webhook to get notified when the results are ready.
+Alternatively, you can [create checks](https://documentation.onfido.com/#create-check) and [retrieve report results](https://documentation.onfido.com/#retrieve-report) manually using the Onfido API. You can also configure [webhooks](https://documentation.onfido.com/#webhooks) to be notified asynchronously of report results.
-Finally, as you are testing with the sandbox token, please be aware that the results are pre-determined. You can learn more about sandbox responses [here](https://documentation.onfido.com/#pre-determined-responses).
+**Note**: If you're using API v2 for API calls, please check out [API v2 to v3 migration guide](https://developers.onfido.com/guide/v2-to-v3-migration-guide#checks-in-api-v3) to understand which changes need to be applied before starting to use API v3.
-**Note**: If you're using API v2, please check out [API v2 to v3 migration guide](https://developers.onfido.com/guide/v2-to-v3-migration-guide#checks-in-api-v3) to understand which changes need to be applied before starting to use API v3.
+**Note**: If you are testing with a sandbox token, please be aware that report results are pre-determined. You can learn more about sandbox responses [here](https://documentation.onfido.com/#pre-determined-responses).
## Theme Customization
diff --git a/node_modules/@onfido/react-native-sdk/android/.project b/node_modules/@onfido/react-native-sdk/android/.project
deleted file mode 100644
index 357b6fc..0000000
--- a/node_modules/@onfido/react-native-sdk/android/.project
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>android</name>
- <comment>Project android created by Buildship.</comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.buildship.core.gradleprojectbuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.buildship.core.gradleprojectnature</nature>
- </natures>
- <filteredResources>
- <filter>
- <id>1684767677408</id>
- <name></name>
- <type>30</type>
- <matcher>
- <id>org.eclipse.core.resources.regexFilterMatcher</id>
- <arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
- </matcher>
- </filter>
- </filteredResources>
-</projectDescription>
diff --git a/node_modules/@onfido/react-native-sdk/android/bin/README.md b/node_modules/@onfido/react-native-sdk/android/bin/README.md
deleted file mode 100644
index 6746135..0000000
--- a/node_modules/@onfido/react-native-sdk/android/bin/README.md
+++ /dev/null
@@ -1,33 +0,0 @@
-README
-======
-
-If you want to publish the lib as a maven dependency, follow these steps before publishing a new version to npm:
-
-1. Be sure to have the Android [SDK](https://developer.android.com/studio/index.html) and [NDK](https://developer.android.com/ndk/guides/index.html) installed
-2. Be sure to have a `local.properties` file in this folder that points to the Android SDK and NDK
-```
-ndk.dir=/Users/{username}/Library/Android/sdk/ndk-bundle
-sdk.dir=/Users/{username}/Library/Android/sdk
-```
-3. Run `./gradlew publishToMavenLocal`
-4. Go to the `~/.m2` directory. Verify that the pom file was generated successfully with the correct version.
-
-
-How to quickly develop the Android Java code using the TestApp:
-======
-React Native's "Fast Refresh" feature will not update Java code as you make changes, and reinstalling all npm packages is slow. Instead, you can follow this process to recompile only the Java code when you make changes.
-
-In one console, from the `TestApp/` directory, run the following commands. It may take 2 or more minutes to build. You only need to run this once: leave it running in the background while you develop.
-```shell
-rm -rf node_modules/ && yarn && cd .. && watchman watch-del-all && npx react-native start --reset-cache
-```
-
-In a second console, from the `TestApp/` directory, update the Android package and launch the virtual device. Run this each time you change Android code.
-```shell
-rsync -av ../ node_modules/@onfido/react-native-sdk/ --exclude=TestApp --exclude=SampleApp --exclude=node_modules --exclude=android/build --exclude=.git && npx react-native run-android
-```
-
-How to run the tests
-======
-1. Run "yarn" or "npm install" from the project root. This will download the React Native Facebook bridge library
-2. Run "./gradlew test" from the "/android" directory.
diff --git a/node_modules/@onfido/react-native-sdk/android/bin/build.gradle b/node_modules/@onfido/react-native-sdk/android/bin/build.gradle
deleted file mode 100644
index d2810b6..0000000
--- a/node_modules/@onfido/react-native-sdk/android/bin/build.gradle
+++ /dev/null
@@ -1,154 +0,0 @@
-// android/build.gradle
-
-// based on:
-//
-// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/build.gradle
-// original location:
-// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/build.gradle
-//
-// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/app/build.gradle
-// original location:
-// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/app/build.gradle
-
-def DEFAULT_COMPILE_SDK_VERSION = 32
-def DEFAULT_MIN_SDK_VERSION = 21
-def DEFAULT_TARGET_SDK_VERSION = 31
-def NATIVE_ANDROID_SDK_VERSION = "16.3.+"
-
-def safeExtGet(prop, fallback) {
- rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
-}
-
-def androidExclusion = [
- '**/databinding/**/*.*',
- '**/android/databinding/*Binding.*',
- '**/BR.*',
- '**/R.*',
- '**/R$*.*',
- '**/BuildConfig.*',
- '**/Manifest*.*',
- '**/*_MembersInjector.*',
- '**/Dagger*Component.*',
- '**/Dagger*Component$Builder.*',
- '**/*Module_*Factory.*',
- '**/*Fragment*.*',
- '**/*Activity*.*',
- '**/*Adapter*.*',
- '**/*ViewPager*.*',
- '**/*ViewHolder*.*',
- '**/*Module*.*'
-]
-
-buildscript {
- // The Android Gradle plugin is only required when opening the android folder stand-alone.
- // This avoids unnecessary downloads and potential conflicts when the library is included as a
- // module dependency in an application project.
- // ref: https://docs.gradle.org/current/userguide/tutorial_using_tasks.html#sec:build_script_external_dependencies
- if (project == rootProject) {
- repositories {
- mavenCentral()
- google()
- jcenter()
- }
- dependencies {
- classpath 'com.android.tools.build:gradle:7.4.2'
- }
- }
-}
-
-apply plugin: 'com.android.library'
-apply plugin: 'maven-publish'
-apply plugin: 'jacoco'
-
-apply from: 'publish.gradle'
-
-android {
- compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION)
- defaultConfig {
- minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION)
- targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION)
- versionCode 1
- versionName "1.0"
- multiDexEnabled true
- consumerProguardFiles 'proguard-rules.pro'
- }
- lintOptions {
- abortOnError false
- }
-
- buildFeatures {
- buildConfig = false
- }
-
- compileOptions {
- sourceCompatibility JavaVersion.VERSION_1_8
- targetCompatibility JavaVersion.VERSION_1_8
- }
-}
-
-repositories {
- // ref: https://www.baeldung.com/maven-local-repository
- mavenLocal()
- mavenCentral()
- maven {
- // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
- url "$rootDir/../node_modules/react-native/android"
- }
- maven {
- // Android JSC is installed from npm
- url "$rootDir/../node_modules/jsc-android/dist"
- }
- google()
- jcenter()
-}
-
-dependencies {
- //noinspection GradleDynamicVersion
- implementation 'com.facebook.react:react-native:+' // From node_modules
- implementation "com.onfido.sdk.capture:onfido-capture-sdk:$NATIVE_ANDROID_SDK_VERSION"
- implementation "com.onfido.sdk:onfido-workflow:$NATIVE_ANDROID_SDK_VERSION"
- implementation "com.squareup.okhttp3:logging-interceptor:3.14.9"
- implementation "com.squareup.okhttp3:okhttp:3.14.9"
- // Fix for crash due to 'java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/swiperefreshlayout/widget/SwipeRefreshLayout;''
- implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
-
- testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.1'
- testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.1'
- testCompileOnly 'junit:junit:4.13.2'
- testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.10.1'
- testImplementation 'org.mockito:mockito-core:2.+'
- testImplementation group: 'org.powermock', name: 'powermock-api-mockito2', version: '2.0.9'
- testImplementation group: 'org.powermock', name: 'powermock-module-junit4', version: '2.0.9'
-}
-
-afterEvaluate { project ->
- android.libraryVariants.all { variant ->
- def name = variant.name.capitalize()
- def javaCompileTask = variant.javaCompileProvider.get()
-
- task "jar${name}"(type: Jar, dependsOn: javaCompileTask) {
- from javaCompileTask.destinationDir
- }
- }
-
- task codeCoverageReport(type: JacocoReport, dependsOn: 'testDebugUnitTest') {
- group = "Reporting"
- description = "Generate Jacoco coverage reports after running tests."
- reports {
- xml.enabled = true
- html.enabled = true
- csv.enabled = true
- }
- classDirectories.setFrom(fileTree(
- dir: 'build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/onfido/reactnative/sdk',
- excludes: androidExclusion
- ))
- sourceDirectories.setFrom(files('src/main/java/com/onfido/reactnative/sdk'))
- executionData.setFrom(files('build/jacoco/testDebugUnitTest.exec'))
- }
-
- task getCoverage(type: Exec, dependsOn: 'codeCoverageReport') {
- group = "Reporting"
- commandLine "open", "$buildDir/reports/jacoco/codeCoverageReport/html/index.html"
- }
-}
diff --git a/node_modules/@onfido/react-native-sdk/android/build.gradle b/node_modules/@onfido/react-native-sdk/android/build.gradle
index 33a4229..895bfd7 100644
--- a/node_modules/@onfido/react-native-sdk/android/build.gradle
+++ b/node_modules/@onfido/react-native-sdk/android/build.gradle
@@ -13,12 +13,20 @@
def DEFAULT_COMPILE_SDK_VERSION = 33
def DEFAULT_MIN_SDK_VERSION = 21
def DEFAULT_TARGET_SDK_VERSION = 31
-def NATIVE_ANDROID_SDK_VERSION = "19.5.+"
+def NATIVE_ANDROID_SDK_VERSION = "19.6.+"
def safeExtGet(prop, fallback) {
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}
+def isNewArchitectureEnabled() {
+ // To opt-in for the New Architecture, you can either:
+ // - Set `newArchEnabled` to true inside the `gradle.properties` file
+ // - Invoke gradle with `-newArchEnabled=true`
+ // - Set an environment variable `ORG_GRADLE_PROJECT_newArchEnabled=true`
+ return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true"
+}
+
def androidExclusion = [
'**/databinding/**/*.*',
'**/android/databinding/*Binding.*',
@@ -60,10 +68,24 @@ apply plugin: 'com.android.library'
apply plugin: 'maven-publish'
apply plugin: 'jacoco'
+if (isNewArchitectureEnabled()) {
+ apply plugin: "com.facebook.react"
+}
+
apply from: 'publish.gradle'
android {
compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION)
+
+ // Used to override the NDK path/version on internal CI or by allowing
+ // users to customize the NDK path/version from their root project (e.g. for M1 support)
+ if (rootProject.hasProperty("ndkPath")) {
+ ndkPath rootProject.ext.ndkPath
+ }
+ if (rootProject.hasProperty("ndkVersion")) {
+ ndkVersion rootProject.ext.ndkVersion
+ }
+
defaultConfig {
minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION)
targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION)
@@ -84,6 +106,20 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
+
+ sourceSets.main {
+ java {
+ if (!isNewArchitectureEnabled()) {
+ srcDirs += 'src/paper/java'
+ }
+ }
+ }
+ publishing {
+ singleVariant('release') {
+ withSourcesJar()
+ withJavadocJar()
+ }
+ }
}
repositories {
@@ -103,8 +139,8 @@ repositories {
}
dependencies {
- //noinspection GradleDynamicVersion
- implementation 'com.facebook.react:react-native:+' // From node_modules
+ implementation 'com.facebook.react:react-native:+' // from node_modules
+
implementation "com.onfido.sdk.capture:onfido-capture-sdk:$NATIVE_ANDROID_SDK_VERSION"
implementation "com.onfido.sdk:onfido-workflow:$NATIVE_ANDROID_SDK_VERSION"
implementation "com.squareup.okhttp3:logging-interceptor:3.14.9"
diff --git a/node_modules/@onfido/react-native-sdk/android/src/main/AndroidManifest.xml b/node_modules/@onfido/react-native-sdk/android/src/main/AndroidManifest.xml
index 42ad0ca..903b090 100644
--- a/node_modules/@onfido/react-native-sdk/android/src/main/AndroidManifest.xml
+++ b/node_modules/@onfido/react-native-sdk/android/src/main/AndroidManifest.xml
@@ -8,6 +8,6 @@
<meta-data
android:name="onfido_integration_version"
- android:value="10.6.0" />
+ android:value="10.7.0" />
</application>
</manifest>
diff --git a/node_modules/@onfido/react-native-sdk/android/src/main/java/com/onfido/reactnative/sdk/OnfidoSdkModule.java b/node_modules/@onfido/react-native-sdk/android/src/main/java/com/onfido/reactnative/sdk/OnfidoSdkModule.java
index 93407a2..13f84fd 100644
--- a/node_modules/@onfido/react-native-sdk/android/src/main/java/com/onfido/reactnative/sdk/OnfidoSdkModule.java
+++ b/node_modules/@onfido/react-native-sdk/android/src/main/java/com/onfido/reactnative/sdk/OnfidoSdkModule.java
@@ -3,14 +3,13 @@ package com.onfido.reactnative.sdk;
import android.annotation.SuppressLint;
import android.app.Activity;
-import com.facebook.react.bridge.NoSuchKeyException;
import com.facebook.react.bridge.Promise;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap;
-import com.facebook.react.bridge.UnexpectedNativeTypeException;
+import com.facebook.react.module.annotations.ReactModule;
import com.facebook.react.bridge.WritableMap;
import com.facebook.react.modules.core.DeviceEventManagerModule;
import com.onfido.android.sdk.capture.DocumentType;
@@ -23,7 +22,6 @@ import com.onfido.android.sdk.capture.errors.EnterpriseFeatureNotEnabledExceptio
import com.onfido.android.sdk.capture.errors.EnterpriseFeaturesInvalidLogoCobrandingException;
import com.onfido.android.sdk.capture.ui.camera.face.FaceCaptureStep;
import com.onfido.android.sdk.capture.ui.camera.face.FaceCaptureVariantPhoto;
-import com.onfido.android.sdk.capture.ui.camera.face.FaceCaptureVariantVideo;
import com.onfido.android.sdk.capture.ui.camera.face.stepbuilder.FaceCaptureStepBuilder;
import com.onfido.android.sdk.capture.ui.camera.face.stepbuilder.PhotoCaptureStepBuilder;
import com.onfido.android.sdk.capture.ui.camera.face.stepbuilder.VideoCaptureStepBuilder;
@@ -43,7 +41,10 @@ enum CallbackType {
MEDIA
}
-public class OnfidoSdkModule extends ReactContextBaseJavaModule {
+@ReactModule(name = OnfidoSdkModule.NAME)
+public class OnfidoSdkModule extends NativeOnfidoModuleSpec {
+
+ public static final String NAME = "RNOnfidoSdk";
/* package */ final Onfido client;
private Promise currentPromise = null;
@@ -70,7 +71,7 @@ public class OnfidoSdkModule extends ReactContextBaseJavaModule {
@Override
public String getName() {
- return "OnfidoSdk";
+ return NAME;
}
/**
@@ -81,6 +82,7 @@ public class OnfidoSdkModule extends ReactContextBaseJavaModule {
}
@ReactMethod
+ @Override
public void start(final ReadableMap config, final Promise promise) {
setPromise(promise);
@@ -147,7 +149,7 @@ public class OnfidoSdkModule extends ReactContextBaseJavaModule {
}
OnfidoTheme onfidoTheme = getThemeFromConfig(config);
- if(onfidoTheme != null){
+ if (onfidoTheme != null) {
onfidoConfigBuilder.withTheme(onfidoTheme);
}
@@ -184,7 +186,7 @@ public class OnfidoSdkModule extends ReactContextBaseJavaModule {
}
OnfidoTheme onfidoTheme = getThemeFromConfig(config);
- if(onfidoTheme != null){
+ if (onfidoTheme != null) {
onfidoConfigBuilder.withTheme(onfidoTheme);
}
@@ -237,9 +239,9 @@ public class OnfidoSdkModule extends ReactContextBaseJavaModule {
return config.hasKey(key) ? config.getString(key) : "";
}
- public static OnfidoTheme getThemeFromConfig(final ReadableMap config) throws Exception{
+ public static OnfidoTheme getThemeFromConfig(final ReadableMap config) throws Exception {
String themeString = config.getString("theme");
- if(themeString == null){
+ if (themeString == null) {
return null;
}
OnfidoTheme onfidoTheme;
@@ -252,12 +254,18 @@ public class OnfidoSdkModule extends ReactContextBaseJavaModule {
return onfidoTheme;
}
+ /*
+ (!) Please note that flow steps must be presented in a specific order, one which is also
+ implemented in the native SDKs, as well as in the iOS RN SDK.
+
+ As per the Product indications in https://onfido.atlassian.net/browse/SDK-2390, this order
+ should be: Welcome->Doc->POA->Bio
+ */
public static FlowStep[] getFlowStepsFromConfig(
final ReadableMap config,
OnfidoConfig.Builder configBuilder
) throws Exception {
try {
-
final ReadableMap flowSteps = config.getMap("flowSteps");
final boolean welcomePageIsIncluded;
@@ -268,11 +276,12 @@ public class OnfidoSdkModule extends ReactContextBaseJavaModule {
}
final boolean proofOfAddress;
- if(flowSteps.hasKey("proofOfAddress")){
+ if (flowSteps.hasKey("proofOfAddress")) {
proofOfAddress = flowSteps.getBoolean("proofOfAddress");
- }else{
+ } else {
proofOfAddress = false;
}
+
final List<FlowStep> flowStepList = new ArrayList<>();
if (welcomePageIsIncluded) {
@@ -283,6 +292,10 @@ public class OnfidoSdkModule extends ReactContextBaseJavaModule {
extractCaptureDocumentStep(flowSteps, flowStepList, configBuilder);
}
+ if (proofOfAddress) {
+ flowStepList.add(FlowStep.PROOF_OF_ADDRESS);
+ }
+
final boolean captureFaceEnabled = flowSteps.hasKey("captureFace");
final ReadableMap captureFace = captureFaceEnabled ? flowSteps.getMap("captureFace") : null;
@@ -301,7 +314,7 @@ public class OnfidoSdkModule extends ReactContextBaseJavaModule {
flowStepList.add(faceStepFromMotionDefinition(captureFace));
break;
default:
- throw new Exception("Invalid face capture type. \"type\" must be VIDEO or PHOTO.");
+ throw new Exception("Invalid face capture type. \"type\" must be VIDEO or PHOTO.");
}
} else {
// Default face capture type is photo.
@@ -309,12 +322,7 @@ public class OnfidoSdkModule extends ReactContextBaseJavaModule {
}
}
- if(proofOfAddress){
- flowStepList.add(FlowStep.PROOF_OF_ADDRESS);
- }
-
final FlowStep[] flowStepsWithOptions = flowStepList.toArray(new FlowStep[0]);
-
return flowStepsWithOptions;
} catch (final Exception e) {
e.printStackTrace();
@@ -328,29 +336,10 @@ public class OnfidoSdkModule extends ReactContextBaseJavaModule {
List<FlowStep> flowStepList,
OnfidoConfig.Builder configBuilder
) throws Exception {
- ReadableMap captureDocument = null;
- Boolean captureDocumentBoolean = null;
-
- // ReadableMap does not have a way to get multi-typed values without throwing exceptions.
- try {
- captureDocumentBoolean = flowSteps.getBoolean("captureDocument");
- } catch (final NoSuchKeyException |
- ClassCastException |
- UnexpectedNativeTypeException notFoundException) {
- captureDocument = flowSteps.getMap("captureDocument");
- }
-
- if (captureDocumentBoolean != null) {
- if (captureDocumentBoolean) {
- flowStepList.add(FlowStep.CAPTURE_DOCUMENT);
- }
- return;
- }
-
+ ReadableMap captureDocument = flowSteps.getMap("captureDocument");
if (captureDocument == null) {
return;
}
-
extractDocumentCaptureDetails(captureDocument, flowStepList, configBuilder);
}
@@ -361,35 +350,46 @@ public class OnfidoSdkModule extends ReactContextBaseJavaModule {
) throws Exception {
final boolean docTypeExists = captureDocument.hasKey("docType");
final boolean countryCodeExists = captureDocument.hasKey("alpha2CountryCode");
- final boolean allowedDocumentTypes = captureDocument.hasKey("allowedDocumentTypes");
+ final boolean withAllowedDocumentTypes = captureDocument.hasKey("allowedDocumentTypes");
- if (allowedDocumentTypes && countryCodeExists && docTypeExists) {
+ // Validation: incorrect config - 2 filtering ways provided
+ if (withAllowedDocumentTypes && countryCodeExists && docTypeExists) {
throw new IllegalArgumentException("We can either filter the documents on DocumentSelection screen, or skip the selection and go directly to capture");
}
- if (!docTypeExists && !countryCodeExists && !allowedDocumentTypes) {
+ // Case 1: no filtering provided => showing general Doc Capture
+ if (!docTypeExists && !countryCodeExists && !withAllowedDocumentTypes) {
flowStepList.add(FlowStep.CAPTURE_DOCUMENT);
return;
}
+ // Case 2: filtering for one document, one country
if (docTypeExists && countryCodeExists) {
extractDocTypeAndCountryForCaptureStep(captureDocument, flowStepList);
return;
}
- if (allowedDocumentTypes) {
+
+ // Case 3: filtering for multiple documents
+ if (withAllowedDocumentTypes) {
extractAllowedDocumentTypes(captureDocument, configBuilder);
+ flowStepList.add(FlowStep.CAPTURE_DOCUMENT);
return;
}
throw new Exception("For countryCode and docType: both must be specified, or both must be omitted.");
}
- private static void extractAllowedDocumentTypes(ReadableMap captureDocument, OnfidoConfig.Builder configBuilder) {
- ReadableArray array = captureDocument.getArray("allowedDocumentTypes");
+ private static void extractAllowedDocumentTypes(
+ ReadableMap captureDocument,
+ OnfidoConfig.Builder configBuilder
+ ) {
+ ReadableArray documentTypes = captureDocument.getArray("allowedDocumentTypes");
ArrayList<DocumentType> types = new ArrayList<>();
- for (int i = 0; i < array.size(); i++) {
- types.add(DocumentType.valueOf(array.getString(i)));
+ if (documentTypes != null) {
+ for (int i = 0; i < documentTypes.size(); i++) {
+ types.add(DocumentType.valueOf(documentTypes.getString(i)));
+ }
}
configBuilder.withAllowedDocumentTypes(types);
}
@@ -487,14 +487,14 @@ public class OnfidoSdkModule extends ReactContextBaseJavaModule {
}
@ReactMethod
- public void removeListeners(int type) {
+ public void removeListeners(double type) {
// Keep: Required for RN build in the Event Emitter Calls
}
private void sendEvent(String name, WritableMap map) {
getReactApplicationContext()
- .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
- .emit(name, map);
+ .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
+ .emit(name, map);
}
//region Media
diff --git a/node_modules/@onfido/react-native-sdk/android/src/main/java/com/onfido/reactnative/sdk/OnfidoSdkPackage.java b/node_modules/@onfido/react-native-sdk/android/src/main/java/com/onfido/reactnative/sdk/OnfidoSdkPackage.java
index 35c0ee6..16469e2 100644
--- a/node_modules/@onfido/react-native-sdk/android/src/main/java/com/onfido/reactnative/sdk/OnfidoSdkPackage.java
+++ b/node_modules/@onfido/react-native-sdk/android/src/main/java/com/onfido/reactnative/sdk/OnfidoSdkPackage.java
@@ -1,23 +1,90 @@
package com.onfido.reactnative.sdk;
+import androidx.annotation.Nullable;
+
import java.util.Arrays;
import java.util.Collections;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
-import com.facebook.react.ReactPackage;
+import com.facebook.react.TurboReactPackage;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
+import com.facebook.react.module.annotations.ReactModule;
+import com.facebook.react.module.annotations.ReactModuleList;
+import com.facebook.react.module.model.ReactModuleInfo;
+import com.facebook.react.module.model.ReactModuleInfoProvider;
+import com.facebook.react.turbomodule.core.interfaces.TurboModule;
import com.facebook.react.uimanager.ViewManager;
-import com.facebook.react.bridge.JavaScriptModule;
-public class OnfidoSdkPackage implements ReactPackage {
+@ReactModuleList(
+ nativeModules = {
+ OnfidoSdkModule.class
+ }
+)
+public class OnfidoSdkPackage extends TurboReactPackage {
@Override
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
return Arrays.<NativeModule>asList(new OnfidoSdkModule(reactContext));
}
+ @Nullable
+ @Override
+ public NativeModule getModule(String name, ReactApplicationContext reactApplicationContext) {
+ switch (name) {
+ case OnfidoSdkModule.NAME:
+ return new OnfidoSdkModule(reactApplicationContext);
+ default:
+ return null;
+ }
+ }
+
@Override
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
return Collections.emptyList();
}
+
+ @Override
+ public ReactModuleInfoProvider getReactModuleInfoProvider() {
+ try {
+ Class<?> reactModuleInfoProviderClass =
+ Class.forName("com.onfido.reactnative.sdk.OnfidoSdkPackage$$ReactModuleInfoProvider");
+ return (ReactModuleInfoProvider) reactModuleInfoProviderClass.newInstance();
+ } catch (ClassNotFoundException e) {
+ // ReactModuleSpecProcessor does not run at build-time. Create this ReactModuleInfoProvider by
+ // hand.
+ return new ReactModuleInfoProvider() {
+ @Override
+ public Map<String, ReactModuleInfo> getReactModuleInfos() {
+ final Map<String, ReactModuleInfo> reactModuleInfoMap = new HashMap<>();
+
+ Class<? extends NativeModule>[] moduleList =
+ new Class[] {
+ OnfidoSdkModule.class,
+ };
+
+ for (Class<? extends NativeModule> moduleClass : moduleList) {
+ ReactModule reactModule = moduleClass.getAnnotation(ReactModule.class);
+
+ reactModuleInfoMap.put(
+ reactModule.name(),
+ new ReactModuleInfo(
+ reactModule.name(),
+ moduleClass.getName(),
+ reactModule.canOverrideExistingModule(),
+ reactModule.needsEagerInit(),
+ reactModule.hasConstants(),
+ reactModule.isCxxModule(),
+ TurboModule.class.isAssignableFrom(moduleClass)));
+ }
+
+ return reactModuleInfoMap;
+ }
+ };
+ } catch (InstantiationException | IllegalAccessException e) {
+ throw new RuntimeException(
+ "No ReactModuleInfoProvider for com.onfido.reactnative.sdk.OnfidoSdkPackage$$ReactModuleInfoProvider", e);
+ }
+ }
}
diff --git a/node_modules/@onfido/react-native-sdk/android/src/paper/java/com/onfido/reactnative/sdk/NativeOnfidoModuleSpec.java b/node_modules/@onfido/react-native-sdk/android/src/paper/java/com/onfido/reactnative/sdk/NativeOnfidoModuleSpec.java
new file mode 100644
index 0000000..16e880e
--- /dev/null
+++ b/node_modules/@onfido/react-native-sdk/android/src/paper/java/com/onfido/reactnative/sdk/NativeOnfidoModuleSpec.java
@@ -0,0 +1,52 @@
+
+/**
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
+ *
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
+ * once the code is regenerated.
+ *
+ * @generated by codegen project: GenerateModuleJavaSpec.js
+ *
+ * @nolint
+ */
+
+package com.onfido.reactnative.sdk;
+
+import com.facebook.proguard.annotations.DoNotStrip;
+import com.facebook.react.bridge.Promise;
+import com.facebook.react.bridge.ReactApplicationContext;
+import com.facebook.react.bridge.ReactContextBaseJavaModule;
+import com.facebook.react.bridge.ReactMethod;
+import com.facebook.react.bridge.ReactModuleWithSpec;
+import com.facebook.react.bridge.ReadableMap;
+import com.facebook.react.turbomodule.core.interfaces.TurboModule;
+import javax.annotation.Nonnull;
+
+public abstract class NativeOnfidoModuleSpec extends ReactContextBaseJavaModule implements ReactModuleWithSpec, TurboModule {
+ public static final String NAME = "RNOnfidoSdk";
+
+ public NativeOnfidoModuleSpec(ReactApplicationContext reactContext) {
+ super(reactContext);
+ }
+
+ @Override
+ public @Nonnull String getName() {
+ return NAME;
+ }
+
+ @ReactMethod
+ @DoNotStrip
+ public abstract void start(ReadableMap config, Promise promise);
+
+ @ReactMethod
+ @DoNotStrip
+ public abstract void withMediaCallbacksEnabled();
+
+ @ReactMethod
+ @DoNotStrip
+ public abstract void addListener(String eventName);
+
+ @ReactMethod
+ @DoNotStrip
+ public abstract void removeListeners(double count);
+}
diff --git a/node_modules/@onfido/react-native-sdk/ios/OnfidoSdk-Bridging-Header.h b/node_modules/@onfido/react-native-sdk/ios/OnfidoSdk-Bridging-Header.h
index ebf12f6..9acdb99 100644
--- a/node_modules/@onfido/react-native-sdk/ios/OnfidoSdk-Bridging-Header.h
+++ b/node_modules/@onfido/react-native-sdk/ios/OnfidoSdk-Bridging-Header.h
@@ -3,4 +3,4 @@
//
#import <React/RCTBridgeModule.h>
-#import <React/RCTEventEmitter.h>
+#import "PluginMetadata.h"
diff --git a/node_modules/@onfido/react-native-sdk/ios/OnfidoSdk.m b/node_modules/@onfido/react-native-sdk/ios/OnfidoSdk.m
deleted file mode 100644
index 328de71..0000000
--- a/node_modules/@onfido/react-native-sdk/ios/OnfidoSdk.m
+++ /dev/null
@@ -1,14 +0,0 @@
-#import <Foundation/Foundation.h>
-#import <React/RCTBridgeModule.h>
-#import <React/RCTEventEmitter.h>
-@interface RCT_EXTERN_MODULE(OnfidoSdk, RCTEventEmitter)
-
-RCT_EXTERN_METHOD(
- start:(NSDictionary *)config
- resolver:(RCTPromiseResolveBlock)resolve
- rejecter:(RCTPromiseRejectBlock)reject
-)
-RCT_EXTERN_METHOD(supportedEvents)
-RCT_EXTERN_METHOD(withMediaCallbacksEnabled)
-
-@end
diff --git a/node_modules/@onfido/react-native-sdk/ios/OnfidoSdk.swift b/node_modules/@onfido/react-native-sdk/ios/OnfidoSdk.swift
index 3829c99..e8788f0 100644
--- a/node_modules/@onfido/react-native-sdk/ios/OnfidoSdk.swift
+++ b/node_modules/@onfido/react-native-sdk/ios/OnfidoSdk.swift
@@ -14,24 +14,31 @@ private enum CallbackType {
}
@objc(OnfidoSdk)
-final class OnfidoSdk: RCTEventEmitter {
+public final class OnfidoSdk: NSObject {
private let onfidoFlowBuilder = OnfidoFlowBuilder()
private let configParser = OnfidoConfigParser()
private var callbackTypes: [CallbackType] = []
@objc
- func start(_ config: NSDictionary,
- resolver resolve: @escaping RCTPromiseResolveBlock,
- rejecter reject: @escaping RCTPromiseRejectBlock) {
+ public var mediaCallbackHandler: (([String: Any]) -> Void)?
+
+ // TODO: Using React types here (RCTPromiseResolveBlock and RCTPromiseRejectBlock) causes the project to fail to build.
+ // For some reason marking them as @escaping causes the XCode to add an import to non-existent header file in onfido_react_native_sdk-Swift.h.
+ @objc
+ public func start(_ config: NSDictionary,
+ resolver resolve: @escaping (Any) -> Void,
+ rejecter reject: @escaping (String, String, Error?) -> Void) -> Void {
DispatchQueue.main.async { [weak self] in
self?.run(withConfig: config, resolver: resolve, rejecter: reject)
}
}
+ // TODO: Same as above
private func run(withConfig config: NSDictionary,
- resolver resolve: @escaping RCTPromiseResolveBlock,
- rejecter reject: @escaping RCTPromiseRejectBlock) {
+ resolver resolve: @escaping (Any) -> Void,
+ rejecter reject: @escaping (String, String, Error?) -> Void) {
+
do {
let onfidoConfig: OnfidoPluginConfig = try configParser.parse(config)
@@ -90,27 +97,17 @@ final class OnfidoSdk: RCTEventEmitter {
}
}
- // MARK: - Callbacks
-
- @objc
- public override func supportedEvents() -> [String] {
- return ["onfidoMediaCallback"]
- }
-
- @objc
- override static func requiresMainQueueSetup() -> Bool {
- return false
- }
-
// MARK: Media
@objc
- func withMediaCallbacksEnabled() {
+ public func withMediaCallbacksEnabled() {
callbackTypes.append(.media)
}
private func processMediaResult(_ dictionary: [String: Any]) {
- sendEvent(withName: "onfidoMediaCallback", body: dictionary)
+ if let handler = mediaCallbackHandler {
+ handler(dictionary)
+ }
}
}
diff --git a/node_modules/@onfido/react-native-sdk/ios/OnfidoSdk.xcodeproj/project.pbxproj b/node_modules/@onfido/react-native-sdk/ios/OnfidoSdk.xcodeproj/project.pbxproj
index e87f422..7958454 100644
--- a/node_modules/@onfido/react-native-sdk/ios/OnfidoSdk.xcodeproj/project.pbxproj
+++ b/node_modules/@onfido/react-native-sdk/ios/OnfidoSdk.xcodeproj/project.pbxproj
@@ -65,6 +65,8 @@
8517ACCD244290D10077E909 /* OnfidoSdkTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OnfidoSdkTests.swift; sourceTree = "<group>"; };
899A7F1B3979E0BB4044B867 /* libPods-OnfidoSdk-OnfidoSdkTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-OnfidoSdk-OnfidoSdkTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
8B8E5FE3BDE0C9C96B5FE8AB /* Pods-OnfidoSdk.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-OnfidoSdk.debug.xcconfig"; path = "Target Support Files/Pods-OnfidoSdk/Pods-OnfidoSdk.debug.xcconfig"; sourceTree = "<group>"; };
+ 9B55F4FF2B61451700EC4D80 /* PluginMetadata.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PluginMetadata.m; sourceTree = "<group>"; };
+ 9B55F5002B61451700EC4D80 /* PluginMetadata.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PluginMetadata.h; sourceTree = "<group>"; };
9BF206B12A3C839F00766D77 /* CallbackReceiver.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CallbackReceiver.swift; sourceTree = "<group>"; };
9BF206B22A3C839F00766D77 /* BridgeUtils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BridgeUtils.swift; sourceTree = "<group>"; };
9BF206B32A3C839F00766D77 /* OnfidoAppearance.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnfidoAppearance.swift; sourceTree = "<group>"; };
@@ -138,6 +140,8 @@
3AFE501B2408521F00E21479 /* OnfidoSdk-Bridging-Header.h */,
B3E7B5881CC2AC0600A0062D /* OnfidoSdk.h */,
B3E7B5891CC2AC0600A0062D /* OnfidoSdk.m */,
+ 9B55F5002B61451700EC4D80 /* PluginMetadata.h */,
+ 9B55F4FF2B61451700EC4D80 /* PluginMetadata.m */,
3A9D42CA2412EEF50087A331 /* OnfidoSdkTests */,
134814211AA4EA7D00B7C361 /* Products */,
4A3724A27399FEFCC7B1F920 /* Pods */,
diff --git a/node_modules/@onfido/react-native-sdk/ios/PluginMetadata.h b/node_modules/@onfido/react-native-sdk/ios/PluginMetadata.h
new file mode 100644
index 0000000..c263983
--- /dev/null
+++ b/node_modules/@onfido/react-native-sdk/ios/PluginMetadata.h
@@ -0,0 +1,10 @@
+#import <Foundation/Foundation.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface PluginMetadata : NSObject
+@property (nonatomic, readonly) NSString* pluginPlatform;
+@property (nonatomic, readonly) NSString* pluginVersion;
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/node_modules/@onfido/react-native-sdk/ios/PluginMetadata.m b/node_modules/@onfido/react-native-sdk/ios/PluginMetadata.m
new file mode 100644
index 0000000..3f9109e
--- /dev/null
+++ b/node_modules/@onfido/react-native-sdk/ios/PluginMetadata.m
@@ -0,0 +1,15 @@
+#import "PluginMetadata.h"
+
+@implementation PluginMetadata
+
+- (instancetype)init