Skip to content

Commit

Permalink
bump to 3.6.0-rc.4
Browse files Browse the repository at this point in the history
  • Loading branch information
dangfan committed Dec 23, 2024
1 parent 7ba2fd5 commit b16b62b
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 17 deletions.
10 changes: 2 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@
* allow authentication of sector 0 (#157)
* fix data type check in `writeBlock` (#161)

## 3.6.0-rc.2
## 3.6.0-rc.4

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

Expand All @@ -191,11 +191,5 @@ This is a release candidate for 3.6.0. Please test it and report any issues.
* Related issues / PRs: #179 #184, #186, #187
* Now requiring Java 17, Gradle 8.9, MinSDKVer 26, AGP 8.7, Kotlin 2.1.0
* Add Swift package manager support for iOS plugin, bump dependencies

## 3.6.0-rc.3

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

* All 3.6.0-rc.2 changes are included
* Fix WebUSB interop on Web
* Fix WebUSB interop on Web, add onDisconnect callback
* Add support for foreground polling on Android (#16, #179)
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ packages:
path: ".."
relative: true
source: path
version: "3.6.0-rc.3"
version: "3.6.0-rc.4"
flutter_test:
dependency: "direct dev"
description: flutter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class FlutterNfcKitPlugin: NSObject, FlutterPlugin, NFCTagReaderSessionDe
var multipleTagMessage: String?

public static func register(with registrar: FlutterPluginRegistrar) {
let channel = FlutterMethodChannel(name: "flutter_nfc_kit", binaryMessenger: registrar.messenger())
let channel = FlutterMethodChannel(name: "flutter_nfc_kit/method", binaryMessenger: registrar.messenger())
let instance = FlutterNfcKitPlugin()
registrar.addMethodCallDelegate(instance, channel: channel)
}
Expand Down
11 changes: 5 additions & 6 deletions lib/webusb_interop.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,12 @@ extension type _USBControlTransferParameters._(JSObject _) implements JSObject {
class WebUSB {
static dynamic _device;
static String customProbeData = "";
static Function? onDisconnect;

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

static void _onDisconnect() {
_device = null;
log.info('device is disconnected from WebUSB API');
}

static const USB_PROBE_MAGIC = '_NFC_IM_';

/// Try to poll a WebUSB device according to our protocol.
Expand All @@ -82,7 +78,10 @@ class WebUSB {
promiseToFuture(callMethod(device, 'claimInterface', [1])))
.timeout(Duration(milliseconds: timeout));
_device = device;
_USB.ondisconnect = _onDisconnect.toJS;
_USB.ondisconnect = () {
_device = null;
onDisconnect?.call();
}.toJS;
log.info("WebUSB device opened", _device);
} on TimeoutException catch (_) {
log.severe("Polling tag timeout");
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_nfc_kit
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
version: 3.6.0-rc.3
version: 3.6.0-rc.4
homepage: "https://github.com/nfcim/flutter_nfc_kit"

environment:
Expand Down

0 comments on commit b16b62b

Please sign in to comment.