-
Notifications
You must be signed in to change notification settings - Fork 129
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
Ios 14.2(iPhone XR) Dialog NFC scan don't show #23
Comments
I have two testing devices, the "NFC Scanning Window" shows up on one of my devices but not on the other one.
I also tried a native iOS demo app janlionly/NFCReaderWriter, it works on both devices. But for my case, I need to use flutter. I hope this issue can be fixed. |
@kensang Can you provide more detail on this, such as the log before / after the |
@Harry-Chen I just tried to sentry to log my co-worker's result (he is the one using iPhone 11 Pro 14.3), for some reason, this package suddenly works for his phone as well. I am not sure if it's just that there was a mistake with his previous testing or what, but I will let you know what I have done between my previous version and this version just in case: I have done the following:
I then ask my tester with his iPhone 11 Pro 14.3 to do the following:
The result from the tester is that it now works, meaning it can detect the nfc tag id & info correctly. Again, I am not sure if it's a mistake made in previous testing, or is it a re-uploading to testflight, or is it just the "restarting the phone" step. It just works right now. And thank you for your reply. |
@kensang Actually we have encountered some strange behaviour (bug?) with CoreNFC when developing this library, with the similar situation like you described (not responding to
So I believe rebooting is the magic. Who knows :-( |
Rebooting doesnt work for me. I'm running in debug mode, press start polling and i get the platform exception. I reboot device, relaunch the app in debug mode and still same issue. Reboot is not a solution. There is something wrong with your library. |
I have exactly the same issue on iOS 14.2 (iPhone 7 and iPhone SE 2020), also tried out rebooting |
@devnullpointer Did you get the platform exception directly on the first polling attempt? |
Hi @devnullpointer and @mbartn , do you have any reproducers? It would be much appreciated if you could provide a reproducer. |
Hello @dangfan. First of all, thanks for addressing the issue. The steps that I went through
to import 'package:flutter/material.dart';
import 'package:flutter_nfc_kit/flutter_nfc_kit.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Nfc demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(),
);
}
}
class MyHomePage extends StatefulWidget {
MyHomePage({Key key}) : super(key: key);
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
Future<void> _readNfc() async {
print("Starting pooling...");
var tag = await FlutterNfcKit.poll();
print("Got it! $tag");
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Text("Hello world!"),
),
floatingActionButton: FloatingActionButton(
onPressed: _readNfc,
child: Icon(Icons.add),
),
);
}
}
and app did nothing, also didn't react on my NFC chip. As you can see app never reached the
I also checked logs from XCode but looks like there is also nothing helpful printed. |
Thanks @mbartn for providing the valuable reproducer. After some trial and error, I found that adding these lines to Info.plist works:
Another way is to enable ISO14443 only without changing Info.plist:
So I suspect that iOS checks What I have tried:
P.S. device restart is required after testing a non-working scenario due to bug of CoreNFC. In flutter_nfc_kit, the pollingOption passed to iOS by default is [.iso14443, .iso18092, .iso15693] and then CoreNFC might query the Info.plist and found that there are no requested ISO7816 idenfitifers nor FeLiCa system codes and then refuses to show up the scanning window. I am looking at how to make this error visible to user. |
I have submitted the issue to Apple via Feedback Assistant. |
Appreciate your help @jiegec, adding
flags totally solved my issue 👍 |
Happy to see that!
It is unfortunate that CoreNFC failed without reporting the error to user. |
Update: Apple says the bug is resolved. |
Update: the bug has been resolved since iOS 14.6. |
So the removed chunk was fixed 3 years ago, see: nfcim#23 (comment)
In my widget, I call:
print('BEFORE FlutterNfcKit.poll');
var tag = await FlutterNfcKit.poll(
// timeout: Duration(seconds: 600),
iosMultipleTagMessage: "Multiple tags found!",
iosAlertMessage: "Scan your tag");
But dialog NFC scan don't show in iPhone and debug stop at line await FlutterNfcKit.poll(...
Please help me check it
The text was updated successfully, but these errors were encountered: