dukhanov / flutter-nfc-plugin Goto Github PK
View Code? Open in Web Editor NEWThe Flutter NFC plugin allows you to read NFC state and tags
License: MIT License
The Flutter NFC plugin allows you to read NFC state and tags
License: MIT License
please, can you change to null safety? it's very quick in your project
thanks
Try to merge the example app in mine, but there is this error:
nfc_plugin/Utils.kt: (100, 23): Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type Tag?
The example app instead works perfectly. Might you know how to solve the bug?
Thanks
[VERBOSE-2:ui_dart_state.cc(148)] Unhandled Exception: MissingPluginException(No implementation found for method getNfcState on channel nfc_plugin_method_channel)
#0 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:314:7)
#1 NfcPlugin.nfcState (package:flutter_nfc_plugin/nfc_plugin.dart:29:8)
#2 _MyAppState.initPlatformState (package:nfc_plugin_example/main.dart:38:35)
#3 _MyAppState.initState (package:nfc_plugin_example/main.dart:31:5)
#4 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4033:58)
#5 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3902:5)
#6 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3084:14)
#7 Element.updateChild (package:flutter/src/widgets/framework.dart:2887:12)
#8 RenderObjectToWidgetElement._rebuild (package:flutter/src/widgets/binding.dart:939:16)
Hi!
If I open my Android app, and send it to the background, the onNfcMessage event doesn't fire when scanning an NFC tag. The app opens as expected, but the event deosn't fire.
Everything works fine if the app is not running when scanning the tag, as it checks the "nfcStartedWith".
If I scan the tag while the app is open, everything also works just fine.
Any suggestions of what could be wrong?
Hi, i' m trying to read an nfc card wich has not any message and the error i get is:
D/FlutterNfcPlugin( 6804): callback: onTagDiscovered {error=Cannot parse NDEF message: java.lang.IllegalStateException: ndef must not be null, message=null}
In other android applications in play store, i can get the tag id (serial number) although the tag has no messages (null).
How can i implement this?
Thanks!
Started getting this warning after updating to Flutter 2.5
The plugin `flutter_nfc_plugin` uses a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to see if this plugin supports the Android V2 embedding. Otherwise, consider removing it since a future release of Flutter will remove these deprecated APIs.
If you are plugin author, take a look at the docs for migrating the plugin to the V2 embedding: https://flutter.dev/go/android-plugin-migration.
D/FlutterNfcPlugin(26466): callback: onTagDiscovered {error=Cannot parse NDEF message: java.lang.IllegalStateException: ndef must not be null, message=null}
W/Binder (26466): Caught a RuntimeException from the binder stub implementation.
W/Binder (26466): java.lang.RuntimeException: Methods marked with @UiThread must be executed on the main thread. Current thread: Binder:26466_3
W/Binder (26466): at io.flutter.embedding.engine.FlutterJNI.ensureRunningOnMainThread(FlutterJNI.java:605)
W/Binder (26466): at io.flutter.embedding.engine.FlutterJNI.dispatchPlatformMessage(FlutterJNI.java:515)
W/Binder (26466): at io.flutter.embedding.engine.dart.DartMessenger.send(DartMessenger.java:76)
W/Binder (26466): at io.flutter.embedding.engine.dart.DartExecutor.send(DartExecutor.java:151)
W/Binder (26466): at io.flutter.view.FlutterNativeView.send(FlutterNativeView.java:144)
W/Binder (26466): at io.flutter.plugin.common.EventChannel$IncomingStreamRequestHandler$EventSinkImplementation.success(EventChannel.java:226)
W/Binder (26466): at it.dukhanov.flutter.nfc_plugin.NfcPlugin.sendNfcListenerCallback(NfcPlugin.kt:92)
W/Binder (26466): at it.dukhanov.flutter.nfc_plugin.NfcPlugin.onTagDiscovered(NfcPlugin.kt:82)
W/Binder (26466): at android.nfc.NfcActivityManager.onTagDiscovered(NfcActivityManager.java:447)
W/Binder (26466): at android.nfc.IAppCallback$Stub.onTransact(IAppCallback.java:126)
W/Binder (26466): at android.os.Binder.execTransactInternal(Binder.java:1021)
W/Binder (26466): at android.os.Binder.execTransact(Binder.java:994)
Apple has launched iOS 16.1 which allows deleting wallet meaning they allow other developers to access the API
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.