You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Flutter iOS端NFC扫描异常:仅显示扫描动画无法识别标签

iOS端使用nfc_manager无法识别NFC标签的问题排查

问题现象

  • 使用nfc_manager: ^3.2.0包扫描NFC标签,Android端运行正常,但iOS端仅显示准备扫描动画,无法识别任何设备。

已尝试的解决措施

  • 修改info.plist多项配置,甚至直接使用该包示例项目中的完整info.plist文件;
  • 设置pollingOptions: {NfcPollingOption.iso14443, NfcPollingOption.iso15693};
  • 已确认开启NFC权限。

Flutter环境信息

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.7.11, on macOS 13.3.1 22E772610a darwin-arm64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 14.3)
[✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] Android Studio (version 2022.1)
[✓] VS Code (version 1.77.1)
[✓] Connected device (2 available)
[✓] HTTP Host Availability

! Doctor found issues in 1 category.

相关代码片段

class NfcEnableWidget extends StatefulWidget {
  final BuildContext contextParent;
  const NfcEnableWidget({Key? key, required this.contextParent})
      : super(key: key);

  @override
  _NfcEnableWidgetState createState() => _NfcEnableWidgetState();
}

class _NfcEnableWidgetState extends State<NfcEnableWidget> {
  @override
  void initState() {
    super.initState();
    NfcManager.instance.startSession(
      
  // Here.  NOTE: all options are specified by default.
  //pollingOptions: {NfcPollingOption.iso14443, NfcPollingOption.iso15693},
      onDiscovered: (tag) async {
        // Do something with the valid tag data
        final result = await widget.contextParent
            .read<TagOnBoardingCubit>()
            .checkNfcCode(tag);
        if (result != null) {
          ScaffoldMessenger.of(widget.contextParent).showSnackBar(
            SnackBar(
              content: Text(result),
            ),
          );
        }
      },
    );
  }

现状

已为此问题排查数周,仍未找到解决办法。

内容的提问来源于stack exchange,提问作者AndreCoelhoo

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.11 09:32:09