@qore-id/react-native-qoreid-sdk 1.1.4 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +1 -1
- package/android/build.gradle +69 -63
- package/android/gradle.properties +5 -9
- package/android/src/main/AndroidManifest.xml +1 -1
- package/android/src/main/java/com/qoreidsdk/QoreidSdkModule.kt +169 -137
- package/android/src/main/java/com/qoreidsdk/QoreidSdkPackage.kt +1 -4
- package/ios/QoreidSdk.m +4 -13
- package/ios/QoreidSdk.swift +30 -23
- package/lib/commonjs/index.js +2 -2
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/qoreIdSdk.js +32 -6
- package/lib/commonjs/qoreIdSdk.js.map +1 -1
- package/lib/commonjs/types.d.js.map +1 -1
- package/lib/commonjs/utils.js.map +1 -1
- package/lib/module/index.js +4 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/qoreIdSdk.js +33 -6
- package/lib/module/qoreIdSdk.js.map +1 -1
- package/lib/module/types.d.js +1 -1
- package/lib/module/types.d.js.map +1 -1
- package/lib/module/utils.js +2 -0
- package/lib/module/utils.js.map +1 -1
- package/lib/typescript/src/index.d.ts +4 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/{qoreIdSdk.d.ts → src/qoreIdSdk.d.ts} +6 -1
- package/lib/typescript/src/qoreIdSdk.d.ts.map +1 -0
- package/lib/typescript/src/utils.d.ts.map +1 -0
- package/package.json +64 -42
- package/qore-id-react-native-qoreid-sdk.podspec +23 -16
- package/src/index.tsx +1 -0
- package/src/qoreIdSdk.tsx +40 -5
- package/src/types.d.ts +22 -3
- package/android/src/main/java/com/qoreidsdk/QoreIdJSData.kt +0 -50
- package/ios/QoreidSdk.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -4
- package/ios/QoreidSdk.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/ios/QoreidSdk.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +0 -5
- package/ios/QoreidSdk.xcodeproj/project.xcworkspace/xcuserdata/e.ugwuoke.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/QoreidSdk.xcodeproj/project.xcworkspace/xcuserdata/e.ugwuoke.xcuserdatad/WorkspaceSettings.xcsettings +0 -14
- package/ios/QoreidSdk.xcodeproj/xcuserdata/e.ugwuoke.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
- package/lib/typescript/index.d.ts +0 -3
- package/lib/typescript/index.d.ts.map +0 -1
- package/lib/typescript/qoreIdSdk.d.ts.map +0 -1
- package/lib/typescript/utils.d.ts.map +0 -1
- /package/lib/typescript/{utils.d.ts → src/utils.d.ts} +0 -0
|
@@ -11,25 +11,32 @@ Pod::Spec.new do |s|
|
|
|
11
11
|
s.license = package["license"]
|
|
12
12
|
s.authors = package["author"]
|
|
13
13
|
|
|
14
|
-
s.platforms = { :ios =>
|
|
14
|
+
s.platforms = { :ios => min_ios_version_supported }
|
|
15
15
|
s.source = { :git => "https://.git", :tag => "#{s.version}" }
|
|
16
16
|
|
|
17
17
|
s.source_files = "ios/**/*.{h,m,mm,swift}"
|
|
18
|
-
s.dependency "React-Core"
|
|
19
18
|
s.dependency 'QoreIDSDK'
|
|
20
|
-
|
|
21
|
-
#
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
s
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
19
|
+
|
|
20
|
+
# Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
|
|
21
|
+
# See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
|
|
22
|
+
if respond_to?(:install_modules_dependencies, true)
|
|
23
|
+
install_modules_dependencies(s)
|
|
24
|
+
else
|
|
25
|
+
s.dependency "React-Core"
|
|
26
|
+
|
|
27
|
+
# Don't install the dependencies when we run `pod install` in the old architecture.
|
|
28
|
+
if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
|
|
29
|
+
s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
|
|
30
|
+
s.pod_target_xcconfig = {
|
|
31
|
+
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
|
|
32
|
+
"OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
|
|
33
|
+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
|
|
34
|
+
}
|
|
35
|
+
s.dependency "React-Codegen"
|
|
36
|
+
s.dependency "RCT-Folly"
|
|
37
|
+
s.dependency "RCTRequired"
|
|
38
|
+
s.dependency "RCTTypeSafety"
|
|
39
|
+
s.dependency "ReactCommon/turbomodule/core"
|
|
40
|
+
end
|
|
34
41
|
end
|
|
35
42
|
end
|
package/src/index.tsx
CHANGED
package/src/qoreIdSdk.tsx
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
import { NativeEventEmitter, NativeModules, Platform } from 'react-native';
|
|
2
2
|
import type { OnResult, QoreIdData } from './types';
|
|
3
|
+
import { useEffect } from 'react';
|
|
4
|
+
|
|
5
|
+
const LINKING_ERROR =
|
|
6
|
+
`The package '@qoreid/react-native-qoreid-sdk' doesn't seem to be linked. Make sure: \n\n` +
|
|
7
|
+
Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
|
|
8
|
+
'- You rebuilt the app after installing the package\n' +
|
|
9
|
+
'- You are not using Expo Go\n';
|
|
10
|
+
|
|
11
|
+
const QoreidRNModule = NativeModules.QoreidSdk;
|
|
12
|
+
|
|
13
|
+
const ReactNativeQoreidSdkModule =
|
|
14
|
+
QoreidRNModule ??
|
|
15
|
+
new Proxy(
|
|
16
|
+
{},
|
|
17
|
+
{
|
|
18
|
+
get() {
|
|
19
|
+
throw new Error(LINKING_ERROR);
|
|
20
|
+
},
|
|
21
|
+
}
|
|
22
|
+
);
|
|
3
23
|
|
|
4
24
|
export const QoreIdSdk = {
|
|
5
25
|
/**
|
|
@@ -7,14 +27,14 @@ export const QoreIdSdk = {
|
|
|
7
27
|
* @param initialData - data to launch Qore ID SDK
|
|
8
28
|
* @requires QoreIdSdk native module installed
|
|
9
29
|
*/
|
|
10
|
-
launch(initialData: QoreIdData
|
|
30
|
+
launch(initialData: QoreIdData) {
|
|
11
31
|
const payload = {
|
|
12
32
|
config: {
|
|
13
33
|
flowId: initialData.flowId || 0,
|
|
14
34
|
customerReference: initialData.customerReference,
|
|
15
35
|
productCode: initialData.productCode,
|
|
16
36
|
clientId: initialData.clientId,
|
|
17
|
-
defaultIdType: initialData?.defaultIdType
|
|
37
|
+
defaultIdType: initialData?.defaultIdType ?? '',
|
|
18
38
|
},
|
|
19
39
|
applicantData: {
|
|
20
40
|
...initialData.applicantData,
|
|
@@ -24,9 +44,9 @@ export const QoreIdSdk = {
|
|
|
24
44
|
},
|
|
25
45
|
acceptedDocuments: initialData.ocrAcceptedDocuments,
|
|
26
46
|
identityData: { ...initialData.identityData },
|
|
47
|
+
extraData: initialData.extraData,
|
|
27
48
|
};
|
|
28
|
-
|
|
29
|
-
NativeModules.QoreidSdk.launchQoreidSdk(payload);
|
|
49
|
+
ReactNativeQoreidSdkModule.launchQoreidSdk(payload);
|
|
30
50
|
},
|
|
31
51
|
|
|
32
52
|
/**
|
|
@@ -37,7 +57,7 @@ export const QoreIdSdk = {
|
|
|
37
57
|
const eventEmitter =
|
|
38
58
|
Platform.OS === 'android'
|
|
39
59
|
? new NativeEventEmitter()
|
|
40
|
-
: new NativeEventEmitter(
|
|
60
|
+
: new NativeEventEmitter(ReactNativeQoreidSdkModule);
|
|
41
61
|
let eventListener = eventEmitter?.addListener('onResult', callback);
|
|
42
62
|
|
|
43
63
|
return () => {
|
|
@@ -45,3 +65,18 @@ export const QoreIdSdk = {
|
|
|
45
65
|
};
|
|
46
66
|
},
|
|
47
67
|
};
|
|
68
|
+
|
|
69
|
+
export function useQoreIdSdk({
|
|
70
|
+
onResult,
|
|
71
|
+
}: {
|
|
72
|
+
onResult: (data: OnResult) => void;
|
|
73
|
+
}) {
|
|
74
|
+
useEffect(() => {
|
|
75
|
+
const unsubscribed = QoreIdSdk.events(onResult);
|
|
76
|
+
return () => {
|
|
77
|
+
unsubscribed();
|
|
78
|
+
};
|
|
79
|
+
}, [onResult]);
|
|
80
|
+
|
|
81
|
+
return { launchQoreId: QoreIdSdk.launch };
|
|
82
|
+
}
|
package/src/types.d.ts
CHANGED
|
@@ -8,6 +8,13 @@ export interface QoreIdData {
|
|
|
8
8
|
addressData?: AddressData;
|
|
9
9
|
ocrAcceptedDocuments: string[];
|
|
10
10
|
identityData?: IdentityData;
|
|
11
|
+
/** extra property is only usable for internal use only */
|
|
12
|
+
extraData?: {
|
|
13
|
+
organisationId: string;
|
|
14
|
+
organisationName: string;
|
|
15
|
+
requestSource: string;
|
|
16
|
+
internalReferenceId: string;
|
|
17
|
+
};
|
|
11
18
|
}
|
|
12
19
|
|
|
13
20
|
interface IConfig {
|
|
@@ -45,11 +52,23 @@ interface AddressData {
|
|
|
45
52
|
|
|
46
53
|
export interface OnResult {
|
|
47
54
|
code: string;
|
|
48
|
-
data: string;
|
|
55
|
+
data: Record<string, unknown> | string | number | null;
|
|
56
|
+
event: 'SESSION_RESULT' | 'SUCCESS_RESULT' | 'ERROR_RESULT';
|
|
49
57
|
message: string;
|
|
50
58
|
}
|
|
51
59
|
|
|
52
60
|
export type QoreIdSdk = {
|
|
53
|
-
launchQoreId: (initialData:
|
|
54
|
-
events: (OnResult: (data:
|
|
61
|
+
launchQoreId: (initialData: QoreIdData) => void;
|
|
62
|
+
events: (OnResult: (data: OnResult) => void) => void;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export function useQoreIdSdk({
|
|
66
|
+
onResult,
|
|
67
|
+
}: {
|
|
68
|
+
onResult: (data: OnResult) => void;
|
|
69
|
+
}): {
|
|
70
|
+
launchQoreId: (
|
|
71
|
+
initialData: QoreIdData,
|
|
72
|
+
_callback?: (data: OnResult) => void
|
|
73
|
+
) => void;
|
|
55
74
|
};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
package com.qoreidsdk
|
|
2
|
-
|
|
3
|
-
data class Config (
|
|
4
|
-
val flowId: Long? = 0,
|
|
5
|
-
val customerRef: String,
|
|
6
|
-
val productCode: String,
|
|
7
|
-
val clientId: String,
|
|
8
|
-
val acceptedDocuments: List<String>,
|
|
9
|
-
)
|
|
10
|
-
|
|
11
|
-
data class ApplicantData(
|
|
12
|
-
val firstName: String,
|
|
13
|
-
val lastName: String,
|
|
14
|
-
val phoneNumber: String,
|
|
15
|
-
val email: String,
|
|
16
|
-
val dob: String,
|
|
17
|
-
val gender: String,
|
|
18
|
-
val middleName:String
|
|
19
|
-
)
|
|
20
|
-
|
|
21
|
-
data class IdentityData(
|
|
22
|
-
val idType: String,
|
|
23
|
-
val idNumber: String,
|
|
24
|
-
)
|
|
25
|
-
|
|
26
|
-
data class AddressData(
|
|
27
|
-
val address: String,
|
|
28
|
-
val town: String,
|
|
29
|
-
val lga: String,
|
|
30
|
-
val city: String,
|
|
31
|
-
val state: String,
|
|
32
|
-
val region: String,
|
|
33
|
-
val district: String,
|
|
34
|
-
val virAddress: String
|
|
35
|
-
)
|
|
36
|
-
|
|
37
|
-
data class QoreIdJSData(
|
|
38
|
-
val config: Config,
|
|
39
|
-
val applicantData: ApplicantData,
|
|
40
|
-
val addressData: AddressData,
|
|
41
|
-
val acceptedDocuments: List<String>,
|
|
42
|
-
val identityData: IdentityData
|
|
43
|
-
)
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
data class StyleOptionsData (
|
|
47
|
-
val color:String,
|
|
48
|
-
val backgroundColor:String,
|
|
49
|
-
val title: String
|
|
50
|
-
)
|
|
Binary file
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
-
<plist version="1.0">
|
|
4
|
-
<dict>
|
|
5
|
-
<key>BuildLocationStyle</key>
|
|
6
|
-
<string>UseAppPreferences</string>
|
|
7
|
-
<key>CustomBuildLocationType</key>
|
|
8
|
-
<string>RelativeToDerivedData</string>
|
|
9
|
-
<key>DerivedDataLocationStyle</key>
|
|
10
|
-
<string>Default</string>
|
|
11
|
-
<key>ShowSharedSchemesAutomaticallyEnabled</key>
|
|
12
|
-
<true/>
|
|
13
|
-
</dict>
|
|
14
|
-
</plist>
|
package/ios/QoreidSdk.xcodeproj/xcuserdata/e.ugwuoke.xcuserdatad/xcschemes/xcschememanagement.plist
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
-
<plist version="1.0">
|
|
4
|
-
<dict>
|
|
5
|
-
<key>SchemeUserState</key>
|
|
6
|
-
<dict>
|
|
7
|
-
<key>QoreidSdk.xcscheme_^#shared#^_</key>
|
|
8
|
-
<dict>
|
|
9
|
-
<key>orderHint</key>
|
|
10
|
-
<integer>0</integer>
|
|
11
|
-
</dict>
|
|
12
|
-
</dict>
|
|
13
|
-
</dict>
|
|
14
|
-
</plist>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"qoreIdSdk.d.ts","sourceRoot":"","sources":["../../src/qoreIdSdk.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAEpD,eAAO,MAAM,SAAS;IACpB;;;;OAIG;wBACiB,UAAU,sBAAqB,QAAQ,KAAK,IAAI;IAsBpE;;;OAGG;4BACqB,QAAQ,KAAK,IAAI;CAW1C,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAqEA,eAAO,MAAM,KAAK;;;;;;;CAGjB,CAAC"}
|
|
File without changes
|