@pagopa/io-react-native-iso18013 0.6.0 → 0.8.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/IoReactNativeIso18013.podspec +1 -1
- package/README.md +1 -1
- package/android/build.gradle +3 -2
- package/android/src/main/AndroidManifest.xml +17 -0
- package/android/src/main/AndroidManifestNew.xml +17 -0
- package/android/src/main/java/com/ioreactnativeiso18013/Enums.kt +42 -0
- package/android/src/main/java/com/ioreactnativeiso18013/IoNfcEngagementService.kt +17 -0
- package/android/src/main/java/com/ioreactnativeiso18013/IoReactNativeIso18013Module.kt +329 -137
- package/android/src/main/res/values/strings.xml +5 -0
- package/android/src/main/res/xml/nfc_engagement_apdu_service.xml +9 -0
- package/android/src/test/java/com/ioreactnativeiso18013/IoReactNativeIso18013Test.kt +11 -13
- package/ios/IoReactNativeIso18013.mm +8 -9
- package/ios/IoReactNativeIso18013.swift +264 -191
- package/lib/module/cbor/cbor/README.md +2 -1
- package/lib/module/cbor/cose/README.md +6 -4
- package/lib/module/iso18013/iso18013-5/README.md +161 -41
- package/lib/module/iso18013/iso18013-5/error.js +1 -3
- package/lib/module/iso18013/iso18013-5/error.js.map +1 -1
- package/lib/module/iso18013/iso18013-5/index.js +1 -1
- package/lib/module/iso18013/iso18013-5/index.js.map +1 -1
- package/lib/module/iso18013/iso18013-5/proximity.js +29 -19
- package/lib/module/iso18013/iso18013-5/proximity.js.map +1 -1
- package/lib/module/iso18013/iso18013-7/README.md +1 -1
- package/lib/typescript/src/iso18013/iso18013-5/error.d.ts +4 -4
- package/lib/typescript/src/iso18013/iso18013-5/error.d.ts.map +1 -1
- package/lib/typescript/src/iso18013/iso18013-5/index.d.ts +1 -1
- package/lib/typescript/src/iso18013/iso18013-5/index.d.ts.map +1 -1
- package/lib/typescript/src/iso18013/iso18013-5/proximity.d.ts +32 -13
- package/lib/typescript/src/iso18013/iso18013-5/proximity.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/cbor/cbor/README.md +2 -1
- package/src/cbor/cose/README.md +6 -4
- package/src/iso18013/iso18013-5/README.md +161 -41
- package/src/iso18013/iso18013-5/error.ts +0 -2
- package/src/iso18013/iso18013-5/index.ts +3 -2
- package/src/iso18013/iso18013-5/proximity.ts +52 -23
- package/src/iso18013/iso18013-7/README.md +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<host-apdu-service xmlns:android="http://schemas.android.com/apk/res/android"
|
|
3
|
+
android:description="@string/nfc_engagement_service_desc"
|
|
4
|
+
android:requireDeviceUnlock="true">
|
|
5
|
+
<aid-group android:description="@string/nfc_engagement_aid_group_desc" android:category="other">
|
|
6
|
+
<aid-filter android:name="D2760000850101" />
|
|
7
|
+
<aid-filter android:name="A0000002480400" />
|
|
8
|
+
</aid-group>
|
|
9
|
+
</host-apdu-service>
|
|
@@ -414,6 +414,17 @@ class IoReactNativeIso18013Test {
|
|
|
414
414
|
assert(result == "{}")
|
|
415
415
|
}
|
|
416
416
|
|
|
417
|
+
@Test
|
|
418
|
+
fun `should parse a map with a credential type but without any namespace nor values`() {
|
|
419
|
+
val nativeMap = JavaOnlyMap.of(
|
|
420
|
+
"org.iso.18013.5.1.mDL",
|
|
421
|
+
JavaOnlyMap()
|
|
422
|
+
)
|
|
423
|
+
val result = IoReactNativeIso18013Module.parseAcceptedFields(nativeMap)
|
|
424
|
+
print(result)
|
|
425
|
+
assert(result == "{org.iso.18013.5.1.mDL={}}")
|
|
426
|
+
}
|
|
427
|
+
|
|
417
428
|
@Test
|
|
418
429
|
fun `should throw an IllegalArgumentException if the credential type is not a map`() {
|
|
419
430
|
val nativeMap = JavaOnlyMap.of(
|
|
@@ -450,19 +461,6 @@ class IoReactNativeIso18013Test {
|
|
|
450
461
|
}
|
|
451
462
|
}
|
|
452
463
|
|
|
453
|
-
@Test
|
|
454
|
-
fun `should throw an IllegalArgumentException if no namespace are provided for the credential`() {
|
|
455
|
-
val nativeMap = JavaOnlyMap.of(
|
|
456
|
-
"org.iso.18013.5.1.mDL",
|
|
457
|
-
JavaOnlyMap()
|
|
458
|
-
)
|
|
459
|
-
assertThrows(
|
|
460
|
-
IllegalArgumentException::class.java
|
|
461
|
-
) {
|
|
462
|
-
IoReactNativeIso18013Module.parseAcceptedFields(nativeMap)
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
|
|
466
464
|
@Test
|
|
467
465
|
fun `should throw an IllegalArgumentException if no fields are provided for the namespace`() {
|
|
468
466
|
val nativeMap = JavaOnlyMap.of(
|
|
@@ -3,24 +3,23 @@
|
|
|
3
3
|
|
|
4
4
|
@interface RCT_EXTERN_MODULE(IoReactNativeIso18013, RCTEventEmitter)
|
|
5
5
|
|
|
6
|
-
RCT_EXTERN_METHOD(
|
|
6
|
+
RCT_EXTERN_METHOD(startEngagement:(NSArray *)certificates
|
|
7
|
+
withEngagementModes:(NSArray *)engagementModes
|
|
8
|
+
withRetrievalMethods:(NSArray *)retrievalMethods
|
|
7
9
|
withResolver:(RCTPromiseResolveBlock)resolve
|
|
8
10
|
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
9
11
|
|
|
10
|
-
RCT_EXTERN_METHOD(getQrCodeString:(RCTPromiseResolveBlock)resolve
|
|
11
|
-
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
12
|
-
|
|
13
12
|
RCT_EXTERN_METHOD(close:(RCTPromiseResolveBlock)resolve
|
|
14
13
|
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
15
14
|
|
|
16
15
|
RCT_EXTERN_METHOD(generateResponse:(NSArray *)documents
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
withAcceptedFields:(NSDictionary *)acceptedFields
|
|
17
|
+
withResolver:(RCTPromiseResolveBlock)resolve
|
|
18
|
+
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
20
19
|
|
|
21
20
|
RCT_EXTERN_METHOD(sendResponse:(NSString *)response
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
withResolver:(RCTPromiseResolveBlock)resolve
|
|
22
|
+
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
24
23
|
|
|
25
24
|
RCT_EXTERN_METHOD(sendErrorResponse:(NSInteger *)code
|
|
26
25
|
withResolver:(RCTPromiseResolveBlock)resolve
|