react-native-nfc-manager 3.15.0 → 3.16.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/index.d.ts +7 -0
- package/ios/NfcManager+Iso15693.m +38 -0
- package/package.json +10 -10
- package/src/NfcManagerIOS.js +6 -0
- package/src/NfcTech/Iso15693HandlerIOS.js +8 -0
- package/src/__mocks__/NativeNfcManager.js +0 -1
- package/CHANGELOG.md +0 -98
package/index.d.ts
CHANGED
|
@@ -204,6 +204,11 @@ declare module 'react-native-nfc-manager' {
|
|
|
204
204
|
flags: number;
|
|
205
205
|
blockNumber: number;
|
|
206
206
|
}) => Promise<number[]>;
|
|
207
|
+
extendedReadMultipleBlocks: (params: {
|
|
208
|
+
flags: number;
|
|
209
|
+
blockNumber: number;
|
|
210
|
+
blockCount: number;
|
|
211
|
+
}) => Promise<number[][]>;
|
|
207
212
|
extendedWriteSingleBlock: (params: {
|
|
208
213
|
flags: number;
|
|
209
214
|
blockNumber: number;
|
|
@@ -252,6 +257,8 @@ declare module 'react-native-nfc-manager' {
|
|
|
252
257
|
setAlertMessageIOS: (alertMessage: string) => Promise<void>;
|
|
253
258
|
invalidateSessionIOS: () => Promise<void>;
|
|
254
259
|
invalidateSessionWithErrorIOS: (errorMessage: string) => Promise<void>;
|
|
260
|
+
isSessionAvailableIOS: () => Promise<Boolean>;
|
|
261
|
+
isTagSessionAvailableIOS: () => Promise<Boolean>;
|
|
255
262
|
sendMifareCommandIOS: (bytes: number[]) => Promise<number[]>;
|
|
256
263
|
sendFelicaCommandIOS: (bytes: number[]) => Promise<number[]>;
|
|
257
264
|
sendCommandAPDUIOS: (
|
|
@@ -493,6 +493,44 @@ RCT_EXPORT_METHOD(iso15693_extendedReadSingleBlock:(NSDictionary *)options callb
|
|
|
493
493
|
}
|
|
494
494
|
}
|
|
495
495
|
|
|
496
|
+
RCT_EXPORT_METHOD(iso15693_extendedReadMultipleBlocks:(NSDictionary *)options callback:(nonnull RCTResponseSenderBlock)callback)
|
|
497
|
+
{
|
|
498
|
+
if (@available(iOS 14.0, *)) {
|
|
499
|
+
if (![self tagSession] || ![self tagSession].connectedTag) {
|
|
500
|
+
callback(@[@"Not connected", [NSNull null]]);
|
|
501
|
+
return;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
id<NFCISO15693Tag> tag = [[self tagSession].connectedTag asNFCISO15693Tag];
|
|
505
|
+
if (!tag) {
|
|
506
|
+
callback(@[@"incorrect tag type", [NSNull null]]);
|
|
507
|
+
return;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
RequestFlag flags = [[options objectForKey:@"flags"] unsignedIntValue];
|
|
511
|
+
NSRange blockRange = NSMakeRange(
|
|
512
|
+
[[options objectForKey:@"blockNumber"] unsignedIntValue],
|
|
513
|
+
[[options objectForKey:@"blockCount"] unsignedIntValue]
|
|
514
|
+
);
|
|
515
|
+
|
|
516
|
+
[tag extendedReadMultipleBlocksWithRequestFlags:flags
|
|
517
|
+
blockRange:blockRange
|
|
518
|
+
completionHandler:^(NSArray<NSData *> *dataBlocks, NSError *error) {
|
|
519
|
+
if (error) {
|
|
520
|
+
callback(@[getErrorMessage(error), [NSNull null]]);
|
|
521
|
+
return;
|
|
522
|
+
}
|
|
523
|
+
NSMutableArray *blocks = [NSMutableArray arrayWithCapacity:[dataBlocks count]];
|
|
524
|
+
[dataBlocks enumerateObjectsUsingBlock:^(NSData *blockData, NSUInteger idx, BOOL *stop) {
|
|
525
|
+
[blocks addObject:dataToArray(blockData)];
|
|
526
|
+
}];
|
|
527
|
+
callback(@[[NSNull null], blocks]);
|
|
528
|
+
}];
|
|
529
|
+
} else {
|
|
530
|
+
callback(@[@"Not support in this device", [NSNull null]]);
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
|
|
496
534
|
RCT_EXPORT_METHOD(iso15693_extendedWriteSingleBlock:(NSDictionary *)options callback:(nonnull RCTResponseSenderBlock)callback)
|
|
497
535
|
{
|
|
498
536
|
if (@available(iOS 14.0, *)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-nfc-manager",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.16.0",
|
|
4
4
|
"description": "A NFC module for react native.",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"repository": {
|
|
@@ -49,25 +49,25 @@
|
|
|
49
49
|
"@babel/plugin-transform-runtime": "^7.12.10",
|
|
50
50
|
"@babel/preset-env": "^7.12.11",
|
|
51
51
|
"@babel/preset-react": "^7.12.10",
|
|
52
|
-
"@react-native-community/eslint-config": "^2.0
|
|
53
|
-
"@release-it/conventional-changelog": "^
|
|
54
|
-
"dotenv-cli": "^4.
|
|
55
|
-
"eslint": "^
|
|
56
|
-
"jest": "^
|
|
57
|
-
"jest-cli": "^
|
|
52
|
+
"@react-native-community/eslint-config": "^3.2.0",
|
|
53
|
+
"@release-it/conventional-changelog": "^8.0.1",
|
|
54
|
+
"dotenv-cli": "^7.4.2",
|
|
55
|
+
"eslint": "^8.57.0",
|
|
56
|
+
"jest": "^29.7.0",
|
|
57
|
+
"jest-cli": "^29.7.0",
|
|
58
58
|
"prettier": "^2.2.1",
|
|
59
59
|
"react": "^16.13.1",
|
|
60
60
|
"react-native": "^0.63.0",
|
|
61
|
-
"release-it": "^
|
|
61
|
+
"release-it": "^17.5.0",
|
|
62
62
|
"typescript": "^4.1.3"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@expo/config-plugins": "~
|
|
65
|
+
"@expo/config-plugins": "~8.0.0"
|
|
66
66
|
},
|
|
67
67
|
"scripts": {
|
|
68
68
|
"lint": "eslint .",
|
|
69
69
|
"lint:fix": "eslint --fix .",
|
|
70
70
|
"test": "jest -i",
|
|
71
|
-
"release": "dotenv release-it --"
|
|
71
|
+
"release": "dotenv -- release-it --"
|
|
72
72
|
}
|
|
73
73
|
}
|
package/src/NfcManagerIOS.js
CHANGED
|
@@ -91,6 +91,12 @@ class NfcManagerIOS extends NfcManagerBase {
|
|
|
91
91
|
callNative('invalidateSessionWithError', [errorMessage]),
|
|
92
92
|
);
|
|
93
93
|
|
|
94
|
+
isSessionAvailableIOS = async () =>
|
|
95
|
+
handleNativeException(callNative('isSessionAvailable'));
|
|
96
|
+
|
|
97
|
+
isTagSessionAvailableIOS = async () =>
|
|
98
|
+
handleNativeException(callNative('isTagSessionAvailable'));
|
|
99
|
+
|
|
94
100
|
// -------------------------------------
|
|
95
101
|
// (iOS) NfcTech.MifareIOS API
|
|
96
102
|
// -------------------------------------
|
|
@@ -113,6 +113,14 @@ class Iso15693HandlerIOS {
|
|
|
113
113
|
);
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
+
extendedReadMultipleBlocks({flags, blockNumber, blockCount}) {
|
|
117
|
+
return handleNativeException(
|
|
118
|
+
callNative('iso15693_extendedReadMultipleBlocks', [
|
|
119
|
+
{flags, blockNumber, blockCount},
|
|
120
|
+
]),
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
|
|
116
124
|
extendedWriteSingleBlock({flags, blockNumber, dataBlock}) {
|
|
117
125
|
return handleNativeException(
|
|
118
126
|
callNative('iso15693_extendedWriteSingleBlock', [
|
|
@@ -22,7 +22,6 @@ const NfcManagerEmitter = {
|
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
const callNative = jest.fn((...args) => {
|
|
25
|
-
// eslint-disable-next-line no-unused-vars
|
|
26
25
|
const [methodName, ...rest] = args;
|
|
27
26
|
if (_nextError && (!methodName || methodName === _nextErrorMethod)) {
|
|
28
27
|
const err = _nextError;
|
package/CHANGELOG.md
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
## [3.0.2](https://github.com/whitedogg13/react-native-nfc-manager/compare/v3.0.1...v3.0.2) (2021-02-22)
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
### Features
|
|
5
|
-
|
|
6
|
-
* **android:** allow requestTechnology resolves to tags even when tech ([8b7f862](https://github.com/whitedogg13/react-native-nfc-manager/commit/8b7f8629a8e46304f2a68d62f01e745047fe01dc))
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
## [3.0.1](https://github.com/whitedogg13/react-native-nfc-manager/compare/v3.0.0...v3.0.1) (2021-02-20)
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
### Bug Fixes
|
|
14
|
-
|
|
15
|
-
* [#371](https://github.com/whitedogg13/react-native-nfc-manager/issues/371) missing MIFARE_BLOCK_SIZE for mifareClassicHandlerAndroid ([b136419](https://github.com/whitedogg13/react-native-nfc-manager/commit/b1364197c80ab16542bbb823483a2079a896e169))
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
# [3.0.0](https://github.com/whitedogg13/react-native-nfc-manager/compare/v3.0.0-0...v3.0.0) (2021-02-18)
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
### Features
|
|
23
|
-
|
|
24
|
-
* expose RTD_URI_PROTOCOLS ([26516a7](https://github.com/whitedogg13/react-native-nfc-manager/commit/26516a7ce8309ade21464df13a8e5c799c0e417c))
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
# [3.0.0-0](https://github.com/whitedogg13/react-native-nfc-manager/compare/v2.0.0-beta.1...v3.0.0-0) (2021-02-10)
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
### Bug Fixes
|
|
32
|
-
|
|
33
|
-
* disable 18092 polling (cause iOS freeze) ([64115f8](https://github.com/whitedogg13/react-native-nfc-manager/commit/64115f80f8cd93ed5ef3b01987d6c628a5a9127b))
|
|
34
|
-
* **ios:** add polling for iso18092 ([b7984a5](https://github.com/whitedogg13/react-native-nfc-manager/commit/b7984a59ea27076d7fd34a2614592f468c80f5e1))
|
|
35
|
-
* add callback type null possible ([1371533](https://github.com/whitedogg13/react-native-nfc-manager/commit/13715334ea908b89654b42eba4ec902bcc6f4229))
|
|
36
|
-
* cancelTechnology might cause exception if there's a connected tag ([af2f1f9](https://github.com/whitedogg13/react-native-nfc-manager/commit/af2f1f92bbd7bfcf8c604db48b790289c3ca4946))
|
|
37
|
-
* cancelTechnology might cause exception if there's a connected tag ([dcb26b8](https://github.com/whitedogg13/react-native-nfc-manager/commit/dcb26b85a955ce17ae633e00f6f189a895e8adcb))
|
|
38
|
-
* getNdefMessage should use the same structure for platforms ([73859fb](https://github.com/whitedogg13/react-native-nfc-manager/commit/73859fbac8939277f1e7fc2ad13ececee8c9d4c7))
|
|
39
|
-
* import NfcManager from new location ([c95cc76](https://github.com/whitedogg13/react-native-nfc-manager/commit/c95cc76a0a3b52c751c1a0f00895cf1b34b66b28))
|
|
40
|
-
* ios isSupported ([adcc966](https://github.com/whitedogg13/react-native-nfc-manager/commit/adcc966c8ed4a565c2800fabc5e5a0cad07ea376))
|
|
41
|
-
* promise won't be rejected when calling cancelTechnologyRequest in ([64c9cbd](https://github.com/whitedogg13/react-native-nfc-manager/commit/64c9cbd05e34e975fa4744727859efd08ea610bf))
|
|
42
|
-
* reject tech request promise when native iOS cancel button is pressed ([7915b98](https://github.com/whitedogg13/react-native-nfc-manager/commit/7915b98132cf5c6f86eb96dfe242b67bef32e8a7))
|
|
43
|
-
* remove getNdefMessage's parameter declaration ([6fc257e](https://github.com/whitedogg13/react-native-nfc-manager/commit/6fc257e61e1da5600a7aac44d9a8a97a7ecc988c))
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
### Features
|
|
47
|
-
|
|
48
|
-
* extract more NfcTech handlers ([0032408](https://github.com/whitedogg13/react-native-nfc-manager/commit/0032408af21cafa3f5f92c16083f914325450524))
|
|
49
|
-
* **android:** getNdefStatus ([4cc68ce](https://github.com/whitedogg13/react-native-nfc-manager/commit/4cc68ce233d81c03760b791fc2f568fe4b8415c4))
|
|
50
|
-
* **ios:** enhance didDetectTags and add queryNDEFStatus / makeReadOnly ([32dd3be](https://github.com/whitedogg13/react-native-nfc-manager/commit/32dd3be2968abbe095ae42fd12793a9a8c0725c6))
|
|
51
|
-
* invalidateSessionWithErrorIOS ([c631110](https://github.com/whitedogg13/react-native-nfc-manager/commit/c631110b6454c08821607014a28b8dffb20fe8b0))
|
|
52
|
-
* ios 13 ndef read and write ([31a3ae6](https://github.com/whitedogg13/react-native-nfc-manager/commit/31a3ae6e141e41f3f36a102d5c2bb5ce04ba78a5))
|
|
53
|
-
* requestTechnology support multi-techs ([65e8f02](https://github.com/whitedogg13/react-native-nfc-manager/commit/65e8f02b83820cb72e65c8443a607b6dca2c8fae))
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
# [2.0.0-beta.1](https://github.com/whitedogg13/react-native-nfc-manager/compare/0.0.9...v2.0.0-beta.1) (2019-07-13)
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
### Bug Fixes
|
|
61
|
-
|
|
62
|
-
* call the correct method `mifareUltralightReadPages` (notice the tailing s) ([60feee8](https://github.com/whitedogg13/react-native-nfc-manager/commit/60feee88c2d20bc18af23b3abb6d8cb22fe17e16))
|
|
63
|
-
* ios crash on registerTagEvent ([e654d93](https://github.com/whitedogg13/react-native-nfc-manager/commit/e654d9359751327284d20b3bee1139c78657dcb4))
|
|
64
|
-
* MifareClassic should also support `transceive` ([dd4a902](https://github.com/whitedogg13/react-native-nfc-manager/commit/dd4a902257a402e5d6d3eae8bd43f9d37c03928b))
|
|
65
|
-
* use non-cached ndef for getNdefMessage API ([49f8541](https://github.com/whitedogg13/react-native-nfc-manager/commit/49f85415a5bc6d0218992dc6ba2b9303cee8e3ac))
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
### Features
|
|
69
|
-
|
|
70
|
-
* mifareultralight support ([4a53a13](https://github.com/whitedogg13/react-native-nfc-manager/commit/4a53a135c594ef340927ae053dfc142ebfd0b9b6))
|
|
71
|
-
* support `getMaxTransceiveLength` and `setTimeout` ([e759c39](https://github.com/whitedogg13/react-native-nfc-manager/commit/e759c399008e9060ae6f5fe23d7b31a61b1f8037))
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
## [0.0.9](https://github.com/whitedogg13/react-native-nfc-manager/compare/0.0.8...0.0.9) (2018-01-02)
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
## [0.0.8](https://github.com/whitedogg13/react-native-nfc-manager/compare/0.0.7...0.0.8) (2017-12-09)
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
## [0.0.7](https://github.com/whitedogg13/react-native-nfc-manager/compare/0.0.6...0.0.7) (2017-12-04)
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
## [0.0.6](https://github.com/whitedogg13/react-native-nfc-manager/compare/0.0.3...0.0.6) (2017-11-17)
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
## [0.0.3](https://github.com/whitedogg13/react-native-nfc-manager/compare/0.0.2...0.0.3) (2017-09-27)
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
## 0.0.2 (2017-08-01)
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|