Skip to content

Commit b16b62b

Browse files
committed
bump to 3.6.0-rc.4
1 parent 7ba2fd5 commit b16b62b

File tree

5 files changed

+10
-17
lines changed

5 files changed

+10
-17
lines changed

CHANGELOG.md

+2-8
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@
177177
* allow authentication of sector 0 (#157)
178178
* fix data type check in `writeBlock` (#161)
179179

180-
## 3.6.0-rc.2
180+
## 3.6.0-rc.4
181181

182182
This is a release candidate for 3.6.0. Please test it and report any issues.
183183

@@ -191,11 +191,5 @@ This is a release candidate for 3.6.0. Please test it and report any issues.
191191
* Related issues / PRs: #179 #184, #186, #187
192192
* Now requiring Java 17, Gradle 8.9, MinSDKVer 26, AGP 8.7, Kotlin 2.1.0
193193
* Add Swift package manager support for iOS plugin, bump dependencies
194-
195-
## 3.6.0-rc.3
196-
197-
This is a release candidate for 3.6.0. Please test it and report any issues.
198-
199-
* All 3.6.0-rc.2 changes are included
200-
* Fix WebUSB interop on Web
194+
* Fix WebUSB interop on Web, add onDisconnect callback
201195
* Add support for foreground polling on Android (#16, #179)

example/pubspec.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ packages:
9292
path: ".."
9393
relative: true
9494
source: path
95-
version: "3.6.0-rc.3"
95+
version: "3.6.0-rc.4"
9696
flutter_test:
9797
dependency: "direct dev"
9898
description: flutter

ios/flutter_nfc_kit/Sources/flutter_nfc_kit/FlutterNfcKitPlugin.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public class FlutterNfcKitPlugin: NSObject, FlutterPlugin, NFCTagReaderSessionDe
3737
var multipleTagMessage: String?
3838

3939
public static func register(with registrar: FlutterPluginRegistrar) {
40-
let channel = FlutterMethodChannel(name: "flutter_nfc_kit", binaryMessenger: registrar.messenger())
40+
let channel = FlutterMethodChannel(name: "flutter_nfc_kit/method", binaryMessenger: registrar.messenger())
4141
let instance = FlutterNfcKitPlugin()
4242
registrar.addMethodCallDelegate(instance, channel: channel)
4343
}

lib/webusb_interop.dart

+5-6
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,12 @@ extension type _USBControlTransferParameters._(JSObject _) implements JSObject {
5656
class WebUSB {
5757
static dynamic _device;
5858
static String customProbeData = "";
59+
static Function? onDisconnect;
5960

6061
static bool _deviceAvailable() {
6162
return _device != null && getProperty(_device, 'opened');
6263
}
6364

64-
static void _onDisconnect() {
65-
_device = null;
66-
log.info('device is disconnected from WebUSB API');
67-
}
68-
6965
static const USB_PROBE_MAGIC = '_NFC_IM_';
7066

7167
/// Try to poll a WebUSB device according to our protocol.
@@ -82,7 +78,10 @@ class WebUSB {
8278
promiseToFuture(callMethod(device, 'claimInterface', [1])))
8379
.timeout(Duration(milliseconds: timeout));
8480
_device = device;
85-
_USB.ondisconnect = _onDisconnect.toJS;
81+
_USB.ondisconnect = () {
82+
_device = null;
83+
onDisconnect?.call();
84+
}.toJS;
8685
log.info("WebUSB device opened", _device);
8786
} on TimeoutException catch (_) {
8887
log.severe("Polling tag timeout");

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: flutter_nfc_kit
22
description: Provide NFC functionality on Android, iOS & Web, including reading metadata, read & write NDEF records, and transceive layer 3 & 4 data with NFC tags / cards
3-
version: 3.6.0-rc.3
3+
version: 3.6.0-rc.4
44
homepage: "https://github.com/nfcim/flutter_nfc_kit"
55

66
environment:

0 commit comments

Comments
 (0)