New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to stop showing "New tag scanned" page on android #50
Comments
hello, any update on this? How can we prevent Android native app or any other app from reading NFC tag when tag is being read by Flutter app using this plugin? I have seen ways to do this in Android apps using enableForegroundDispatch. I am not sure if this plugin uses that internally or is there another way for Flutter to prevent other apps on the device from getting the read NFC tag when a flutter app with this plugin is reading NFC tags. Thanks. |
Plus one for me ! Any solution |
I found that api.dart file in this plugin has method to use ForegroundDispatch instead of readerMode. I tried using that along with appropriate intent filter in AndroidManifest.xml and it did work, NFC content was passed only to my app. Currently the plugin hardcodes to using ReaderMode assuming this will only pass the discovered NFC tag to the app. However it seems on Android 10, that is not true. See discussion here https://stackoverflow.com/questions/33633736/whats-the-difference-between-enablereadermode-and-enableforegrounddispatch |
Hmm, that is a good starter. How to get rid of the "No supported application for this NFC tag" toast on Android 10? |
Plus one for me as well. This can be very annoying to customers. |
Calling read operations with the readerMode Example:
🚀 |
One way to avoid the default "New tag scanned" popup is to run a continuous background read when the application starts/resumes (application is in the foreground). Keep ignoring any tags read when they are not desired. When desired on a particular page process the tag read. Or one can stop the continuous background read started when the application started/resumed and start another one-time tag read operation when desired at a certain place in the application. Once done, again start the background read so that undesired tags are not read by system or any other application on the phone. Note: in both cases, one needs to read the tags with NFCDispatchReaderMode to tell Android that any NFC tag detected needs to be passed to this application only. The current plugin hardcodes the use of Normal mode, so one can clone the plugin into a separate repository and make changes to use the desired mode and use this new repository in the project. Here is an example code: Call _readNFCAndroid when the app starts or resumes. Call _stopNFC when app is closed or paused. Note: I have cloned the plugin and created a new method in it "readNDEFDispatch". This one is the same as the existing one "readNDEF" except for this new one uses NFCDispatchReaderMode. StreamSubscription _nfcStream;
} _stopNFC() { |
@OverRide
add this in your main activity class. this will prevent android default nfc popup screen |
Hello, Could some one tell if there a 100% worked solution of these and how to apply it? Thanks |
If you use the once: false option that should do the job, but I found that by using a URI, you can use the background NFC function as well to get it to point to the app to prevent it from popping up the New Tag Scanned when the multi scan is not active. |
I'm scanning the tag once through my to do a certain action , but the problem is that it scanned once and do the action then when you get the phone away from the tag the background NFC detect the tag again and open the content of it , the content in my case is a haskey , I'll try the once : false as in my case its only one tag no matter to read it again |
is there any solution for this issue? |
https://stackoverflow.com/questions/76443776/how-can-i-prevent-the-default-new-tag-scanned-pop-up-using-the-nfc-manager-p/77357058#77357058 please check this link.it worked for me |
On android (Samsung S8), when successfully scan a NFC tag with text record, there is a seperate view showing "New tag scanned" with the tag message, how can I stop it from showing?
It turns out this is the system's default behaviour of showing whatever user scan
The text was updated successfully, but these errors were encountered: