Skip to content

[iOS] Channel sent a message from native to Flutter on a non-platform thread #245

@steven11329

Description

@steven11329

nfc_manager works fine on Android.
But I get error message when scan our company NFC tag on iOS as follow.

Step

  1. Click button to detect an NFC tag
  2. I get the first error

The 'dev.flutter.pigeon.nfc_manager.FlutterApiPigeon.tagSessionDidBecomeActive' channel sent a message from native to Flutter on a non-platform thread. ...

  1. The UI shows a dialog
Image
  1. When the scan is finished, I get a second error:

The 'dev.flutter.pigeon.nfc_manager.FlutterApiPigeon.tagSessionDidInvalidateWithError' channel sent a message from native to Flutter on a non-platform thread. ...

Complete error message

[ERROR:flutter/shell/common/shell.cc(1120)] The 'dev.flutter.pigeon.nfc_manager.FlutterApiPigeon.tagSessionDidBecomeActive' channel sent a message from native to Flutter on a non-platform thread. Platform channel messages must be sent on the platform thread. Failure to do so may result in data loss or crashes, and must be fixed in the plugin or application code creating that channel.
See https://docs.flutter.dev/platform-integration/platform-channels#channels-and-platform-threading for more information.

[ERROR:flutter/shell/common/shell.cc(1120)] The 'dev.flutter.pigeon.nfc_manager.FlutterApiPigeon.tagSessionDidInvalidateWithError' channel sent a message from native to Flutter on a non-platform thread. Platform channel messages must be sent on the platform thread. Failure to do so may result in data loss or crashes, and must be fixed in the plugin or application code creating that channel.
See https://docs.flutter.dev/platform-integration/platform-channels#channels-and-platform-threading for more information.

Information

Device: iphone 12 mini
iOS Version: 18.3.1

pollingOptions: {
  NfcPollingOption.iso14443,
},

pubspec.yaml

  nfc_manager: ^4.0.2
  nfc_manager_ndef: ^1.0.1

Our company NFC tag information from "NFC Tools" app

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions