@pagopa/io-react-native-iso18013 0.2.0 → 0.3.0
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/android/build.gradle +1 -1
- package/android/src/main/java/com/ioreactnativeiso18013/IoReactNativeIso18013Module.kt +17 -16
- package/ios/IoReactNativeIso18013.swift +1 -1
- package/lib/module/cbor/index.js +1 -1
- package/lib/module/cbor/index.js.map +1 -1
- package/lib/module/iso18013/index.js +2 -2
- package/lib/module/iso18013/index.js.map +1 -1
- package/lib/module/iso18013/iso18013-5/proximity.js +9 -9
- package/lib/module/iso18013/iso18013-5/proximity.js.map +1 -1
- package/lib/module/iso18013/iso18013-7/remote.js +2 -2
- package/lib/module/iso18013/iso18013-7/remote.js.map +1 -1
- package/lib/typescript/src/iso18013/index.d.ts +1 -1
- package/lib/typescript/src/iso18013/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/cbor/index.ts +1 -1
- package/src/iso18013/index.ts +2 -2
- package/src/iso18013/iso18013-5/proximity.ts +9 -9
- package/src/iso18013/iso18013-7/remote.ts +2 -2
package/android/build.gradle
CHANGED
|
@@ -77,7 +77,7 @@ def kotlin_version = getExtOrDefault("kotlinVersion")
|
|
|
77
77
|
dependencies {
|
|
78
78
|
implementation "com.facebook.react:react-android"
|
|
79
79
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
80
|
-
implementation "it.pagopa.io.wallet.proximity:proximity:2.
|
|
80
|
+
implementation "it.pagopa.io.wallet.proximity:proximity:2.1.0"
|
|
81
81
|
implementation "it.pagopa.io.wallet.cbor:cbor:1.3.0"
|
|
82
82
|
}
|
|
83
83
|
|
|
@@ -36,7 +36,7 @@ class IoReactNativeIso18013Module(reactContext: ReactApplicationContext) :
|
|
|
36
36
|
* @param peripheralMode - Whether the device is in peripheral mode. Defaults to true
|
|
37
37
|
* @param centralClientMode - Whether the device is in central client mode. Defaults to false
|
|
38
38
|
* @param clearBleCache - Whether the BLE cache should be cleared. Defaults to true
|
|
39
|
-
* @param certificates -
|
|
39
|
+
* @param certificates - Two-dimensional array of base64 strings representing DER encoded X.509 certificate which are used to authenticate the verifier app
|
|
40
40
|
* @param promise - The promise which will be resolved in case of success or rejected in case of failure.
|
|
41
41
|
*/
|
|
42
42
|
@ReactMethod
|
|
@@ -54,11 +54,11 @@ class IoReactNativeIso18013Module(reactContext: ReactApplicationContext) :
|
|
|
54
54
|
clearBleCache = clearBleCache
|
|
55
55
|
)
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
val certificatesList = parseCertificates(certificates)
|
|
58
58
|
qrEngagement = QrEngagement.build(reactApplicationContext, listOf(retrievalMethod)).apply {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
if (certificatesList.isNotEmpty()) {
|
|
60
|
+
withReaderTrustStore(certificatesList)
|
|
61
|
+
}
|
|
62
62
|
}
|
|
63
63
|
qrEngagement?.configure()
|
|
64
64
|
setupProximityHandler()
|
|
@@ -75,20 +75,21 @@ class IoReactNativeIso18013Module(reactContext: ReactApplicationContext) :
|
|
|
75
75
|
/**
|
|
76
76
|
* Utility function to parse an array coming from the React Native Bridge into an ArrayList
|
|
77
77
|
* of ByteArray representing DER encoded X.509 certificates.
|
|
78
|
-
* @param certificates -
|
|
78
|
+
* @param certificates - Two-dimensional array of base64 strings representing DER encoded X.509 certificate
|
|
79
79
|
* @returns An ArrayList of ByteArray representing DER encoded X.509 certificates.
|
|
80
80
|
* @throws ClassCastException if the element in the array is not a string
|
|
81
81
|
*/
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
82
|
+
private fun parseCertificates(certificates: ReadableArray): List<List<ByteArray>> =
|
|
83
|
+
(0 until certificates.size())
|
|
84
|
+
.mapNotNull { chainIndex -> certificates.getArray(chainIndex) }
|
|
85
|
+
.map { chain ->
|
|
86
|
+
(0 until chain.size())
|
|
87
|
+
.mapNotNull { certIndex ->
|
|
88
|
+
chain.takeIf { it.getType(certIndex) == ReadableType.String }
|
|
89
|
+
?.getString(certIndex)
|
|
90
|
+
?.let { Base64Utils.decodeBase64(it) }
|
|
91
|
+
}
|
|
92
|
+
}
|
|
92
93
|
|
|
93
94
|
/**
|
|
94
95
|
* Creates a QR code to be scanned in order to initialize the presentation.
|
package/lib/module/cbor/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { NativeModules, Platform } from 'react-native';
|
|
4
|
-
const LINKING_ERROR = `The package '@pagopa/io-react-native-
|
|
4
|
+
const LINKING_ERROR = `The package '@pagopa/io-react-native-iso18013' (IoReactNativeCbor) doesn't seem to be linked. Make sure: \n\n` + Platform.select({
|
|
5
5
|
ios: "- You have run 'pod install'\n",
|
|
6
6
|
default: ''
|
|
7
7
|
}) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeModules","Platform","LINKING_ERROR","select","ios","default","IoReactNativeCbor","Proxy","get","Error"],"sourceRoot":"../../../src","sources":["cbor/index.ts"],"mappings":";;AAAA,SAASA,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AAEtD,MAAMC,aAAa,GACjB,
|
|
1
|
+
{"version":3,"names":["NativeModules","Platform","LINKING_ERROR","select","ios","default","IoReactNativeCbor","Proxy","get","Error"],"sourceRoot":"../../../src","sources":["cbor/index.ts"],"mappings":";;AAAA,SAASA,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AAEtD,MAAMC,aAAa,GACjB,+GAA+G,GAC/GD,QAAQ,CAACE,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;AAEjC,OAAO,MAAMC,iBAAiB,GAAGN,aAAa,CAACM,iBAAiB,GAC5DN,aAAa,CAACM,iBAAiB,GAC/B,IAAIC,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACP,aAAa,CAAC;EAChC;AACF,CACF,CAAC","ignoreList":[]}
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
import { NativeModules, Platform } from 'react-native';
|
|
4
4
|
export { parseEventError, parseVerifierRequest } from "./iso18013-5/schema.js";
|
|
5
|
-
const LINKING_ERROR = `The package '@pagopa/io-react-native-
|
|
5
|
+
const LINKING_ERROR = `The package '@pagopa/io-react-native-iso18013' (IoReactNativeIso18013) doesn't seem to be linked. Make sure: \n\n` + Platform.select({
|
|
6
6
|
ios: "- You have run 'pod install'\n",
|
|
7
7
|
default: ''
|
|
8
8
|
}) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n';
|
|
9
|
-
export const
|
|
9
|
+
export const IoReactNativeIso18013 = NativeModules.IoReactNativeIso18013 ? NativeModules.IoReactNativeIso18013 : new Proxy({}, {
|
|
10
10
|
get() {
|
|
11
11
|
throw new Error(LINKING_ERROR);
|
|
12
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeModules","Platform","parseEventError","parseVerifierRequest","LINKING_ERROR","select","ios","default","
|
|
1
|
+
{"version":3,"names":["NativeModules","Platform","parseEventError","parseVerifierRequest","LINKING_ERROR","select","ios","default","IoReactNativeIso18013","Proxy","get","Error"],"sourceRoot":"../../../src","sources":["iso18013/index.ts"],"mappings":";;AAAA,SAASA,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AACtD,SAIEC,eAAe,EACfC,oBAAoB,QACf,wBAAqB;AAE5B,MAAMC,aAAa,GACjB,mHAAmH,GACnHH,QAAQ,CAACI,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;AAEjC,OAAO,MAAMC,qBAAqB,GAAGR,aAAa,CAACQ,qBAAqB,GACpER,aAAa,CAACQ,qBAAqB,GACnC,IAAIC,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACP,aAAa,CAAC;EAChC;AACF,CACF,CAAC","ignoreList":[]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { NativeEventEmitter, Platform } from 'react-native';
|
|
4
|
-
import {
|
|
5
|
-
const eventEmitter = new NativeEventEmitter(
|
|
4
|
+
import { IoReactNativeIso18013 } from "../index.js";
|
|
5
|
+
const eventEmitter = new NativeEventEmitter(IoReactNativeIso18013);
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Events emitted by the native module:
|
|
@@ -44,9 +44,9 @@ export function start(config = {}) {
|
|
|
44
44
|
certificates
|
|
45
45
|
} = config;
|
|
46
46
|
if (Platform.OS === 'ios') {
|
|
47
|
-
return
|
|
47
|
+
return IoReactNativeIso18013.start(certificates ? certificates : []);
|
|
48
48
|
} else {
|
|
49
|
-
return
|
|
49
|
+
return IoReactNativeIso18013.start(peripheralMode ? peripheralMode : true, centralClientMode ? centralClientMode : false, clearBleCache ? clearBleCache : true, certificates ? certificates : []);
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
|
|
@@ -54,14 +54,14 @@ export function start(config = {}) {
|
|
|
54
54
|
* Gets the QR code string this method is responsible for initializing the connection and retrieving the QR code string
|
|
55
55
|
*/
|
|
56
56
|
export function getQrCodeString() {
|
|
57
|
-
return
|
|
57
|
+
return IoReactNativeIso18013.getQrCodeString();
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
/**
|
|
61
61
|
* Closes the QR engagement
|
|
62
62
|
*/
|
|
63
63
|
export function close() {
|
|
64
|
-
return
|
|
64
|
+
return IoReactNativeIso18013.close();
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
/**
|
|
@@ -70,7 +70,7 @@ export function close() {
|
|
|
70
70
|
* @param code - The error code to be sent to the verifier app.
|
|
71
71
|
*/
|
|
72
72
|
export function sendErrorResponse(code) {
|
|
73
|
-
return
|
|
73
|
+
return IoReactNativeIso18013.sendErrorResponse(code);
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
/**
|
|
@@ -80,7 +80,7 @@ export function sendErrorResponse(code) {
|
|
|
80
80
|
* @returns A base64 encoded response to be sent to the verifier app via `sendResponse`
|
|
81
81
|
*/
|
|
82
82
|
export function generateResponse(documents, acceptedFields) {
|
|
83
|
-
return
|
|
83
|
+
return IoReactNativeIso18013.generateResponse(documents, acceptedFields);
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
/**
|
|
@@ -89,7 +89,7 @@ export function generateResponse(documents, acceptedFields) {
|
|
|
89
89
|
* @param response - The base64 encoded response to be sent to the verifier app.
|
|
90
90
|
*/
|
|
91
91
|
export function sendResponse(response) {
|
|
92
|
-
return
|
|
92
|
+
return IoReactNativeIso18013.sendResponse(response);
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeEventEmitter","Platform","
|
|
1
|
+
{"version":3,"names":["NativeEventEmitter","Platform","IoReactNativeIso18013","eventEmitter","ErrorCode","start","config","peripheralMode","centralClientMode","clearBleCache","certificates","OS","getQrCodeString","close","sendErrorResponse","code","generateResponse","documents","acceptedFields","sendResponse","response","addListener","event","callback","removeListener","removeAllListeners"],"sourceRoot":"../../../../src","sources":["iso18013/iso18013-5/proximity.ts"],"mappings":";;AAAA,SAASA,kBAAkB,EAAEC,QAAQ,QAAQ,cAAc;AAC3D,SAASC,qBAAqB,QAAQ,aAAI;AAI1C,MAAMC,YAAY,GAAG,IAAIH,kBAAkB,CAACE,qBAAqB,CAAC;;AAElE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAUA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA,WAAYE,SAAS,0BAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAAA,OAATA,SAAS;AAAA;;AAMrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,KAAKA,CACnBC,MAKC,GAAG,CAAC,CAAC,EACY;EAClB,MAAM;IAAEC,cAAc;IAAEC,iBAAiB;IAAEC,aAAa;IAAEC;EAAa,CAAC,GACtEJ,MAAM;EACR,IAAIL,QAAQ,CAACU,EAAE,KAAK,KAAK,EAAE;IACzB,OAAOT,qBAAqB,CAACG,KAAK,CAACK,YAAY,GAAGA,YAAY,GAAG,EAAE,CAAC;EACtE,CAAC,MAAM;IACL,OAAOR,qBAAqB,CAACG,KAAK,CAChCE,cAAc,GAAGA,cAAc,GAAG,IAAI,EACtCC,iBAAiB,GAAGA,iBAAiB,GAAG,KAAK,EAC7CC,aAAa,GAAGA,aAAa,GAAG,IAAI,EACpCC,YAAY,GAAGA,YAAY,GAAG,EAChC,CAAC;EACH;AACF;;AAEA;AACA;AACA;AACA,OAAO,SAASE,eAAeA,CAAA,EAAoB;EACjD,OAAOV,qBAAqB,CAACU,eAAe,CAAC,CAAC;AAChD;;AAEA;AACA;AACA;AACA,OAAO,SAASC,KAAKA,CAAA,EAAqB;EACxC,OAAOX,qBAAqB,CAACW,KAAK,CAAC,CAAC;AACtC;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,iBAAiBA,CAACC,IAAe,EAAoB;EACnE,OAAOb,qBAAqB,CAACY,iBAAiB,CAACC,IAAI,CAAC;AACtD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAC9BC,SAAmC,EACnCC,cAA8B,EACb;EACjB,OAAOhB,qBAAqB,CAACc,gBAAgB,CAACC,SAAS,EAAEC,cAAc,CAAC;AAC1E;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,YAAYA,CAACC,QAAgB,EAAoB;EAC/D,OAAOlB,qBAAqB,CAACiB,YAAY,CAACC,QAAQ,CAAC;AACrD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,WAAWA,CACzBC,KAAQ,EACRC,QAA0C,EAC1C;EACApB,YAAY,CAACkB,WAAW,CAACC,KAAK,EAAEC,QAAQ,CAAC;AAC3C;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASC,cAAcA,CAACF,KAAa,EAAE;EAC5CnB,YAAY,CAACsB,kBAAkB,CAACH,KAAK,CAAC;AACxC","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { IoReactNativeIso18013 } from "../index.js";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* All error codes that the module could return.
|
|
@@ -26,6 +26,6 @@ import { IoReactNativeProximity } from "../index.js";
|
|
|
26
26
|
* @returns the Device Response in CBOR format
|
|
27
27
|
*/
|
|
28
28
|
export const generateOID4VPDeviceResponse = async (clientId, responseUri, authorizationRequestNonce, mdocGeneratedNonce, documents, fieldRequestedAndAccepted) => {
|
|
29
|
-
return await
|
|
29
|
+
return await IoReactNativeIso18013.generateOID4VPDeviceResponse(clientId, responseUri, authorizationRequestNonce, mdocGeneratedNonce, documents, typeof fieldRequestedAndAccepted === 'string' ? fieldRequestedAndAccepted : JSON.stringify(fieldRequestedAndAccepted));
|
|
30
30
|
};
|
|
31
31
|
//# sourceMappingURL=remote.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["IoReactNativeIso18013","generateOID4VPDeviceResponse","clientId","responseUri","authorizationRequestNonce","mdocGeneratedNonce","documents","fieldRequestedAndAccepted","JSON","stringify"],"sourceRoot":"../../../../src","sources":["iso18013/iso18013-7/remote.ts"],"mappings":";;AAAA,SAASA,qBAAqB,QAAQ,aAAI;;AAG1C;AACA;AACA;;AAOA;AACA;AACA;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,4BAA4B,GAAG,MAAAA,CAC1CC,QAAgB,EAChBC,WAAmB,EACnBC,yBAAiC,EACjCC,kBAA0B,EAC1BC,SAAmC,EACnCC,yBAAuD,KACnC;EACpB,OAAO,MAAMP,qBAAqB,CAACC,4BAA4B,CAC7DC,QAAQ,EACRC,WAAW,EACXC,yBAAyB,EACzBC,kBAAkB,EAClBC,SAAS,EACT,OAAOC,yBAAyB,KAAK,QAAQ,GACzCA,yBAAyB,GACzBC,IAAI,CAACC,SAAS,CAACF,yBAAyB,CAC9C,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { type AcceptedFields, type EventError, type VerifierRequest, parseEventError, parseVerifierRequest, } from './iso18013-5/schema';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const IoReactNativeIso18013: any;
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/iso18013/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,eAAe,EACf,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAQ7B,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/iso18013/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,eAAe,EACf,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAQ7B,eAAO,MAAM,qBAAqB,KAS7B,CAAC"}
|
package/package.json
CHANGED
package/src/cbor/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { NativeModules, Platform } from 'react-native';
|
|
2
2
|
|
|
3
3
|
const LINKING_ERROR =
|
|
4
|
-
`The package '@pagopa/io-react-native-
|
|
4
|
+
`The package '@pagopa/io-react-native-iso18013' (IoReactNativeCbor) doesn't seem to be linked. Make sure: \n\n` +
|
|
5
5
|
Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
|
|
6
6
|
'- You rebuilt the app after installing the package\n' +
|
|
7
7
|
'- You are not using Expo Go\n';
|
package/src/iso18013/index.ts
CHANGED
|
@@ -8,12 +8,12 @@ export {
|
|
|
8
8
|
} from './iso18013-5/schema';
|
|
9
9
|
|
|
10
10
|
const LINKING_ERROR =
|
|
11
|
-
`The package '@pagopa/io-react-native-
|
|
11
|
+
`The package '@pagopa/io-react-native-iso18013' (IoReactNativeIso18013) doesn't seem to be linked. Make sure: \n\n` +
|
|
12
12
|
Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
|
|
13
13
|
'- You rebuilt the app after installing the package\n' +
|
|
14
14
|
'- You are not using Expo Go\n';
|
|
15
15
|
|
|
16
|
-
export const
|
|
16
|
+
export const IoReactNativeIso18013 = NativeModules.IoReactNativeIso18013
|
|
17
17
|
? NativeModules.IoReactNativeIso18013
|
|
18
18
|
: new Proxy(
|
|
19
19
|
{},
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { NativeEventEmitter, Platform } from 'react-native';
|
|
2
|
-
import {
|
|
2
|
+
import { IoReactNativeIso18013 } from '..';
|
|
3
3
|
import type { AcceptedFields } from './schema';
|
|
4
4
|
import type { RequestedDocument } from '../types';
|
|
5
5
|
|
|
6
|
-
const eventEmitter = new NativeEventEmitter(
|
|
6
|
+
const eventEmitter = new NativeEventEmitter(IoReactNativeIso18013);
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Events emitted by the native module:
|
|
@@ -56,9 +56,9 @@ export function start(
|
|
|
56
56
|
const { peripheralMode, centralClientMode, clearBleCache, certificates } =
|
|
57
57
|
config;
|
|
58
58
|
if (Platform.OS === 'ios') {
|
|
59
|
-
return
|
|
59
|
+
return IoReactNativeIso18013.start(certificates ? certificates : []);
|
|
60
60
|
} else {
|
|
61
|
-
return
|
|
61
|
+
return IoReactNativeIso18013.start(
|
|
62
62
|
peripheralMode ? peripheralMode : true,
|
|
63
63
|
centralClientMode ? centralClientMode : false,
|
|
64
64
|
clearBleCache ? clearBleCache : true,
|
|
@@ -71,14 +71,14 @@ export function start(
|
|
|
71
71
|
* Gets the QR code string this method is responsible for initializing the connection and retrieving the QR code string
|
|
72
72
|
*/
|
|
73
73
|
export function getQrCodeString(): Promise<string> {
|
|
74
|
-
return
|
|
74
|
+
return IoReactNativeIso18013.getQrCodeString();
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
/**
|
|
78
78
|
* Closes the QR engagement
|
|
79
79
|
*/
|
|
80
80
|
export function close(): Promise<boolean> {
|
|
81
|
-
return
|
|
81
|
+
return IoReactNativeIso18013.close();
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
/**
|
|
@@ -87,7 +87,7 @@ export function close(): Promise<boolean> {
|
|
|
87
87
|
* @param code - The error code to be sent to the verifier app.
|
|
88
88
|
*/
|
|
89
89
|
export function sendErrorResponse(code: ErrorCode): Promise<boolean> {
|
|
90
|
-
return
|
|
90
|
+
return IoReactNativeIso18013.sendErrorResponse(code);
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
/**
|
|
@@ -100,7 +100,7 @@ export function generateResponse(
|
|
|
100
100
|
documents: Array<RequestedDocument>,
|
|
101
101
|
acceptedFields: AcceptedFields
|
|
102
102
|
): Promise<string> {
|
|
103
|
-
return
|
|
103
|
+
return IoReactNativeIso18013.generateResponse(documents, acceptedFields);
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
/**
|
|
@@ -109,7 +109,7 @@ export function generateResponse(
|
|
|
109
109
|
* @param response - The base64 encoded response to be sent to the verifier app.
|
|
110
110
|
*/
|
|
111
111
|
export function sendResponse(response: string): Promise<boolean> {
|
|
112
|
-
return
|
|
112
|
+
return IoReactNativeIso18013.sendResponse(response);
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IoReactNativeIso18013 } from '..';
|
|
2
2
|
import type { RequestedDocument } from '../types';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -41,7 +41,7 @@ export const generateOID4VPDeviceResponse = async (
|
|
|
41
41
|
documents: Array<RequestedDocument>,
|
|
42
42
|
fieldRequestedAndAccepted: Record<string, any> | string
|
|
43
43
|
): Promise<string> => {
|
|
44
|
-
return await
|
|
44
|
+
return await IoReactNativeIso18013.generateOID4VPDeviceResponse(
|
|
45
45
|
clientId,
|
|
46
46
|
responseUri,
|
|
47
47
|
authorizationRequestNonce,
|