react-native-nfc-manager 3.14.14 → 3.15.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 +2 -0
- package/ios/NfcManager.m +6 -0
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -277,6 +277,8 @@ declare module 'react-native-nfc-manager' {
|
|
|
277
277
|
transceive(bytes: number[]): Promise<number[]>;
|
|
278
278
|
getMaxTransceiveLength(): Promise<number>;
|
|
279
279
|
setTimeout(timeout: number): Promise<void>;
|
|
280
|
+
connect: (techs: NfcTech[]) => Promise<void>;
|
|
281
|
+
close: () => Promise<void>;
|
|
280
282
|
mifareClassicHandlerAndroid: MifareClassicHandlerAndroid;
|
|
281
283
|
mifareUltralightHandlerAndroid: MifareUltralightHandlerAndroid;
|
|
282
284
|
ndefFormatableHandlerAndroid: NdefFormatableHandlerAndroid;
|
package/ios/NfcManager.m
CHANGED
|
@@ -326,6 +326,7 @@ RCT_EXPORT_METHOD(cancelTechnologyRequest:(nonnull RCTResponseSenderBlock)callba
|
|
|
326
326
|
if (@available(iOS 13.0, *)) {
|
|
327
327
|
if (tagSession != nil) {
|
|
328
328
|
[tagSession invalidateSession];
|
|
329
|
+
tagSession = nil;
|
|
329
330
|
callback(@[]);
|
|
330
331
|
} else {
|
|
331
332
|
callback(@[@"Not even registered", [NSNull null]]);
|
|
@@ -357,6 +358,7 @@ RCT_EXPORT_METHOD(unregisterTagEvent:(nonnull RCTResponseSenderBlock)callback)
|
|
|
357
358
|
if (@available(iOS 11.0, *)) {
|
|
358
359
|
if (session != nil) {
|
|
359
360
|
[session invalidateSession];
|
|
361
|
+
session = nil;
|
|
360
362
|
callback(@[]);
|
|
361
363
|
} else {
|
|
362
364
|
callback(@[@"Not even registered", [NSNull null]]);
|
|
@@ -371,9 +373,11 @@ RCT_EXPORT_METHOD(invalidateSession:(nonnull RCTResponseSenderBlock)callback)
|
|
|
371
373
|
if (@available(iOS 13.0, *)) {
|
|
372
374
|
if (session != nil) {
|
|
373
375
|
[session invalidateSession];
|
|
376
|
+
session = nil;
|
|
374
377
|
callback(@[]);
|
|
375
378
|
} else if (tagSession != nil) {
|
|
376
379
|
[tagSession invalidateSession];
|
|
380
|
+
tagSession = nil;
|
|
377
381
|
callback(@[]);
|
|
378
382
|
} else {
|
|
379
383
|
callback(@[@"No active session", [NSNull null]]);
|
|
@@ -386,9 +390,11 @@ RCT_EXPORT_METHOD(invalidateSessionWithError:(NSString *)errorMessage callback:(
|
|
|
386
390
|
if (@available(iOS 13.0, *)) {
|
|
387
391
|
if (session != nil) {
|
|
388
392
|
[session invalidateSessionWithErrorMessage: errorMessage];
|
|
393
|
+
session = nil;
|
|
389
394
|
callback(@[]);
|
|
390
395
|
} else if (tagSession != nil) {
|
|
391
396
|
[tagSession invalidateSessionWithErrorMessage: errorMessage];
|
|
397
|
+
tagSession = nil;
|
|
392
398
|
callback(@[]);
|
|
393
399
|
} else {
|
|
394
400
|
callback(@[@"No active session", [NSNull null]]);
|