Repository: okadan/flutter-nfc-manager
Branch: main
Commit: 262451431578
Files: 92
Total size: 510.8 KB
Directory structure:
gitextract_7nrhxl8x/
├── .gitignore
├── .metadata
├── CHANGELOG.md
├── LICENSE
├── README.md
├── analysis_options.yaml
├── android/
│ ├── .gitignore
│ ├── build.gradle.kts
│ ├── settings.gradle
│ ├── settings.gradle.kts
│ └── src/
│ ├── main/
│ │ ├── AndroidManifest.xml
│ │ └── kotlin/
│ │ └── dev/
│ │ └── flutter/
│ │ └── plugins/
│ │ └── nfcmanager/
│ │ ├── NfcManagerPlugin.kt
│ │ └── Pigeon.kt
│ └── test/
│ └── kotlin/
│ └── dev/
│ └── flutter/
│ └── plugins/
│ └── nfcmanager/
│ └── NfcManagerPluginTest.kt
├── example/
│ ├── .gitignore
│ ├── README.md
│ ├── analysis_options.yaml
│ ├── android/
│ │ ├── .gitignore
│ │ ├── app/
│ │ │ ├── build.gradle.kts
│ │ │ └── src/
│ │ │ ├── debug/
│ │ │ │ └── AndroidManifest.xml
│ │ │ ├── main/
│ │ │ │ ├── AndroidManifest.xml
│ │ │ │ ├── kotlin/
│ │ │ │ │ └── dev/
│ │ │ │ │ └── flutter/
│ │ │ │ │ └── plugins/
│ │ │ │ │ └── nfcmanagerexample/
│ │ │ │ │ └── MainActivity.kt
│ │ │ │ └── res/
│ │ │ │ ├── drawable/
│ │ │ │ │ └── launch_background.xml
│ │ │ │ ├── drawable-v21/
│ │ │ │ │ └── launch_background.xml
│ │ │ │ ├── values/
│ │ │ │ │ └── styles.xml
│ │ │ │ └── values-night/
│ │ │ │ └── styles.xml
│ │ │ └── profile/
│ │ │ └── AndroidManifest.xml
│ │ ├── build.gradle.kts
│ │ ├── gradle/
│ │ │ └── wrapper/
│ │ │ └── gradle-wrapper.properties
│ │ ├── gradle.properties
│ │ └── settings.gradle.kts
│ ├── ios/
│ │ ├── .gitignore
│ │ ├── Flutter/
│ │ │ ├── AppFrameworkInfo.plist
│ │ │ ├── Debug.xcconfig
│ │ │ └── Release.xcconfig
│ │ ├── Runner/
│ │ │ ├── AppDelegate.swift
│ │ │ ├── Assets.xcassets/
│ │ │ │ ├── AppIcon.appiconset/
│ │ │ │ │ └── Contents.json
│ │ │ │ └── LaunchImage.imageset/
│ │ │ │ ├── Contents.json
│ │ │ │ └── README.md
│ │ │ ├── Base.lproj/
│ │ │ │ ├── LaunchScreen.storyboard
│ │ │ │ └── Main.storyboard
│ │ │ ├── Info.plist
│ │ │ ├── Runner-Bridging-Header.h
│ │ │ └── SceneDelegate.swift
│ │ ├── Runner.xcodeproj/
│ │ │ ├── project.pbxproj
│ │ │ ├── project.xcworkspace/
│ │ │ │ ├── contents.xcworkspacedata
│ │ │ │ └── xcshareddata/
│ │ │ │ ├── IDEWorkspaceChecks.plist
│ │ │ │ └── WorkspaceSettings.xcsettings
│ │ │ └── xcshareddata/
│ │ │ └── xcschemes/
│ │ │ └── Runner.xcscheme
│ │ ├── Runner.xcworkspace/
│ │ │ ├── contents.xcworkspacedata
│ │ │ └── xcshareddata/
│ │ │ ├── IDEWorkspaceChecks.plist
│ │ │ └── WorkspaceSettings.xcsettings
│ │ └── RunnerTests/
│ │ └── RunnerTests.swift
│ ├── lib/
│ │ └── main.dart
│ └── pubspec.yaml
├── ios/
│ ├── .gitignore
│ ├── nfc_manager/
│ │ ├── Package.swift
│ │ └── Sources/
│ │ └── nfc_manager/
│ │ ├── NfcManagerPlugin.swift
│ │ └── Pigeon.swift
│ └── nfc_manager.podspec
├── lib/
│ ├── ndef_record.dart
│ ├── nfc_manager.dart
│ ├── nfc_manager_android.dart
│ ├── nfc_manager_ios.dart
│ └── src/
│ ├── nfc_manager/
│ │ └── nfc_manager.dart
│ ├── nfc_manager_android/
│ │ ├── nfc_manager.dart
│ │ ├── nfc_manager_platform.dart
│ │ ├── pigeon.dart
│ │ ├── pigeon.g.dart
│ │ └── tags/
│ │ ├── iso_dep.dart
│ │ ├── mifare_classic.dart
│ │ ├── mifare_ultralight.dart
│ │ ├── ndef.dart
│ │ ├── ndef_formatable.dart
│ │ ├── nfc_a.dart
│ │ ├── nfc_b.dart
│ │ ├── nfc_barcode.dart
│ │ ├── nfc_f.dart
│ │ ├── nfc_v.dart
│ │ └── tag.dart
│ └── nfc_manager_ios/
│ ├── nfc_manager.dart
│ ├── nfc_manager_platform.dart
│ ├── pigeon.dart
│ ├── pigeon.g.dart
│ └── tags/
│ ├── felica.dart
│ ├── iso15693.dart
│ ├── iso7816.dart
│ ├── mifare.dart
│ └── ndef.dart
├── pigeon/
│ ├── android.dart
│ └── ios.dart
└── pubspec.yaml
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.build/
.buildlog/
.history
.svn/
.swiftpm/
migrate_working_dir/
# IntelliJ related
*.iml
*.ipr
*.iws
.idea/
# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/
# Flutter/Dart/Pub related
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
/pubspec.lock
**/doc/api/
.dart_tool/
.flutter-plugins-dependencies
/build/
/coverage/
================================================
FILE: .metadata
================================================
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.
version:
revision: "db50e20168db8fee486b9abf32fc912de3bc5b6a"
channel: "stable"
project_type: plugin
# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: db50e20168db8fee486b9abf32fc912de3bc5b6a
base_revision: db50e20168db8fee486b9abf32fc912de3bc5b6a
- platform: android
create_revision: db50e20168db8fee486b9abf32fc912de3bc5b6a
base_revision: db50e20168db8fee486b9abf32fc912de3bc5b6a
- platform: ios
create_revision: db50e20168db8fee486b9abf32fc912de3bc5b6a
base_revision: db50e20168db8fee486b9abf32fc912de3bc5b6a
# User provided section
# List of Local paths (relative to this file) that should be
# ignored by the migrate tool.
#
# Files that are not part of the templates will be ignored by default.
unmanaged_files:
- 'lib/main.dart'
- 'ios/Runner.xcodeproj/project.pbxproj'
================================================
FILE: CHANGELOG.md
================================================
## 4.2.0
* Add Swift Package Manager support.
* Bump dependencies.
## 4.1.1
* Avoid iOS SDK version constraints caused by the addition of `NFCReaderError.Code`.
## 4.1.0
* Deprecated `NfcManager#isAvailable`. Use `NfcManager#checkAvailability` instead.
* Fix iOS background issue.
* Add more `NFCReaderError.Code` for iOS.
* Bump versions.
* Update doc.
## 4.0.2
* Update README.
## 4.0.1
* Update package page.
## 4.0.0
**Has many breaking changes.**
* Rename the following:
* `NfcA` to `NfcAAndroid`
* `NfcB` to `NfcBAndroid`
* `NfcF` to `NfcFAndroid`
* `NfcV` to `NfcVAndroid`
* `IsoDep` to `IsoDepAndroid`
* `MifareClassic` to `MifareClassicAndroid`
* `MifareUltralight` to `MifareUltralightAndroid`
* `NdefFormatable` to `NdefFormatableAndroid`
* `MiFare` to `MiFareIos`
* `FeliCa` to `FeliCaIos`
* `Iso15693` to `Iso15693Ios`
* `Iso7816` to `Iso7816Ios`
* Options for `startSession`:
* `onError` to `onErrorIos`
* `invalidateAfterFirstRead` to `invalidateAfterFirstReadIos`
* `alertMessage` to `alertMessageIos`
* Options for `stopSession`:
* `alertMessage` to `alertMessageIos`
* `errorMessage` to `errorMessageIos`
* Remove the following:
* `Ndef` (Instead use the [`nfc_manager_ndef`](https://pub.dev/packages/nfc_manager_ndef) package or `NdefAndroid` / `NdefIos`)
* `timeout` (Instead use the `async getTimeout()` method)
* `maxTransceiveLength` (Instead use the `async getMaxTransceiveLength()` method)
* `NfcError` (Instead use the `NfcReaderSessionErrorIos`)
* `NfcErrorType` (Instead use the `NfcReaderErrorCodeIos`)
* Add the following:
* `ndef_record.dart` library that provides access to [`ndef_record`](https://pub.dev/packages/ndef_record) package.
* `nfc_manager_android.dart` library that provides access to Android API.
* `nfc_manager_ios.dart` library that provides access to iOS API.
* `async setTimeout()` method.
* `noPlatformSoundsAndroid` option to `startSession` method.
* Upgrade Flutter.
* Update README.
## 3.5.1
* Make compatible for Kotlin 2.1.0
## 3.5.0
* Upgrade Flutter.
* Fix analyze issues.
## 3.4.0
* Fix iOS background isolate issue.
* Add namespace to Gradle for Android.
* Rebuild projects on Flutter stable channel.
## 3.3.0
* Added `invalidateAfterFirstRead` argument to `startSession`. This enables `restartPolling` on iOS.
## 3.2.0
* Fix build issues.
## 3.1.1
* Upgrade kotlin version.
## 3.1.0
* Fix Null-Safety related issues. The following properties are now nullable.
* `IsoDep#hiLayerResponse`
* `IsoDep#historicalBytes`
* `Iso7816#historicalBytes`
* `Iso7816#applicationData`
* `MiFare#historicalBytes`
## 3.0.0+2
* Update doc.
## 3.0.0+1
* Flutter format.
## 3.0.0
* Upgrade to null safety.
## 2.0.3
* Fix type conversion errors in `FeliCa#readWithoutEncryption` and `FeliCa#requestServiceV2`.
## 2.0.2
* Fix a bug in calling `FeliCa.sendFeliCaCommand` method.
## 2.0.1+1
* Update README.
## 2.0.1
* Fix an error when initializing plugin for non-NFC Android devices.
## 2.0.0+2
* Update doc.
* Flutter format.
## 2.0.0+1
* Update doc.
## 2.0.0
**Has many breaking changes.**
* Remove `startNdefSession` and `NdefDiscoveredCallback`.
* Rename `startTagSession` to `startSession`.
* Rename `TagPollingOption` to `NfcPollingOption`.
* Rename `NfcSessionError` to `NfcError`.
* Rename `NfcSessionErrorType` to `NfcErrorType`.
* Rename `TagDiscoveredCallback` to `NfcTagCallback`.
* Rename `NfcSessionErrorCallback` to `NfcErrorCallback`.
* Rename `ISO15693` to `Iso15693`.
* Rename `ISO7816` to `Iso7816`.
* Rename `fromTag` to `from`. (e.g. `MiFare.fromTag(tag)` -> `MiFare.from(tag)`)
* Add `NdefTypeNameFormat` enum.
* Add `NdefFormatable`, `MifareClassic` and `MifareUltralight` classes.
* Add `Ndef#read` method.
* Add command-implementations for `FeliCa` and `Iso15693`.
* Upgrade flutter environment.
## 1.3.2+4
* Update README.
## 1.3.2+3
* Update README.
## 1.3.2+2
* Update README.
## 1.3.2+1
* Update README.
## 1.3.2
* Fix crash on Ndef write and writeLock error.
## 1.3.1
* Fix a bug where the error callback was not called.
## 1.3.0
* Add callback to handle error from session.
## 1.2.0
* Make discovered callback async.
## 1.1.0+1
* Update readme.
## 1.1.0
* Add constants.
* Fix misspelled name.
* Fix xcode build warning.
* Increase the Flutter SDK requirement to ^1.10.0.
## 1.0.1
* Fix error on invoking transceive method.
## 1.0.0
* Add platform-specifc-tag operations.
* Remove `NfcSessionType` enum.
* Migrate to pubspec platforms manifest.
* More consistent naming.
## 0.5.1
* Update flutter project files.
* Additional fix for migration to AndroidX.
## 0.5.0
* Migrate to AndroidX.
## 0.4.0+2
* Fix typo on README
## 0.4.0+1
* Update README
## 0.4.0
* Rename `NfcNdef#cachedNdef` to `NfcNdef#cachedMessage`.
* Add `NfcSessionType` enum.
* Add `NfcTagPollingOption` enum.
## 0.3.0
* Add `NdefRecord#createMimeRecord`.
* Add optional parameters `alertMessageIOS` and `errorMessageIOS` displayed in iOS system UI.
* Fix error on deserializing null message on dart side.
## 0.2.0
* Split `startSession` into `startNdefSession` and `startTagSession`.
* Improve doc.
## 0.1.1
* Fix crash on serializing nil message on ios side.
* Add example project.
* Improve doc.
## 0.1.0+2
* Improve doc.
## 0.1.0+1
* Improve doc.
## 0.1.0
* Add iOS 13 features.
## 0.0.1
* Initial release.
================================================
FILE: LICENSE
================================================
MIT License
Copyright (c) 2019 okadan
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: README.md
================================================
# nfc_manager
A Flutter plugin providing access to NFC features on Android and iOS.
## Setup
### Android
* Add [android.permission.NFC](https://developer.android.com/reference/android/Manifest.permission.html#NFC) to your `AndroidManifest.xml`.
### iOS
* Add [Near Field Communication Tag Reader Session Formats Entitlements](https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_developer_nfc_readersession_formats) to your entitlements.
* Add [NFCReaderUsageDescription](https://developer.apple.com/documentation/bundleresources/information_property_list/nfcreaderusagedescription) to your `Info.plist`.
* Add [com.apple.developer.nfc.readersession.iso7816.select-identifiers](https://developer.apple.com/documentation/bundleresources/information_property_list/select-identifiers) to your `Info.plist` as needed.
* Add [com.apple.developer.nfc.readersession.felica.systemcodes](https://developer.apple.com/documentation/bundleresources/information_property_list/systemcodes) to your `Info.plist` if you specify `NfcPollingOption.iso18092` in `startSession`, otherwise an error will occur.
## Usage
### Handling the Session
```dart
import 'package:nfc_manager/nfc_manager.dart';
// Check the availability of NFC on the current device.
NfcAvailability availability = await NfcManager.instance.checkAvailability();
if (availability != NfcAvailability.enabled) {
print('NFC may not be supported or may be temporarily disabled.');
return;
}
// Start the session.
NfcManager.instance.startSession(
pollingOptions: {NfcPollingOption.iso14443}, // You can also specify iso18092 and iso15693.
onDiscovered: (NfcTag tag) async {
// Do something with an NfcTag instance...
print(tag);
// Stop the session when no longer needed.
await NfcManager.instance.stopSession();
},
);
```
### Working with NfcTag
An `NfcTag` instance is typically not used directly. Instead, convert it to a platform-specific tag class by calling that class's static method `from`.
```dart
import 'package:nfc_manager/nfc_manager.dart';
import 'package:nfc_manager_ndef/nfc_manager_ndef.dart';
final Ndef ndef = Ndef.from(tag);
if (ndef == null) {
print('This tag is not compatible with NDEF.');
return;
}
// Do something with an Ndef instance...
print(ndef);
```
The following platform-specific tag classes are available:
#### Android only
* `NfcAAndroid`
* `NfcBAndroid`
* `NfcFAndroid`
* `NfcVAndroid`
* `IsoDepAndroid`
* `MifareClassicAndroid`
* `MifareUltralightAndroid`
* `NfcBarcodeAndroid`
* `NdefAndroid`
* `NdefFormatableAndroid`
#### iOS only
* `FeliCaIos`
* `MiFareIos`
* `Iso15693Ios`
* `Iso7816Ios`
* `NdefIos`
#### Cross-platform abstractions (separate packages)
* `Ndef` ([nfc_manager_ndef](https://pub.dev/packages/nfc_manager_ndef))
* `FeliCa` ([nfc_manager_felica](https://pub.dev/packages/nfc_manager_felica))
* and more...
================================================
FILE: analysis_options.yaml
================================================
include: package:flutter_lints/flutter.yaml
================================================
FILE: android/.gitignore
================================================
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
.cxx
================================================
FILE: android/build.gradle.kts
================================================
group = "dev.flutter.plugins.nfcmanager"
version = "1.0-SNAPSHOT"
buildscript {
val kotlinVersion = "2.2.20"
repositories {
google()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:8.11.1")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
plugins {
id("com.android.library")
id("kotlin-android")
}
android {
namespace = "dev.flutter.plugins.nfcmanager"
compileSdk = 36
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_17.toString()
}
sourceSets {
getByName("main") {
java.srcDirs("src/main/kotlin")
}
getByName("test") {
java.srcDirs("src/test/kotlin")
}
}
defaultConfig {
minSdk = 24
}
testOptions {
unitTests {
isIncludeAndroidResources = true
all {
it.useJUnitPlatform()
it.outputs.upToDateWhen { false }
it.testLogging {
events("passed", "skipped", "failed", "standardOut", "standardError")
showStandardStreams = true
}
}
}
}
}
dependencies {
testImplementation("org.jetbrains.kotlin:kotlin-test")
testImplementation("org.mockito:mockito-core:5.0.0")
}
================================================
FILE: android/settings.gradle
================================================
rootProject.name = 'nfc_manager'
================================================
FILE: android/settings.gradle.kts
================================================
rootProject.name = 'nfc_manager'
================================================
FILE: android/src/main/AndroidManifest.xml
================================================
================================================
FILE: android/src/main/kotlin/dev/flutter/plugins/nfcmanager/NfcManagerPlugin.kt
================================================
package dev.flutter.plugins.nfcmanager
import android.app.Activity
import android.app.PendingIntent
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Context.RECEIVER_NOT_EXPORTED
import android.content.Intent
import android.content.IntentFilter
import android.nfc.NdefMessage
import android.nfc.NdefRecord
import android.nfc.NfcAdapter
import android.nfc.Tag
import android.nfc.tech.IsoDep
import android.nfc.tech.MifareClassic
import android.nfc.tech.MifareUltralight
import android.nfc.tech.Ndef
import android.nfc.tech.NdefFormatable
import android.nfc.tech.NfcA
import android.nfc.tech.NfcB
import android.nfc.tech.NfcBarcode
import android.nfc.tech.NfcF
import android.nfc.tech.NfcV
import android.nfc.tech.TagTechnology
import android.os.Build
import io.flutter.embedding.engine.plugins.FlutterPlugin
import io.flutter.embedding.engine.plugins.activity.ActivityAware
import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding
import java.util.*
class NfcManagerPlugin: FlutterPlugin, ActivityAware, HostApiPigeon, BroadcastReceiver() {
private lateinit var flutterApi: FlutterApiPigeon
private lateinit var activity: Activity
private var adapter: NfcAdapter? = null
private var cachedTags: MutableMap = mutableMapOf()
private var connectedTech: TagTechnology? = null
override fun onAttachedToEngine(flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) {
HostApiPigeon.setUp(flutterPluginBinding.binaryMessenger, this)
flutterApi = FlutterApiPigeon(flutterPluginBinding.binaryMessenger)
adapter = NfcAdapter.getDefaultAdapter(flutterPluginBinding.applicationContext)
}
override fun onDetachedFromEngine(binding: FlutterPlugin.FlutterPluginBinding) {
HostApiPigeon.setUp(binding.binaryMessenger, null)
}
override fun onAttachedToActivity(binding: ActivityPluginBinding) {
activity = binding.activity
val intentFilter = IntentFilter(NfcAdapter.ACTION_ADAPTER_STATE_CHANGED)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
activity.applicationContext.registerReceiver(this, intentFilter, RECEIVER_NOT_EXPORTED)
} else {
activity.applicationContext.registerReceiver(this, intentFilter)
}
}
override fun onReattachedToActivityForConfigChanges(binding: ActivityPluginBinding) {
activity = binding.activity
}
override fun onDetachedFromActivityForConfigChanges() {
// noop
}
override fun onDetachedFromActivity() {
// noop
}
override fun onReceive(context: Context?, intent: Intent?) {
intent ?: run { return }
if (intent.action != NfcAdapter.ACTION_ADAPTER_STATE_CHANGED) { return }
val state = intent.getIntExtra(NfcAdapter.EXTRA_ADAPTER_STATE, NfcAdapter.STATE_OFF)
flutterApi.onAdapterStateChanged(toAdapterStatePigeon(state)) { /* noop */ }
}
override fun nfcAdapterIsEnabled(): Boolean {
return getAdapter().isEnabled
}
override fun nfcAdapterIsSecureNfcEnabled(): Boolean {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) {
throw FlutterError("unavailable", "Required Android SDK >= ${Build.VERSION_CODES.Q}.", null)
}
return getAdapter().isSecureNfcEnabled
}
override fun nfcAdapterIsSecureNfcSupported(): Boolean {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) {
throw FlutterError("unavailable", "Required Android SDK >= ${Build.VERSION_CODES.Q}.", null)
}
return getAdapter().isSecureNfcSupported
}
override fun nfcAdapterEnableReaderMode(flags: List) {
getAdapter().enableReaderMode(activity, { onTagDiscovered(it) }, toInt(flags), null)
}
override fun nfcAdapterDisableReaderMode() {
getAdapter().disableReaderMode(activity)
cachedTags.clear() // Consider when to remove the tag.
}
override fun ndefGetNdefMessage(handle: String): NdefMessagePigeon? {
val tech = forceConnect(handle) { Ndef.get(it) }
val message = tech.ndefMessage
return if (message != null) toNdefMessagePigeon(message) else null
}
override fun ndefWriteNdefMessage(handle: String, message: NdefMessagePigeon) {
val tech = forceConnect(handle) { Ndef.get(it) }
tech.writeNdefMessage(toNdefMessage(message))
}
override fun ndefMakeReadOnly(handle: String): Boolean {
val tech = forceConnect(handle) { Ndef.get(it) }
return tech.makeReadOnly()
}
override fun nfcAGetMaxTransceiveLength(handle: String): Long {
val tech = forceConnect(handle) { NfcA.get(it) }
return tech.maxTransceiveLength.toLong()
}
override fun nfcAGetTimeout(handle: String): Long {
val tech = forceConnect(handle) { NfcA.get(it) }
return tech.timeout.toLong()
}
override fun nfcASetTimeout(handle: String, timeout: Long) {
val tech = forceConnect(handle) { NfcA.get(it) }
tech.timeout = timeout.toInt()
}
override fun nfcATransceive(handle: String, bytes: ByteArray): ByteArray {
val tech = forceConnect(handle) { NfcA.get(it) }
return tech.transceive(bytes)
}
override fun nfcBGetMaxTransceiveLength(handle: String): Long {
val tech = forceConnect(handle) { NfcB.get(it) }
return tech.maxTransceiveLength.toLong()
}
override fun nfcBTransceive(handle: String, bytes: ByteArray): ByteArray {
val tech = forceConnect(handle) { NfcB.get(it) }
return tech.transceive(bytes)
}
override fun nfcFGetMaxTransceiveLength(handle: String): Long {
val tech = forceConnect(handle) { NfcF.get(it) }
return tech.maxTransceiveLength.toLong()
}
override fun nfcFGetTimeout(handle: String): Long {
val tech = forceConnect(handle) { NfcF.get(it) }
return tech.timeout.toLong()
}
override fun nfcFSetTimeout(handle: String, timeout: Long) {
val tech = forceConnect(handle) { NfcF.get(it) }
tech.timeout = timeout.toInt()
}
override fun nfcFTransceive(handle: String, bytes: ByteArray): ByteArray {
val tech = forceConnect(handle) { NfcF.get(it) }
return tech.transceive(bytes)
}
override fun nfcVGetMaxTransceiveLength(handle: String): Long {
val tech = forceConnect(handle) { NfcV.get(it) }
return tech.maxTransceiveLength.toLong()
}
override fun nfcVTransceive(handle: String, bytes: ByteArray): ByteArray {
val tech = forceConnect(handle) { NfcV.get(it) }
return tech.transceive(bytes)
}
override fun isoDepGetMaxTransceiveLength(handle: String): Long {
val tech = forceConnect(handle) { IsoDep.get(it) }
return tech.maxTransceiveLength.toLong()
}
override fun isoDepGetTimeout(handle: String): Long {
val tech = forceConnect(handle) { IsoDep.get(it) }
return tech.timeout.toLong()
}
override fun isoDepSetTimeout(handle: String, timeout: Long) {
val tech = forceConnect(handle) { IsoDep.get(it) }
tech.timeout = timeout.toInt()
}
override fun isoDepTransceive(handle: String, bytes: ByteArray): ByteArray {
val tech = forceConnect(handle) { IsoDep.get(it) }
return tech.transceive(bytes)
}
override fun mifareClassicGetMaxTransceiveLength(handle: String): Long {
val tech = forceConnect(handle) { MifareClassic.get(it) }
return tech.maxTransceiveLength.toLong()
}
override fun mifareClassicGetTimeout(handle: String): Long {
val tech = forceConnect(handle) { MifareClassic.get(it) }
return tech.timeout.toLong()
}
override fun mifareClassicSetTimeout(handle: String, timeout: Long) {
val tech = forceConnect(handle) { MifareClassic.get(it) }
tech.timeout = timeout.toInt()
}
override fun mifareClassicAuthenticateSectorWithKeyA(handle: String, sectorIndex: Long, key: ByteArray): Boolean {
val tech = forceConnect(handle) { MifareClassic.get(it) }
return tech.authenticateSectorWithKeyA(sectorIndex.toInt(), key)
}
override fun mifareClassicAuthenticateSectorWithKeyB(handle: String, sectorIndex: Long, key: ByteArray): Boolean {
val tech = forceConnect(handle) { MifareClassic.get(it) }
return tech.authenticateSectorWithKeyB(sectorIndex.toInt(), key)
}
override fun mifareClassicGetBlockCountInSector(handle: String, sectorIndex: Long): Long {
val tech = forceConnect(handle) { MifareClassic.get(it) }
return tech.getBlockCountInSector(sectorIndex.toInt()).toLong()
}
override fun mifareClassicBlockToSector(handle: String, blockIndex: Long): Long {
val tech = forceConnect(handle) { MifareClassic.get(it) }
return tech.blockToSector(blockIndex.toInt()).toLong()
}
override fun mifareClassicSectorToBlock(handle: String, sectorIndex: Long): Long {
val tech = forceConnect(handle) { MifareClassic.get(it) }
return tech.sectorToBlock(sectorIndex.toInt()).toLong()
}
override fun mifareClassicIncrement(handle: String, blockIndex: Long, value: Long) {
val tech = forceConnect(handle) { MifareClassic.get(it) }
tech.increment(blockIndex.toInt(), value.toInt())
}
override fun mifareClassicDecrement(handle: String, blockIndex: Long, value: Long) {
val tech = forceConnect(handle) { MifareClassic.get(it) }
tech.decrement(blockIndex.toInt(), value.toInt())
}
override fun mifareClassicRestore(handle: String, blockIndex: Long) {
val tech = forceConnect(handle) { MifareClassic.get(it) }
tech.restore(blockIndex.toInt())
}
override fun mifareClassicTransfer(handle: String, blockIndex: Long) {
val tech = forceConnect(handle) { MifareClassic.get(it) }
tech.transfer(blockIndex.toInt())
}
override fun mifareClassicReadBlock(handle: String, blockIndex: Long): ByteArray {
val tech = forceConnect(handle) { MifareClassic.get(it) }
return tech.readBlock(blockIndex.toInt())
}
override fun mifareClassicWriteBlock(handle: String, blockIndex: Long, data: ByteArray) {
val tech = forceConnect(handle) { MifareClassic.get(it) }
tech.writeBlock(blockIndex.toInt(), data)
}
override fun mifareClassicTransceive(handle: String, bytes: ByteArray): ByteArray {
val tech = forceConnect(handle) { MifareClassic.get(it) }
return tech.transceive(bytes)
}
override fun mifareUltralightGetMaxTransceiveLength(handle: String): Long {
val tech = forceConnect(handle) { MifareUltralight.get(it) }
return tech.maxTransceiveLength.toLong()
}
override fun mifareUltralightGetTimeout(handle: String): Long {
val tech = forceConnect(handle) { MifareUltralight.get(it) }
return tech.timeout.toLong()
}
override fun mifareUltralightSetTimeout(handle: String, timeout: Long) {
val tech = forceConnect(handle) { MifareUltralight.get(it) }
tech.timeout = timeout.toInt()
}
override fun mifareUltralightReadPages(handle: String, pageOffset: Long): ByteArray {
val tech = forceConnect(handle) { MifareUltralight.get(it) }
return tech.readPages(pageOffset.toInt())
}
override fun mifareUltralightWritePage(handle: String, pageOffset: Long, data: ByteArray) {
val tech = forceConnect(handle) { MifareUltralight.get(it) }
tech.writePage(pageOffset.toInt(), data)
}
override fun mifareUltralightTransceive(handle: String, bytes: ByteArray): ByteArray {
val tech = forceConnect(handle) { MifareUltralight.get(it) }
return tech.transceive(bytes)
}
override fun ndefFormatableFormat(handle: String, firstMessage: NdefMessagePigeon) {
val tech = forceConnect(handle) { NdefFormatable.get(it) }
tech.format(toNdefMessage(firstMessage))
}
override fun ndefFormatableFormatReadOnly(handle: String, firstMessage: NdefMessagePigeon) {
val tech = forceConnect(handle) { NdefFormatable.get(it) }
tech.formatReadOnly(toNdefMessage(firstMessage))
}
private fun onTagDiscovered(tag: Tag) {
val handle = UUID.randomUUID().toString()
val pigeonTag = toTagPigeon(tag, handle)
cachedTags[handle] = tag
activity.runOnUiThread { flutterApi.onTagDiscovered(pigeonTag) { /* no op */ } }
}
private fun getAdapter(): NfcAdapter {
return adapter ?: run { throw FlutterError("not_supported", "NFC is not supported on this device.", null) }
}
private inline fun forceConnect(handle: String, getMethod: (Tag) -> T?): T {
val tag = cachedTags[handle] ?: run {
throw FlutterError("tag_not_found", "You may have disable the session.", null)
}
val tech = getMethod(tag) ?: run {
throw FlutterError("tag_not_found", "The tag cannot be converted to ${T::class.java.name}.", null)
}
val connectedTech = connectedTech ?: run {
tech.connect()
connectedTech = tech
return tech
}
if (connectedTech.tag != tech.tag || connectedTech::class.java.name != tech::class.java.name) {
try {
connectedTech.close()
} catch (e: Exception) {
/* no op */
}
tech.connect()
this.connectedTech = tech
}
return tech
}
}
private fun toInt(value: List): Int {
return value.fold(0) { p, e -> p or toInt(e)}
}
private fun toInt(value: ReaderFlagPigeon): Int {
return when (value) {
ReaderFlagPigeon.NFC_A-> NfcAdapter.FLAG_READER_NFC_A
ReaderFlagPigeon.NFC_B -> NfcAdapter.FLAG_READER_NFC_B
ReaderFlagPigeon.NFC_BARCODE -> NfcAdapter.FLAG_READER_NFC_BARCODE
ReaderFlagPigeon.NFC_F -> NfcAdapter.FLAG_READER_NFC_F
ReaderFlagPigeon.NFC_V -> NfcAdapter.FLAG_READER_NFC_V
ReaderFlagPigeon.NO_PLATFORM_SOUNDS -> NfcAdapter.FLAG_READER_NO_PLATFORM_SOUNDS
ReaderFlagPigeon.SKIP_NDEF_CHECK -> NfcAdapter.FLAG_READER_SKIP_NDEF_CHECK
}
}
private fun toNdefMessage(value: NdefMessagePigeon): NdefMessage {
return NdefMessage(value.records.map { toNdefRecord(it) }.toTypedArray())
}
private fun toNdefMessagePigeon(value: NdefMessage): NdefMessagePigeon {
return NdefMessagePigeon(
records = value.records.map { toNdefRecordPigeon(it) }
)
}
private fun toNdefRecord(value: NdefRecordPigeon): NdefRecord {
return NdefRecord(
toShort(value.tnf),
value.type,
value.id,
value.payload,
)
}
private fun toNdefRecordPigeon(value: NdefRecord): NdefRecordPigeon {
return NdefRecordPigeon(
tnf = toTypeNameFormatPigeon(value.tnf),
type = value.type,
id = value.id,
payload = value.payload,
)
}
private fun toTagPigeon(value: Tag, handle: String): TagPigeon {
return TagPigeon(
handle = handle,
id = value.id,
techList = value.techList.toMutableList(),
ndef = Ndef.get(value)?.let { toNdefPigeon(it) },
nfcA = NfcA.get(value)?.let { toNfcAPigeon(it) },
nfcB = NfcB.get(value)?.let { toNfcBPigeon(it) },
nfcF = NfcF.get(value)?.let { toNfcFPigeon(it) },
nfcV = NfcV.get(value)?.let { toNfcVPigeon(it) },
isoDep = IsoDep.get(value)?.let { toIsoDepPigeon(it) },
mifareClassic = MifareClassic.get(value)?.let { toMifareClassicPigeon(it) },
mifareUltralight = MifareUltralight.get(value)?.let { toMifareUltralightPigeon(it) },
ndefFormatable = NdefFormatable.get(value)?.let { "" },
nfcBarcode = NfcBarcode.get(value)?.let { toNfcBarcodePigeon(it) },
)
}
private fun toNdefPigeon(value: Ndef): NdefPigeon {
return NdefPigeon(
type = value.type,
isWritable = value.isWritable,
maxSize = value.maxSize.toLong(),
canMakeReadOnly = value.canMakeReadOnly(),
cachedNdefMessage = value.cachedNdefMessage?.let { toNdefMessagePigeon(it) },
)
}
private fun toNfcAPigeon(value: NfcA): NfcAPigeon {
return NfcAPigeon(
atqa = value.atqa,
sak = value.sak.toLong(),
)
}
private fun toNfcBPigeon(value: NfcB): NfcBPigeon {
return NfcBPigeon(
applicationData = value.applicationData,
protocolInfo = value.protocolInfo,
)
}
private fun toNfcFPigeon(value: NfcF): NfcFPigeon {
return NfcFPigeon(
manufacturer = value.manufacturer,
systemCode = value.systemCode,
)
}
private fun toNfcVPigeon(value: NfcV): NfcVPigeon {
return NfcVPigeon(
dsfId = value.dsfId.toLong(),
responseFlags = value.responseFlags.toLong(),
)
}
private fun toIsoDepPigeon(value: IsoDep): IsoDepPigeon {
return IsoDepPigeon(
hiLayerResponse = value.hiLayerResponse,
historicalBytes = value.historicalBytes,
isExtendedLengthApduSupported = value.isExtendedLengthApduSupported,
)
}
private fun toMifareClassicPigeon(value: MifareClassic): MifareClassicPigeon {
return MifareClassicPigeon(
type = toMifareClassicTypePigeon(value.type),
blockCount = value.blockCount.toLong(),
sectorCount = value.sectorCount.toLong(),
size = value.size.toLong(),
)
}
private fun toMifareUltralightPigeon(value: MifareUltralight): MifareUltralightPigeon {
return MifareUltralightPigeon(
type = toMifareUltralightTypePigeon(value.type)
)
}
private fun toNfcBarcodePigeon(value: NfcBarcode): NfcBarcodePigeon {
return NfcBarcodePigeon(
type = toNfcBarcodeTypePigeon(value.type),
barcode = value.barcode,
)
}
private fun toShort(value: TypeNameFormatPigeon): Short {
return when (value) {
TypeNameFormatPigeon.EMPTY -> NdefRecord.TNF_EMPTY
TypeNameFormatPigeon.WELL_KNOWN -> NdefRecord.TNF_WELL_KNOWN
TypeNameFormatPigeon.MEDIA -> NdefRecord.TNF_MIME_MEDIA
TypeNameFormatPigeon.ABSOLUTE_URI -> NdefRecord.TNF_ABSOLUTE_URI
TypeNameFormatPigeon.EXTERNAL -> NdefRecord.TNF_EXTERNAL_TYPE
TypeNameFormatPigeon.UNKNOWN -> NdefRecord.TNF_UNKNOWN
TypeNameFormatPigeon.UNCHANGED -> NdefRecord.TNF_UNCHANGED
}
}
private fun toAdapterStatePigeon(value: Int): AdapterStatePigeon {
return when (value) {
NfcAdapter.STATE_OFF -> AdapterStatePigeon.OFF
NfcAdapter.STATE_TURNING_ON -> AdapterStatePigeon.TURNING_ON
NfcAdapter.STATE_ON -> AdapterStatePigeon.ON
NfcAdapter.STATE_TURNING_OFF -> AdapterStatePigeon.TURNING_OFF
else -> error("Unknown value: $value")
}
}
private fun toTypeNameFormatPigeon(value: Short): TypeNameFormatPigeon {
return when (value) {
NdefRecord.TNF_EMPTY -> TypeNameFormatPigeon.EMPTY
NdefRecord.TNF_WELL_KNOWN -> TypeNameFormatPigeon.WELL_KNOWN
NdefRecord.TNF_MIME_MEDIA -> TypeNameFormatPigeon.MEDIA
NdefRecord.TNF_ABSOLUTE_URI -> TypeNameFormatPigeon.ABSOLUTE_URI
NdefRecord.TNF_EXTERNAL_TYPE -> TypeNameFormatPigeon.EXTERNAL
NdefRecord.TNF_UNKNOWN -> TypeNameFormatPigeon.UNKNOWN
NdefRecord.TNF_UNCHANGED -> TypeNameFormatPigeon.UNCHANGED
else -> error("Unknown value: $value")
}
}
private fun toNfcBarcodeTypePigeon(value: Int): NfcBarcodeTypePigeon {
return when (value) {
NfcBarcode.TYPE_KOVIO -> NfcBarcodeTypePigeon.KOVIO
NfcBarcode.TYPE_UNKNOWN -> NfcBarcodeTypePigeon.UNKNOWN
else -> error("Unknown value: $value")
}
}
private fun toMifareClassicTypePigeon(value: Int): MifareClassicTypePigeon {
return when (value) {
MifareClassic.TYPE_CLASSIC -> MifareClassicTypePigeon.CLASSIC
MifareClassic.TYPE_PLUS -> MifareClassicTypePigeon.PLUS
MifareClassic.TYPE_PRO -> MifareClassicTypePigeon.PRO
MifareClassic.TYPE_UNKNOWN -> MifareClassicTypePigeon.UNKNOWN
else -> error("Unknown value: $value")
}
}
private fun toMifareUltralightTypePigeon(value: Int): MifareUltralightTypePigeon {
return when (value) {
MifareUltralight.TYPE_ULTRALIGHT -> MifareUltralightTypePigeon.ULTRALIGHT
MifareUltralight.TYPE_ULTRALIGHT_C -> MifareUltralightTypePigeon.ULTRALIGHT_C
MifareUltralight.TYPE_UNKNOWN -> MifareUltralightTypePigeon.UNKNOWN
else -> error("Unknown value: $value")
}
}
================================================
FILE: android/src/main/kotlin/dev/flutter/plugins/nfcmanager/Pigeon.kt
================================================
// Autogenerated from Pigeon (v26.3.3), do not edit directly.
// See also: https://pub.dev/packages/pigeon
@file:Suppress("UNCHECKED_CAST", "ArrayInDataClass")
package dev.flutter.plugins.nfcmanager
import android.util.Log
import io.flutter.plugin.common.BasicMessageChannel
import io.flutter.plugin.common.BinaryMessenger
import io.flutter.plugin.common.EventChannel
import io.flutter.plugin.common.MessageCodec
import io.flutter.plugin.common.StandardMethodCodec
import io.flutter.plugin.common.StandardMessageCodec
import java.io.ByteArrayOutputStream
import java.nio.ByteBuffer
private object PigeonPigeonUtils {
fun createConnectionError(channelName: String): FlutterError {
return FlutterError("channel-error", "Unable to establish connection on channel: '$channelName'.", "") }
fun wrapResult(result: Any?): List {
return listOf(result)
}
fun wrapError(exception: Throwable): List {
return if (exception is FlutterError) {
listOf(
exception.code,
exception.message,
exception.details
)
} else {
listOf(
exception.javaClass.simpleName,
exception.toString(),
"Cause: " + exception.cause + ", Stacktrace: " + Log.getStackTraceString(exception)
)
}
}
fun doubleEquals(a: Double, b: Double): Boolean {
// Normalize -0.0 to 0.0 and handle NaN equality.
return (if (a == 0.0) 0.0 else a) == (if (b == 0.0) 0.0 else b) || (a.isNaN() && b.isNaN())
}
fun floatEquals(a: Float, b: Float): Boolean {
// Normalize -0.0 to 0.0 and handle NaN equality.
return (if (a == 0.0f) 0.0f else a) == (if (b == 0.0f) 0.0f else b) || (a.isNaN() && b.isNaN())
}
fun doubleHash(d: Double): Int {
// Normalize -0.0 to 0.0 and handle NaN to ensure consistent hash codes.
val normalized = if (d == 0.0) 0.0 else d
val bits = java.lang.Double.doubleToLongBits(normalized)
return (bits xor (bits ushr 32)).toInt()
}
fun floatHash(f: Float): Int {
// Normalize -0.0 to 0.0 and handle NaN to ensure consistent hash codes.
val normalized = if (f == 0.0f) 0.0f else f
return java.lang.Float.floatToIntBits(normalized)
}
fun deepEquals(a: Any?, b: Any?): Boolean {
if (a === b) {
return true
}
if (a == null || b == null) {
return false
}
if (a is ByteArray && b is ByteArray) {
return a.contentEquals(b)
}
if (a is IntArray && b is IntArray) {
return a.contentEquals(b)
}
if (a is LongArray && b is LongArray) {
return a.contentEquals(b)
}
if (a is DoubleArray && b is DoubleArray) {
if (a.size != b.size) return false
for (i in a.indices) {
if (!doubleEquals(a[i], b[i])) return false
}
return true
}
if (a is FloatArray && b is FloatArray) {
if (a.size != b.size) return false
for (i in a.indices) {
if (!floatEquals(a[i], b[i])) return false
}
return true
}
if (a is Array<*> && b is Array<*>) {
if (a.size != b.size) return false
for (i in a.indices) {
if (!deepEquals(a[i], b[i])) return false
}
return true
}
if (a is List<*> && b is List<*>) {
if (a.size != b.size) return false
val iterA = a.iterator()
val iterB = b.iterator()
while (iterA.hasNext() && iterB.hasNext()) {
if (!deepEquals(iterA.next(), iterB.next())) return false
}
return true
}
if (a is Map<*, *> && b is Map<*, *>) {
if (a.size != b.size) return false
for (entry in a) {
val key = entry.key
var found = false
for (bEntry in b) {
if (deepEquals(key, bEntry.key)) {
if (deepEquals(entry.value, bEntry.value)) {
found = true
break
} else {
return false
}
}
}
if (!found) return false
}
return true
}
if (a is Double && b is Double) {
return doubleEquals(a, b)
}
if (a is Float && b is Float) {
return floatEquals(a, b)
}
return a == b
}
fun deepHash(value: Any?): Int {
return when (value) {
null -> 0
is ByteArray -> value.contentHashCode()
is IntArray -> value.contentHashCode()
is LongArray -> value.contentHashCode()
is DoubleArray -> {
var result = 1
for (item in value) {
result = 31 * result + doubleHash(item)
}
result
}
is FloatArray -> {
var result = 1
for (item in value) {
result = 31 * result + floatHash(item)
}
result
}
is Array<*> -> {
var result = 1
for (item in value) {
result = 31 * result + deepHash(item)
}
result
}
is List<*> -> {
var result = 1
for (item in value) {
result = 31 * result + deepHash(item)
}
result
}
is Map<*, *> -> {
var result = 0
for (entry in value) {
result += ((deepHash(entry.key) * 31) xor deepHash(entry.value))
}
result
}
is Double -> doubleHash(value)
is Float -> floatHash(value)
else -> value.hashCode()
}
}
}
/**
* Error class for passing custom error details to Flutter via a thrown PlatformException.
* @property code The error code.
* @property message The error message.
* @property details The error details. Must be a datatype supported by the api codec.
*/
class FlutterError (
val code: String,
override val message: String? = null,
val details: Any? = null
) : Throwable()
enum class ReaderFlagPigeon(val raw: Int) {
NFC_A(0),
NFC_B(1),
NFC_BARCODE(2),
NFC_F(3),
NFC_V(4),
NO_PLATFORM_SOUNDS(5),
SKIP_NDEF_CHECK(6);
companion object {
fun ofRaw(raw: Int): ReaderFlagPigeon? {
return values().firstOrNull { it.raw == raw }
}
}
}
enum class AdapterStatePigeon(val raw: Int) {
OFF(0),
TURNING_ON(1),
ON(2),
TURNING_OFF(3);
companion object {
fun ofRaw(raw: Int): AdapterStatePigeon? {
return values().firstOrNull { it.raw == raw }
}
}
}
enum class TypeNameFormatPigeon(val raw: Int) {
EMPTY(0),
WELL_KNOWN(1),
MEDIA(2),
ABSOLUTE_URI(3),
EXTERNAL(4),
UNKNOWN(5),
UNCHANGED(6);
companion object {
fun ofRaw(raw: Int): TypeNameFormatPigeon? {
return values().firstOrNull { it.raw == raw }
}
}
}
enum class NfcBarcodeTypePigeon(val raw: Int) {
KOVIO(0),
UNKNOWN(1);
companion object {
fun ofRaw(raw: Int): NfcBarcodeTypePigeon? {
return values().firstOrNull { it.raw == raw }
}
}
}
enum class MifareClassicTypePigeon(val raw: Int) {
CLASSIC(0),
PLUS(1),
PRO(2),
UNKNOWN(3);
companion object {
fun ofRaw(raw: Int): MifareClassicTypePigeon? {
return values().firstOrNull { it.raw == raw }
}
}
}
enum class MifareUltralightTypePigeon(val raw: Int) {
ULTRALIGHT(0),
ULTRALIGHT_C(1),
UNKNOWN(2);
companion object {
fun ofRaw(raw: Int): MifareUltralightTypePigeon? {
return values().firstOrNull { it.raw == raw }
}
}
}
/** Generated class from Pigeon that represents data sent in messages. */
data class TagPigeon (
val handle: String,
val id: ByteArray,
val techList: List,
val ndef: NdefPigeon? = null,
val nfcA: NfcAPigeon? = null,
val nfcB: NfcBPigeon? = null,
val nfcF: NfcFPigeon? = null,
val nfcV: NfcVPigeon? = null,
val isoDep: IsoDepPigeon? = null,
val mifareClassic: MifareClassicPigeon? = null,
val mifareUltralight: MifareUltralightPigeon? = null,
val ndefFormatable: String? = null,
val nfcBarcode: NfcBarcodePigeon? = null
)
{
companion object {
fun fromList(pigeonVar_list: List): TagPigeon {
val handle = pigeonVar_list[0] as String
val id = pigeonVar_list[1] as ByteArray
val techList = pigeonVar_list[2] as List
val ndef = pigeonVar_list[3] as NdefPigeon?
val nfcA = pigeonVar_list[4] as NfcAPigeon?
val nfcB = pigeonVar_list[5] as NfcBPigeon?
val nfcF = pigeonVar_list[6] as NfcFPigeon?
val nfcV = pigeonVar_list[7] as NfcVPigeon?
val isoDep = pigeonVar_list[8] as IsoDepPigeon?
val mifareClassic = pigeonVar_list[9] as MifareClassicPigeon?
val mifareUltralight = pigeonVar_list[10] as MifareUltralightPigeon?
val ndefFormatable = pigeonVar_list[11] as String?
val nfcBarcode = pigeonVar_list[12] as NfcBarcodePigeon?
return TagPigeon(handle, id, techList, ndef, nfcA, nfcB, nfcF, nfcV, isoDep, mifareClassic, mifareUltralight, ndefFormatable, nfcBarcode)
}
}
fun toList(): List {
return listOf(
handle,
id,
techList,
ndef,
nfcA,
nfcB,
nfcF,
nfcV,
isoDep,
mifareClassic,
mifareUltralight,
ndefFormatable,
nfcBarcode,
)
}
override fun equals(other: Any?): Boolean {
if (other == null || other.javaClass != javaClass) {
return false
}
if (this === other) {
return true
}
val other = other as TagPigeon
return PigeonPigeonUtils.deepEquals(this.handle, other.handle) && PigeonPigeonUtils.deepEquals(this.id, other.id) && PigeonPigeonUtils.deepEquals(this.techList, other.techList) && PigeonPigeonUtils.deepEquals(this.ndef, other.ndef) && PigeonPigeonUtils.deepEquals(this.nfcA, other.nfcA) && PigeonPigeonUtils.deepEquals(this.nfcB, other.nfcB) && PigeonPigeonUtils.deepEquals(this.nfcF, other.nfcF) && PigeonPigeonUtils.deepEquals(this.nfcV, other.nfcV) && PigeonPigeonUtils.deepEquals(this.isoDep, other.isoDep) && PigeonPigeonUtils.deepEquals(this.mifareClassic, other.mifareClassic) && PigeonPigeonUtils.deepEquals(this.mifareUltralight, other.mifareUltralight) && PigeonPigeonUtils.deepEquals(this.ndefFormatable, other.ndefFormatable) && PigeonPigeonUtils.deepEquals(this.nfcBarcode, other.nfcBarcode)
}
override fun hashCode(): Int {
var result = javaClass.hashCode()
result = 31 * result + PigeonPigeonUtils.deepHash(this.handle)
result = 31 * result + PigeonPigeonUtils.deepHash(this.id)
result = 31 * result + PigeonPigeonUtils.deepHash(this.techList)
result = 31 * result + PigeonPigeonUtils.deepHash(this.ndef)
result = 31 * result + PigeonPigeonUtils.deepHash(this.nfcA)
result = 31 * result + PigeonPigeonUtils.deepHash(this.nfcB)
result = 31 * result + PigeonPigeonUtils.deepHash(this.nfcF)
result = 31 * result + PigeonPigeonUtils.deepHash(this.nfcV)
result = 31 * result + PigeonPigeonUtils.deepHash(this.isoDep)
result = 31 * result + PigeonPigeonUtils.deepHash(this.mifareClassic)
result = 31 * result + PigeonPigeonUtils.deepHash(this.mifareUltralight)
result = 31 * result + PigeonPigeonUtils.deepHash(this.ndefFormatable)
result = 31 * result + PigeonPigeonUtils.deepHash(this.nfcBarcode)
return result
}
}
/** Generated class from Pigeon that represents data sent in messages. */
data class NdefPigeon (
val type: String,
val canMakeReadOnly: Boolean,
val isWritable: Boolean,
val maxSize: Long,
val cachedNdefMessage: NdefMessagePigeon? = null
)
{
companion object {
fun fromList(pigeonVar_list: List): NdefPigeon {
val type = pigeonVar_list[0] as String
val canMakeReadOnly = pigeonVar_list[1] as Boolean
val isWritable = pigeonVar_list[2] as Boolean
val maxSize = pigeonVar_list[3] as Long
val cachedNdefMessage = pigeonVar_list[4] as NdefMessagePigeon?
return NdefPigeon(type, canMakeReadOnly, isWritable, maxSize, cachedNdefMessage)
}
}
fun toList(): List {
return listOf(
type,
canMakeReadOnly,
isWritable,
maxSize,
cachedNdefMessage,
)
}
override fun equals(other: Any?): Boolean {
if (other == null || other.javaClass != javaClass) {
return false
}
if (this === other) {
return true
}
val other = other as NdefPigeon
return PigeonPigeonUtils.deepEquals(this.type, other.type) && PigeonPigeonUtils.deepEquals(this.canMakeReadOnly, other.canMakeReadOnly) && PigeonPigeonUtils.deepEquals(this.isWritable, other.isWritable) && PigeonPigeonUtils.deepEquals(this.maxSize, other.maxSize) && PigeonPigeonUtils.deepEquals(this.cachedNdefMessage, other.cachedNdefMessage)
}
override fun hashCode(): Int {
var result = javaClass.hashCode()
result = 31 * result + PigeonPigeonUtils.deepHash(this.type)
result = 31 * result + PigeonPigeonUtils.deepHash(this.canMakeReadOnly)
result = 31 * result + PigeonPigeonUtils.deepHash(this.isWritable)
result = 31 * result + PigeonPigeonUtils.deepHash(this.maxSize)
result = 31 * result + PigeonPigeonUtils.deepHash(this.cachedNdefMessage)
return result
}
}
/** Generated class from Pigeon that represents data sent in messages. */
data class NfcAPigeon (
val atqa: ByteArray,
val sak: Long
)
{
companion object {
fun fromList(pigeonVar_list: List): NfcAPigeon {
val atqa = pigeonVar_list[0] as ByteArray
val sak = pigeonVar_list[1] as Long
return NfcAPigeon(atqa, sak)
}
}
fun toList(): List {
return listOf(
atqa,
sak,
)
}
override fun equals(other: Any?): Boolean {
if (other == null || other.javaClass != javaClass) {
return false
}
if (this === other) {
return true
}
val other = other as NfcAPigeon
return PigeonPigeonUtils.deepEquals(this.atqa, other.atqa) && PigeonPigeonUtils.deepEquals(this.sak, other.sak)
}
override fun hashCode(): Int {
var result = javaClass.hashCode()
result = 31 * result + PigeonPigeonUtils.deepHash(this.atqa)
result = 31 * result + PigeonPigeonUtils.deepHash(this.sak)
return result
}
}
/** Generated class from Pigeon that represents data sent in messages. */
data class NfcBPigeon (
val applicationData: ByteArray,
val protocolInfo: ByteArray
)
{
companion object {
fun fromList(pigeonVar_list: List): NfcBPigeon {
val applicationData = pigeonVar_list[0] as ByteArray
val protocolInfo = pigeonVar_list[1] as ByteArray
return NfcBPigeon(applicationData, protocolInfo)
}
}
fun toList(): List {
return listOf(
applicationData,
protocolInfo,
)
}
override fun equals(other: Any?): Boolean {
if (other == null || other.javaClass != javaClass) {
return false
}
if (this === other) {
return true
}
val other = other as NfcBPigeon
return PigeonPigeonUtils.deepEquals(this.applicationData, other.applicationData) && PigeonPigeonUtils.deepEquals(this.protocolInfo, other.protocolInfo)
}
override fun hashCode(): Int {
var result = javaClass.hashCode()
result = 31 * result + PigeonPigeonUtils.deepHash(this.applicationData)
result = 31 * result + PigeonPigeonUtils.deepHash(this.protocolInfo)
return result
}
}
/** Generated class from Pigeon that represents data sent in messages. */
data class NfcFPigeon (
val manufacturer: ByteArray,
val systemCode: ByteArray
)
{
companion object {
fun fromList(pigeonVar_list: List): NfcFPigeon {
val manufacturer = pigeonVar_list[0] as ByteArray
val systemCode = pigeonVar_list[1] as ByteArray
return NfcFPigeon(manufacturer, systemCode)
}
}
fun toList(): List {
return listOf(
manufacturer,
systemCode,
)
}
override fun equals(other: Any?): Boolean {
if (other == null || other.javaClass != javaClass) {
return false
}
if (this === other) {
return true
}
val other = other as NfcFPigeon
return PigeonPigeonUtils.deepEquals(this.manufacturer, other.manufacturer) && PigeonPigeonUtils.deepEquals(this.systemCode, other.systemCode)
}
override fun hashCode(): Int {
var result = javaClass.hashCode()
result = 31 * result + PigeonPigeonUtils.deepHash(this.manufacturer)
result = 31 * result + PigeonPigeonUtils.deepHash(this.systemCode)
return result
}
}
/** Generated class from Pigeon that represents data sent in messages. */
data class NfcVPigeon (
val dsfId: Long,
val responseFlags: Long
)
{
companion object {
fun fromList(pigeonVar_list: List): NfcVPigeon {
val dsfId = pigeonVar_list[0] as Long
val responseFlags = pigeonVar_list[1] as Long
return NfcVPigeon(dsfId, responseFlags)
}
}
fun toList(): List {
return listOf(
dsfId,
responseFlags,
)
}
override fun equals(other: Any?): Boolean {
if (other == null || other.javaClass != javaClass) {
return false
}
if (this === other) {
return true
}
val other = other as NfcVPigeon
return PigeonPigeonUtils.deepEquals(this.dsfId, other.dsfId) && PigeonPigeonUtils.deepEquals(this.responseFlags, other.responseFlags)
}
override fun hashCode(): Int {
var result = javaClass.hashCode()
result = 31 * result + PigeonPigeonUtils.deepHash(this.dsfId)
result = 31 * result + PigeonPigeonUtils.deepHash(this.responseFlags)
return result
}
}
/** Generated class from Pigeon that represents data sent in messages. */
data class IsoDepPigeon (
val hiLayerResponse: ByteArray? = null,
val historicalBytes: ByteArray? = null,
val isExtendedLengthApduSupported: Boolean
)
{
companion object {
fun fromList(pigeonVar_list: List): IsoDepPigeon {
val hiLayerResponse = pigeonVar_list[0] as ByteArray?
val historicalBytes = pigeonVar_list[1] as ByteArray?
val isExtendedLengthApduSupported = pigeonVar_list[2] as Boolean
return IsoDepPigeon(hiLayerResponse, historicalBytes, isExtendedLengthApduSupported)
}
}
fun toList(): List {
return listOf(
hiLayerResponse,
historicalBytes,
isExtendedLengthApduSupported,
)
}
override fun equals(other: Any?): Boolean {
if (other == null || other.javaClass != javaClass) {
return false
}
if (this === other) {
return true
}
val other = other as IsoDepPigeon
return PigeonPigeonUtils.deepEquals(this.hiLayerResponse, other.hiLayerResponse) && PigeonPigeonUtils.deepEquals(this.historicalBytes, other.historicalBytes) && PigeonPigeonUtils.deepEquals(this.isExtendedLengthApduSupported, other.isExtendedLengthApduSupported)
}
override fun hashCode(): Int {
var result = javaClass.hashCode()
result = 31 * result + PigeonPigeonUtils.deepHash(this.hiLayerResponse)
result = 31 * result + PigeonPigeonUtils.deepHash(this.historicalBytes)
result = 31 * result + PigeonPigeonUtils.deepHash(this.isExtendedLengthApduSupported)
return result
}
}
/** Generated class from Pigeon that represents data sent in messages. */
data class MifareClassicPigeon (
val type: MifareClassicTypePigeon,
val blockCount: Long,
val sectorCount: Long,
val size: Long
)
{
companion object {
fun fromList(pigeonVar_list: List): MifareClassicPigeon {
val type = pigeonVar_list[0] as MifareClassicTypePigeon
val blockCount = pigeonVar_list[1] as Long
val sectorCount = pigeonVar_list[2] as Long
val size = pigeonVar_list[3] as Long
return MifareClassicPigeon(type, blockCount, sectorCount, size)
}
}
fun toList(): List {
return listOf(
type,
blockCount,
sectorCount,
size,
)
}
override fun equals(other: Any?): Boolean {
if (other == null || other.javaClass != javaClass) {
return false
}
if (this === other) {
return true
}
val other = other as MifareClassicPigeon
return PigeonPigeonUtils.deepEquals(this.type, other.type) && PigeonPigeonUtils.deepEquals(this.blockCount, other.blockCount) && PigeonPigeonUtils.deepEquals(this.sectorCount, other.sectorCount) && PigeonPigeonUtils.deepEquals(this.size, other.size)
}
override fun hashCode(): Int {
var result = javaClass.hashCode()
result = 31 * result + PigeonPigeonUtils.deepHash(this.type)
result = 31 * result + PigeonPigeonUtils.deepHash(this.blockCount)
result = 31 * result + PigeonPigeonUtils.deepHash(this.sectorCount)
result = 31 * result + PigeonPigeonUtils.deepHash(this.size)
return result
}
}
/** Generated class from Pigeon that represents data sent in messages. */
data class MifareUltralightPigeon (
val type: MifareUltralightTypePigeon
)
{
companion object {
fun fromList(pigeonVar_list: List): MifareUltralightPigeon {
val type = pigeonVar_list[0] as MifareUltralightTypePigeon
return MifareUltralightPigeon(type)
}
}
fun toList(): List {
return listOf(
type,
)
}
override fun equals(other: Any?): Boolean {
if (other == null || other.javaClass != javaClass) {
return false
}
if (this === other) {
return true
}
val other = other as MifareUltralightPigeon
return PigeonPigeonUtils.deepEquals(this.type, other.type)
}
override fun hashCode(): Int {
var result = javaClass.hashCode()
result = 31 * result + PigeonPigeonUtils.deepHash(this.type)
return result
}
}
/** Generated class from Pigeon that represents data sent in messages. */
data class NfcBarcodePigeon (
val type: NfcBarcodeTypePigeon,
val barcode: ByteArray
)
{
companion object {
fun fromList(pigeonVar_list: List): NfcBarcodePigeon {
val type = pigeonVar_list[0] as NfcBarcodeTypePigeon
val barcode = pigeonVar_list[1] as ByteArray
return NfcBarcodePigeon(type, barcode)
}
}
fun toList(): List {
return listOf(
type,
barcode,
)
}
override fun equals(other: Any?): Boolean {
if (other == null || other.javaClass != javaClass) {
return false
}
if (this === other) {
return true
}
val other = other as NfcBarcodePigeon
return PigeonPigeonUtils.deepEquals(this.type, other.type) && PigeonPigeonUtils.deepEquals(this.barcode, other.barcode)
}
override fun hashCode(): Int {
var result = javaClass.hashCode()
result = 31 * result + PigeonPigeonUtils.deepHash(this.type)
result = 31 * result + PigeonPigeonUtils.deepHash(this.barcode)
return result
}
}
/** Generated class from Pigeon that represents data sent in messages. */
data class NdefMessagePigeon (
val records: List
)
{
companion object {
fun fromList(pigeonVar_list: List): NdefMessagePigeon {
val records = pigeonVar_list[0] as List
return NdefMessagePigeon(records)
}
}
fun toList(): List {
return listOf(
records,
)
}
override fun equals(other: Any?): Boolean {
if (other == null || other.javaClass != javaClass) {
return false
}
if (this === other) {
return true
}
val other = other as NdefMessagePigeon
return PigeonPigeonUtils.deepEquals(this.records, other.records)
}
override fun hashCode(): Int {
var result = javaClass.hashCode()
result = 31 * result + PigeonPigeonUtils.deepHash(this.records)
return result
}
}
/** Generated class from Pigeon that represents data sent in messages. */
data class NdefRecordPigeon (
val tnf: TypeNameFormatPigeon,
val type: ByteArray,
val id: ByteArray,
val payload: ByteArray
)
{
companion object {
fun fromList(pigeonVar_list: List): NdefRecordPigeon {
val tnf = pigeonVar_list[0] as TypeNameFormatPigeon
val type = pigeonVar_list[1] as ByteArray
val id = pigeonVar_list[2] as ByteArray
val payload = pigeonVar_list[3] as ByteArray
return NdefRecordPigeon(tnf, type, id, payload)
}
}
fun toList(): List {
return listOf(
tnf,
type,
id,
payload,
)
}
override fun equals(other: Any?): Boolean {
if (other == null || other.javaClass != javaClass) {
return false
}
if (this === other) {
return true
}
val other = other as NdefRecordPigeon
return PigeonPigeonUtils.deepEquals(this.tnf, other.tnf) && PigeonPigeonUtils.deepEquals(this.type, other.type) && PigeonPigeonUtils.deepEquals(this.id, other.id) && PigeonPigeonUtils.deepEquals(this.payload, other.payload)
}
override fun hashCode(): Int {
var result = javaClass.hashCode()
result = 31 * result + PigeonPigeonUtils.deepHash(this.tnf)
result = 31 * result + PigeonPigeonUtils.deepHash(this.type)
result = 31 * result + PigeonPigeonUtils.deepHash(this.id)
result = 31 * result + PigeonPigeonUtils.deepHash(this.payload)
return result
}
}
private open class PigeonPigeonCodec : StandardMessageCodec() {
override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? {
return when (type) {
129.toByte() -> {
return (readValue(buffer) as Long?)?.let {
ReaderFlagPigeon.ofRaw(it.toInt())
}
}
130.toByte() -> {
return (readValue(buffer) as Long?)?.let {
AdapterStatePigeon.ofRaw(it.toInt())
}
}
131.toByte() -> {
return (readValue(buffer) as Long?)?.let {
TypeNameFormatPigeon.ofRaw(it.toInt())
}
}
132.toByte() -> {
return (readValue(buffer) as Long?)?.let {
NfcBarcodeTypePigeon.ofRaw(it.toInt())
}
}
133.toByte() -> {
return (readValue(buffer) as Long?)?.let {
MifareClassicTypePigeon.ofRaw(it.toInt())
}
}
134.toByte() -> {
return (readValue(buffer) as Long?)?.let {
MifareUltralightTypePigeon.ofRaw(it.toInt())
}
}
135.toByte() -> {
return (readValue(buffer) as? List)?.let {
TagPigeon.fromList(it)
}
}
136.toByte() -> {
return (readValue(buffer) as? List)?.let {
NdefPigeon.fromList(it)
}
}
137.toByte() -> {
return (readValue(buffer) as? List)?.let {
NfcAPigeon.fromList(it)
}
}
138.toByte() -> {
return (readValue(buffer) as? List)?.let {
NfcBPigeon.fromList(it)
}
}
139.toByte() -> {
return (readValue(buffer) as? List)?.let {
NfcFPigeon.fromList(it)
}
}
140.toByte() -> {
return (readValue(buffer) as? List)?.let {
NfcVPigeon.fromList(it)
}
}
141.toByte() -> {
return (readValue(buffer) as? List)?.let {
IsoDepPigeon.fromList(it)
}
}
142.toByte() -> {
return (readValue(buffer) as? List)?.let {
MifareClassicPigeon.fromList(it)
}
}
143.toByte() -> {
return (readValue(buffer) as? List)?.let {
MifareUltralightPigeon.fromList(it)
}
}
144.toByte() -> {
return (readValue(buffer) as? List)?.let {
NfcBarcodePigeon.fromList(it)
}
}
145.toByte() -> {
return (readValue(buffer) as? List)?.let {
NdefMessagePigeon.fromList(it)
}
}
146.toByte() -> {
return (readValue(buffer) as? List)?.let {
NdefRecordPigeon.fromList(it)
}
}
else -> super.readValueOfType(type, buffer)
}
}
override fun writeValue(stream: ByteArrayOutputStream, value: Any?) {
when (value) {
is ReaderFlagPigeon -> {
stream.write(129)
writeValue(stream, value.raw.toLong())
}
is AdapterStatePigeon -> {
stream.write(130)
writeValue(stream, value.raw.toLong())
}
is TypeNameFormatPigeon -> {
stream.write(131)
writeValue(stream, value.raw.toLong())
}
is NfcBarcodeTypePigeon -> {
stream.write(132)
writeValue(stream, value.raw.toLong())
}
is MifareClassicTypePigeon -> {
stream.write(133)
writeValue(stream, value.raw.toLong())
}
is MifareUltralightTypePigeon -> {
stream.write(134)
writeValue(stream, value.raw.toLong())
}
is TagPigeon -> {
stream.write(135)
writeValue(stream, value.toList())
}
is NdefPigeon -> {
stream.write(136)
writeValue(stream, value.toList())
}
is NfcAPigeon -> {
stream.write(137)
writeValue(stream, value.toList())
}
is NfcBPigeon -> {
stream.write(138)
writeValue(stream, value.toList())
}
is NfcFPigeon -> {
stream.write(139)
writeValue(stream, value.toList())
}
is NfcVPigeon -> {
stream.write(140)
writeValue(stream, value.toList())
}
is IsoDepPigeon -> {
stream.write(141)
writeValue(stream, value.toList())
}
is MifareClassicPigeon -> {
stream.write(142)
writeValue(stream, value.toList())
}
is MifareUltralightPigeon -> {
stream.write(143)
writeValue(stream, value.toList())
}
is NfcBarcodePigeon -> {
stream.write(144)
writeValue(stream, value.toList())
}
is NdefMessagePigeon -> {
stream.write(145)
writeValue(stream, value.toList())
}
is NdefRecordPigeon -> {
stream.write(146)
writeValue(stream, value.toList())
}
else -> super.writeValue(stream, value)
}
}
}
/** Generated class from Pigeon that represents Flutter messages that can be called from Kotlin. */
class FlutterApiPigeon(private val binaryMessenger: BinaryMessenger, private val messageChannelSuffix: String = "") {
companion object {
/** The codec used by FlutterApiPigeon. */
val codec: MessageCodec by lazy {
PigeonPigeonCodec()
}
}
fun onTagDiscovered(tagArg: TagPigeon, callback: (Result) -> Unit)
{
val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else ""
val channelName = "dev.flutter.pigeon.nfc_manager.FlutterApiPigeon.onTagDiscovered$separatedMessageChannelSuffix"
val channel = BasicMessageChannel(binaryMessenger, channelName, codec)
channel.send(listOf(tagArg)) {
if (it is List<*>) {
if (it.size > 1) {
callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?)))
} else {
callback(Result.success(Unit))
}
} else {
callback(Result.failure(PigeonPigeonUtils.createConnectionError(channelName)))
}
}
}
fun onAdapterStateChanged(stateArg: AdapterStatePigeon, callback: (Result) -> Unit)
{
val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else ""
val channelName = "dev.flutter.pigeon.nfc_manager.FlutterApiPigeon.onAdapterStateChanged$separatedMessageChannelSuffix"
val channel = BasicMessageChannel(binaryMessenger, channelName, codec)
channel.send(listOf(stateArg)) {
if (it is List<*>) {
if (it.size > 1) {
callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?)))
} else {
callback(Result.success(Unit))
}
} else {
callback(Result.failure(PigeonPigeonUtils.createConnectionError(channelName)))
}
}
}
}
/** Generated interface from Pigeon that represents a handler of messages from Flutter. */
interface HostApiPigeon {
fun nfcAdapterIsEnabled(): Boolean
fun nfcAdapterIsSecureNfcEnabled(): Boolean
fun nfcAdapterIsSecureNfcSupported(): Boolean
fun nfcAdapterEnableReaderMode(flags: List)
fun nfcAdapterDisableReaderMode()
fun ndefGetNdefMessage(handle: String): NdefMessagePigeon?
fun ndefWriteNdefMessage(handle: String, message: NdefMessagePigeon)
fun ndefMakeReadOnly(handle: String): Boolean
fun nfcAGetMaxTransceiveLength(handle: String): Long
fun nfcAGetTimeout(handle: String): Long
fun nfcASetTimeout(handle: String, timeout: Long)
fun nfcATransceive(handle: String, bytes: ByteArray): ByteArray
fun nfcBGetMaxTransceiveLength(handle: String): Long
fun nfcBTransceive(handle: String, bytes: ByteArray): ByteArray
fun nfcFGetMaxTransceiveLength(handle: String): Long
fun nfcFGetTimeout(handle: String): Long
fun nfcFSetTimeout(handle: String, timeout: Long)
fun nfcFTransceive(handle: String, bytes: ByteArray): ByteArray
fun nfcVGetMaxTransceiveLength(handle: String): Long
fun nfcVTransceive(handle: String, bytes: ByteArray): ByteArray
fun isoDepGetMaxTransceiveLength(handle: String): Long
fun isoDepGetTimeout(handle: String): Long
fun isoDepSetTimeout(handle: String, timeout: Long)
fun isoDepTransceive(handle: String, bytes: ByteArray): ByteArray
fun mifareClassicGetMaxTransceiveLength(handle: String): Long
fun mifareClassicGetTimeout(handle: String): Long
fun mifareClassicSetTimeout(handle: String, timeout: Long)
fun mifareClassicBlockToSector(handle: String, blockIndex: Long): Long
fun mifareClassicGetBlockCountInSector(handle: String, sectorIndex: Long): Long
fun mifareClassicSectorToBlock(handle: String, sectorIndex: Long): Long
fun mifareClassicAuthenticateSectorWithKeyA(handle: String, sectorIndex: Long, key: ByteArray): Boolean
fun mifareClassicAuthenticateSectorWithKeyB(handle: String, sectorIndex: Long, key: ByteArray): Boolean
fun mifareClassicIncrement(handle: String, blockIndex: Long, value: Long)
fun mifareClassicDecrement(handle: String, blockIndex: Long, value: Long)
fun mifareClassicReadBlock(handle: String, blockIndex: Long): ByteArray
fun mifareClassicWriteBlock(handle: String, blockIndex: Long, data: ByteArray)
fun mifareClassicRestore(handle: String, blockIndex: Long)
fun mifareClassicTransfer(handle: String, blockIndex: Long)
fun mifareClassicTransceive(handle: String, bytes: ByteArray): ByteArray
fun mifareUltralightGetMaxTransceiveLength(handle: String): Long
fun mifareUltralightGetTimeout(handle: String): Long
fun mifareUltralightSetTimeout(handle: String, timeout: Long)
fun mifareUltralightReadPages(handle: String, pageOffset: Long): ByteArray
fun mifareUltralightWritePage(handle: String, pageOffset: Long, data: ByteArray)
fun mifareUltralightTransceive(handle: String, bytes: ByteArray): ByteArray
fun ndefFormatableFormat(handle: String, firstMessage: NdefMessagePigeon)
fun ndefFormatableFormatReadOnly(handle: String, firstMessage: NdefMessagePigeon)
companion object {
/** The codec used by HostApiPigeon. */
val codec: MessageCodec by lazy {
PigeonPigeonCodec()
}
/** Sets up an instance of `HostApiPigeon` to handle messages through the `binaryMessenger`. */
@JvmOverloads
fun setUp(binaryMessenger: BinaryMessenger, api: HostApiPigeon?, messageChannelSuffix: String = "") {
val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else ""
run {
val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.nfc_manager.HostApiPigeon.nfcAdapterIsEnabled$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { _, reply ->
val wrapped: List = try {
listOf(api.nfcAdapterIsEnabled())
} catch (exception: Throwable) {
PigeonPigeonUtils.wrapError(exception)
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
}
}
run {
val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.nfc_manager.HostApiPigeon.nfcAdapterIsSecureNfcEnabled$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { _, reply ->
val wrapped: List = try {
listOf(api.nfcAdapterIsSecureNfcEnabled())
} catch (exception: Throwable) {
PigeonPigeonUtils.wrapError(exception)
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
}
}
run {
val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.nfc_manager.HostApiPigeon.nfcAdapterIsSecureNfcSupported$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { _, reply ->
val wrapped: List = try {
listOf(api.nfcAdapterIsSecureNfcSupported())
} catch (exception: Throwable) {
PigeonPigeonUtils.wrapError(exception)
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
}
}
run {
val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.nfc_manager.HostApiPigeon.nfcAdapterEnableReaderMode$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List
val flagsArg = args[0] as List
val wrapped: List = try {
api.nfcAdapterEnableReaderMode(flagsArg)
listOf(null)
} catch (exception: Throwable) {
PigeonPigeonUtils.wrapError(exception)
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
}
}
run {
val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.nfc_manager.HostApiPigeon.nfcAdapterDisableReaderMode$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { _, reply ->
val wrapped: List = try {
api.nfcAdapterDisableReaderMode()
listOf(null)
} catch (exception: Throwable) {
PigeonPigeonUtils.wrapError(exception)
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
}
}
run {
val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.nfc_manager.HostApiPigeon.ndefGetNdefMessage$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List
val handleArg = args[0] as String
val wrapped: List = try {
listOf(api.ndefGetNdefMessage(handleArg))
} catch (exception: Throwable) {
PigeonPigeonUtils.wrapError(exception)
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
}
}
run {
val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.nfc_manager.HostApiPigeon.ndefWriteNdefMessage$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List
val handleArg = args[0] as String
val messageArg = args[1] as NdefMessagePigeon
val wrapped: List = try {
api.ndefWriteNdefMessage(handleArg, messageArg)
listOf(null)
} catch (exception: Throwable) {
PigeonPigeonUtils.wrapError(exception)
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
}
}
run {
val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.nfc_manager.HostApiPigeon.ndefMakeReadOnly$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List
val handleArg = args[0] as String
val wrapped: List = try {
listOf(api.ndefMakeReadOnly(handleArg))
} catch (exception: Throwable) {
PigeonPigeonUtils.wrapError(exception)
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
}
}
run {
val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.nfc_manager.HostApiPigeon.nfcAGetMaxTransceiveLength$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List
val handleArg = args[0] as String
val wrapped: List = try {
listOf(api.nfcAGetMaxTransceiveLength(handleArg))
} catch (exception: Throwable) {
PigeonPigeonUtils.wrapError(exception)
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
}
}
run {
val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.nfc_manager.HostApiPigeon.nfcAGetTimeout$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List
val handleArg = args[0] as String
val wrapped: List = try {
listOf(api.nfcAGetTimeout(handleArg))
} catch (exception: Throwable) {
PigeonPigeonUtils.wrapError(exception)
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
}
}
run {
val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.nfc_manager.HostApiPigeon.nfcASetTimeout$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List
val handleArg = args[0] as String
val timeoutArg = args[1] as Long
val wrapped: List = try {
api.nfcASetTimeout(handleArg, timeoutArg)
listOf(null)
} catch (exception: Throwable) {
PigeonPigeonUtils.wrapError(exception)
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
}
}
run {
val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.nfc_manager.HostApiPigeon.nfcATransceive$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List
val handleArg = args[0] as String
val bytesArg = args[1] as ByteArray
val wrapped: List = try {
listOf(api.nfcATransceive(handleArg, bytesArg))
} catch (exception: Throwable) {
PigeonPigeonUtils.wrapError(exception)
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
}
}
run {
val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.nfc_manager.HostApiPigeon.nfcBGetMaxTransceiveLength$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List
val handleArg = args[0] as String
val wrapped: List = try {
listOf(api.nfcBGetMaxTransceiveLength(handleArg))
} catch (exception: Throwable) {
PigeonPigeonUtils.wrapError(exception)
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
}
}
run {
val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.nfc_manager.HostApiPigeon.nfcBTransceive$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List
val handleArg = args[0] as String
val bytesArg = args[1] as ByteArray
val wrapped: List = try {
listOf(api.nfcBTransceive(handleArg, bytesArg))
} catch (exception: Throwable) {
PigeonPigeonUtils.wrapError(exception)
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
}
}
run {
val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.nfc_manager.HostApiPigeon.nfcFGetMaxTransceiveLength$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List
val handleArg = args[0] as String
val wrapped: List = try {
listOf(api.nfcFGetMaxTransceiveLength(handleArg))
} catch (exception: Throwable) {
PigeonPigeonUtils.wrapError(exception)
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
}
}
run {
val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.nfc_manager.HostApiPigeon.nfcFGetTimeout$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List
val handleArg = args[0] as String
val wrapped: List = try {
listOf(api.nfcFGetTimeout(handleArg))
} catch (exception: Throwable) {
PigeonPigeonUtils.wrapError(exception)
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
}
}
run {
val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.nfc_manager.HostApiPigeon.nfcFSetTimeout$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List
val handleArg = args[0] as String
val timeoutArg = args[1] as Long
val wrapped: List = try {
api.nfcFSetTimeout(handleArg, timeoutArg)
listOf(null)
} catch (exception: Throwable) {
PigeonPigeonUtils.wrapError(exception)
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
}
}
run {
val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.nfc_manager.HostApiPigeon.nfcFTransceive$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List
val handleArg = args[0] as String
val bytesArg = args[1] as ByteArray
val wrapped: List = try {
listOf(api.nfcFTransceive(handleArg, bytesArg))
} catch (exception: Throwable) {
PigeonPigeonUtils.wrapError(exception)
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
}
}
run {
val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.nfc_manager.HostApiPigeon.nfcVGetMaxTransceiveLength$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List
val handleArg = args[0] as String
val wrapped: List = try {
listOf(api.nfcVGetMaxTransceiveLength(handleArg))
} catch (exception: Throwable) {
PigeonPigeonUtils.wrapError(exception)
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
}
}
run {
val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.nfc_manager.HostApiPigeon.nfcVTransceive$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List
val handleArg = args[0] as String
val bytesArg = args[1] as ByteArray
val wrapped: List = try {
listOf(api.nfcVTransceive(handleArg, bytesArg))
} catch (exception: Throwable) {
PigeonPigeonUtils.wrapError(exception)
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
}
}
run {
val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.nfc_manager.HostApiPigeon.isoDepGetMaxTransceiveLength$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List
val handleArg = args[0] as String
val wrapped: List = try {
listOf(api.isoDepGetMaxTransceiveLength(handleArg))
} catch (exception: Throwable) {
PigeonPigeonUtils.wrapError(exception)
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
}
}
run {
val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.nfc_manager.HostApiPigeon.isoDepGetTimeout$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List
val handleArg = args[0] as String
val wrapped: List = try {
listOf(api.isoDepGetTimeout(handleArg))
} catch (exception: Throwable) {
PigeonPigeonUtils.wrapError(exception)
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
}
}
run {
val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.nfc_manager.HostApiPigeon.isoDepSetTimeout$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List
val handleArg = args[0] as String
val timeoutArg = args[1] as Long
val wrapped: List = try {
api.isoDepSetTimeout(handleArg, timeoutArg)
listOf(null)
} catch (exception: Throwable) {
PigeonPigeonUtils.wrapError(exception)
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
}
}
run {
val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.nfc_manager.HostApiPigeon.isoDepTransceive$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List
val handleArg = args[0] as String
val bytesArg = args[1] as ByteArray
val wrapped: List = try {
listOf(api.isoDepTransceive(handleArg, bytesArg))
} catch (exception: Throwable) {
PigeonPigeonUtils.wrapError(exception)
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
}
}
run {
val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.nfc_manager.HostApiPigeon.mifareClassicGetMaxTransceiveLength$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List
val handleArg = args[0] as String
val wrapped: List = try {
listOf(api.mifareClassicGetMaxTransceiveLength(handleArg))
} catch (exception: Throwable) {
PigeonPigeonUtils.wrapError(exception)
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
}
}
run {
val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.nfc_manager.HostApiPigeon.mifareClassicGetTimeout$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List
val handleArg = args[0] as String
val wrapped: List = try {
listOf(api.mifareClassicGetTimeout(handleArg))
} catch (exception: Throwable) {
PigeonPigeonUtils.wrapError(exception)
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
}
}
run {
val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.nfc_manager.HostApiPigeon.mifareClassicSetTimeout$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List
val handleArg = args[0] as String
val timeoutArg = args[1] as Long
val wrapped: List = try {
api.mifareClassicSetTimeout(handleArg, timeoutArg)
listOf(null)
} catch (exception: Throwable) {
PigeonPigeonUtils.wrapError(exception)
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
}
}
run {
val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.nfc_manager.HostApiPigeon.mifareClassicBlockToSector$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List
val handleArg = args[0] as String
val blockIndexArg = args[1] as Long
val wrapped: List = try {
listOf(api.mifareClassicBlockToSector(handleArg, blockIndexArg))
} catch (exception: Throwable) {
PigeonPigeonUtils.wrapError(exception)
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
}
}
run {
val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.nfc_manager.HostApiPigeon.mifareClassicGetBlockCountInSector$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List
val handleArg = args[0] as String
val sectorIndexArg = args[1] as Long
val wrapped: List = try {
listOf(api.mifareClassicGetBlockCountInSector(handleArg, sectorIndexArg))
} catch (exception: Throwable) {
PigeonPigeonUtils.wrapError(exception)
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
}
}
run {
val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.nfc_manager.HostApiPigeon.mifareClassicSectorToBlock$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List
val handleArg = args[0] as String
val sectorIndexArg = args[1] as Long
val wrapped: List = try {
listOf(api.mifareClassicSectorToBlock(handleArg, sectorIndexArg))
} catch (exception: Throwable) {
PigeonPigeonUtils.wrapError(exception)
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
}
}
run {
val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.nfc_manager.HostApiPigeon.mifareClassicAuthenticateSectorWithKeyA$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List
val handleArg = args[0] as String
val sectorIndexArg = args[1] as Long
val keyArg = args[2] as ByteArray
val wrapped: List = try {
listOf(api.mifareClassicAuthenticateSectorWithKeyA(handleArg, sectorIndexArg, keyArg))
} catch (exception: Throwable) {
PigeonPigeonUtils.wrapError(exception)
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
}
}
run {
val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.nfc_manager.HostApiPigeon.mifareClassicAuthenticateSectorWithKeyB$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List
val handleArg = args[0] as String
val sectorIndexArg = args[1] as Long
val keyArg = args[2] as ByteArray
val wrapped: List = try {
listOf(api.mifareClassicAuthenticateSectorWithKeyB(handleArg, sectorIndexArg, keyArg))
} catch (exception: Throwable) {
PigeonPigeonUtils.wrapError(exception)
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
}
}
run {
val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.nfc_manager.HostApiPigeon.mifareClassicIncrement$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List
val handleArg = args[0] as String
val blockIndexArg = args[1] as Long
val valueArg = args[2] as Long
val wrapped: List = try {
api.mifareClassicIncrement(handleArg, blockIndexArg, valueArg)
listOf(null)
} catch (exception: Throwable) {
PigeonPigeonUtils.wrapError(exception)
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
}
}
run {
val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.nfc_manager.HostApiPigeon.mifareClassicDecrement$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List
val handleArg = args[0] as String
val blockIndexArg = args[1] as Long
val valueArg = args[2] as Long
val wrapped: List = try {
api.mifareClassicDecrement(handleArg, blockIndexArg, valueArg)
listOf(null)
} catch (exception: Throwable) {
PigeonPigeonUtils.wrapError(exception)
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
}
}
run {
val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.nfc_manager.HostApiPigeon.mifareClassicReadBlock$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List
val handleArg = args[0] as String
val blockIndexArg = args[1] as Long
val wrapped: List = try {
listOf(api.mifareClassicReadBlock(handleArg, blockIndexArg))
} catch (exception: Throwable) {
PigeonPigeonUtils.wrapError(exception)
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
}
}
run {
val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.nfc_manager.HostApiPigeon.mifareClassicWriteBlock$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List
val handleArg = args[0] as String
val blockIndexArg = args[1] as Long
val dataArg = args[2] as ByteArray
val wrapped: List = try {
api.mifareClassicWriteBlock(handleArg, blockIndexArg, dataArg)
listOf(null)
} catch (exception: Throwable) {
PigeonPigeonUtils.wrapError(exception)
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
}
}
run {
val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.nfc_manager.HostApiPigeon.mifareClassicRestore$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List
val handleArg = args[0] as String
val blockIndexArg = args[1] as Long
val wrapped: List = try {
api.mifareClassicRestore(handleArg, blockIndexArg)
listOf(null)
} catch (exception: Throwable) {
PigeonPigeonUtils.wrapError(exception)
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
}
}
run {
val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.nfc_manager.HostApiPigeon.mifareClassicTransfer$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List
val handleArg = args[0] as String
val blockIndexArg = args[1] as Long
val wrapped: List = try {
api.mifareClassicTransfer(handleArg, blockIndexArg)
listOf(null)
} catch (exception: Throwable) {
PigeonPigeonUtils.wrapError(exception)
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
}
}
run {
val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.nfc_manager.HostApiPigeon.mifareClassicTransceive$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List
val handleArg = args[0] as String
val bytesArg = args[1] as ByteArray
val wrapped: List = try {
listOf(api.mifareClassicTransceive(handleArg, bytesArg))
} catch (exception: Throwable) {
PigeonPigeonUtils.wrapError(exception)
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
}
}
run {
val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.nfc_manager.HostApiPigeon.mifareUltralightGetMaxTransceiveLength$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List
val handleArg = args[0] as String
val wrapped: List = try {
listOf(api.mifareUltralightGetMaxTransceiveLength(handleArg))
} catch (exception: Throwable) {
PigeonPigeonUtils.wrapError(exception)
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
}
}
run {
val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.nfc_manager.HostApiPigeon.mifareUltralightGetTimeout$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List
val handleArg = args[0] as String
val wrapped: List = try {
listOf(api.mifareUltralightGetTimeout(handleArg))
} catch (exception: Throwable) {
PigeonPigeonUtils.wrapError(exception)
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
}
}
run {
val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.nfc_manager.HostApiPigeon.mifareUltralightSetTimeout$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List
val handleArg = args[0] as String
val timeoutArg = args[1] as Long
val wrapped: List = try {
api.mifareUltralightSetTimeout(handleArg, timeoutArg)
listOf(null)
} catch (exception: Throwable) {
PigeonPigeonUtils.wrapError(exception)
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
}
}
run {
val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.nfc_manager.HostApiPigeon.mifareUltralightReadPages$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List
val handleArg = args[0] as String
val pageOffsetArg = args[1] as Long
val wrapped: List = try {
listOf(api.mifareUltralightReadPages(handleArg, pageOffsetArg))
} catch (exception: Throwable) {
PigeonPigeonUtils.wrapError(exception)
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
}
}
run {
val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.nfc_manager.HostApiPigeon.mifareUltralightWritePage$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List
val handleArg = args[0] as String
val pageOffsetArg = args[1] as Long
val dataArg = args[2] as ByteArray
val wrapped: List = try {
api.mifareUltralightWritePage(handleArg, pageOffsetArg, dataArg)
listOf(null)
} catch (exception: Throwable) {
PigeonPigeonUtils.wrapError(exception)
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
}
}
run {
val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.nfc_manager.HostApiPigeon.mifareUltralightTransceive$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List
val handleArg = args[0] as String
val bytesArg = args[1] as ByteArray
val wrapped: List = try {
listOf(api.mifareUltralightTransceive(handleArg, bytesArg))
} catch (exception: Throwable) {
PigeonPigeonUtils.wrapError(exception)
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
}
}
run {
val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.nfc_manager.HostApiPigeon.ndefFormatableFormat$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List
val handleArg = args[0] as String
val firstMessageArg = args[1] as NdefMessagePigeon
val wrapped: List = try {
api.ndefFormatableFormat(handleArg, firstMessageArg)
listOf(null)
} catch (exception: Throwable) {
PigeonPigeonUtils.wrapError(exception)
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
}
}
run {
val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.nfc_manager.HostApiPigeon.ndefFormatableFormatReadOnly$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List
val handleArg = args[0] as String
val firstMessageArg = args[1] as NdefMessagePigeon
val wrapped: List = try {
api.ndefFormatableFormatReadOnly(handleArg, firstMessageArg)
listOf(null)
} catch (exception: Throwable) {
PigeonPigeonUtils.wrapError(exception)
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
}
}
}
}
}
================================================
FILE: android/src/test/kotlin/dev/flutter/plugins/nfcmanager/NfcManagerPluginTest.kt
================================================
package dev.flutter.plugins.nfcmanager
internal class NfcManagerPluginTest {}
================================================
FILE: example/.gitignore
================================================
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.build/
.buildlog/
.history
.svn/
.swiftpm/
migrate_working_dir/
# IntelliJ related
*.iml
*.ipr
*.iws
.idea/
# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/
# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins-dependencies
.pub-cache/
.pub/
/build/
/coverage/
# Symbolication related
app.*.symbols
# Obfuscation related
app.*.map.json
# Android Studio will place build artifacts here
/android/app/debug
/android/app/profile
/android/app/release
================================================
FILE: example/README.md
================================================
# nfc_manager_example
Demonstrates how to use the nfc_manager plugin.
## Getting Started
This project is a starting point for a Flutter application.
A few resources to get you started if this is your first Flutter project:
- [Learn Flutter](https://docs.flutter.dev/get-started/learn-flutter)
- [Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
- [Flutter learning resources](https://docs.flutter.dev/reference/learning-resources)
For help getting started with Flutter development, view the
[online documentation](https://docs.flutter.dev/), which offers tutorials,
samples, guidance on mobile development, and a full API reference.
================================================
FILE: example/analysis_options.yaml
================================================
include: package:flutter_lints/flutter.yaml
================================================
FILE: example/android/.gitignore
================================================
gradle-wrapper.jar
/.gradle
/captures/
/gradlew
/gradlew.bat
/local.properties
GeneratedPluginRegistrant.java
.cxx/
# Remember to never publicly share your keystore.
# See https://flutter.dev/to/reference-keystore
key.properties
**/*.keystore
**/*.jks
================================================
FILE: example/android/app/build.gradle.kts
================================================
plugins {
id("com.android.application")
id("kotlin-android")
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
id("dev.flutter.flutter-gradle-plugin")
}
android {
namespace = "dev.flutter.plugins.nfcmanagerexample"
compileSdk = flutter.compileSdkVersion
ndkVersion = flutter.ndkVersion
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_17.toString()
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId = "dev.flutter.plugins.nfcmanagerexample"
// You can update the following values to match your application needs.
// For more information, see: https://flutter.dev/to/review-gradle-config.
minSdk = flutter.minSdkVersion
targetSdk = flutter.targetSdkVersion
versionCode = flutter.versionCode
versionName = flutter.versionName
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig = signingConfigs.getByName("debug")
}
}
}
flutter {
source = "../.."
}
================================================
FILE: example/android/app/src/debug/AndroidManifest.xml
================================================
================================================
FILE: example/android/app/src/main/AndroidManifest.xml
================================================
================================================
FILE: example/android/app/src/main/kotlin/dev/flutter/plugins/nfcmanagerexample/MainActivity.kt
================================================
package dev.flutter.plugins.nfcmanagerexample
import io.flutter.embedding.android.FlutterActivity
class MainActivity : FlutterActivity()
================================================
FILE: example/android/app/src/main/res/drawable/launch_background.xml
================================================
================================================
FILE: example/android/app/src/main/res/drawable-v21/launch_background.xml
================================================
================================================
FILE: example/android/app/src/main/res/values/styles.xml
================================================
================================================
FILE: example/android/app/src/main/res/values-night/styles.xml
================================================
================================================
FILE: example/android/app/src/profile/AndroidManifest.xml
================================================
================================================
FILE: example/android/build.gradle.kts
================================================
allprojects {
repositories {
google()
mavenCentral()
}
}
val newBuildDir: Directory =
rootProject.layout.buildDirectory
.dir("../../build")
.get()
rootProject.layout.buildDirectory.value(newBuildDir)
subprojects {
val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name)
project.layout.buildDirectory.value(newSubprojectBuildDir)
}
subprojects {
project.evaluationDependsOn(":app")
}
tasks.register("clean") {
delete(rootProject.layout.buildDirectory)
}
================================================
FILE: example/android/gradle/wrapper/gradle-wrapper.properties
================================================
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-all.zip
================================================
FILE: example/android/gradle.properties
================================================
org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
android.useAndroidX=true
================================================
FILE: example/android/settings.gradle.kts
================================================
pluginManagement {
val flutterSdkPath =
run {
val properties = java.util.Properties()
file("local.properties").inputStream().use { properties.load(it) }
val flutterSdkPath = properties.getProperty("flutter.sdk")
require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" }
flutterSdkPath
}
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
plugins {
id("dev.flutter.flutter-plugin-loader") version "1.0.0"
id("com.android.application") version "8.11.1" apply false
id("org.jetbrains.kotlin.android") version "2.2.20" apply false
}
include(":app")
================================================
FILE: example/ios/.gitignore
================================================
**/dgph
*.mode1v3
*.mode2v3
*.moved-aside
*.pbxuser
*.perspectivev3
**/*sync/
.sconsign.dblite
.tags*
**/.vagrant/
**/DerivedData/
Icon?
**/Pods/
**/.symlinks/
profile
xcuserdata
**/.generated/
Flutter/App.framework
Flutter/Flutter.framework
Flutter/Flutter.podspec
Flutter/Generated.xcconfig
Flutter/ephemeral/
Flutter/app.flx
Flutter/app.zip
Flutter/flutter_assets/
Flutter/flutter_export_environment.sh
ServiceDefinitions.json
Runner/GeneratedPluginRegistrant.*
# Exceptions to above rules.
!default.mode1v3
!default.mode2v3
!default.pbxuser
!default.perspectivev3
================================================
FILE: example/ios/Flutter/AppFrameworkInfo.plist
================================================
CFBundleDevelopmentRegion
en
CFBundleExecutable
App
CFBundleIdentifier
io.flutter.flutter.app
CFBundleInfoDictionaryVersion
6.0
CFBundleName
App
CFBundlePackageType
FMWK
CFBundleShortVersionString
1.0
CFBundleSignature
????
CFBundleVersion
1.0
================================================
FILE: example/ios/Flutter/Debug.xcconfig
================================================
#include "Generated.xcconfig"
================================================
FILE: example/ios/Flutter/Release.xcconfig
================================================
#include "Generated.xcconfig"
================================================
FILE: example/ios/Runner/AppDelegate.swift
================================================
import Flutter
import UIKit
@main
@objc class AppDelegate: FlutterAppDelegate, FlutterImplicitEngineDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
func didInitializeImplicitFlutterEngine(_ engineBridge: FlutterImplicitEngineBridge) {
GeneratedPluginRegistrant.register(with: engineBridge.pluginRegistry)
}
}
================================================
FILE: example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
================================================
{
"images" : [
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "Icon-App-20x20@2x.png",
"scale" : "2x"
},
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "Icon-App-20x20@3x.png",
"scale" : "3x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@1x.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@2x.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@3x.png",
"scale" : "3x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon-App-40x40@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon-App-40x40@3x.png",
"scale" : "3x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-App-60x60@2x.png",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-App-60x60@3x.png",
"scale" : "3x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "Icon-App-20x20@1x.png",
"scale" : "1x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "Icon-App-20x20@2x.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon-App-29x29@1x.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon-App-29x29@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon-App-40x40@1x.png",
"scale" : "1x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon-App-40x40@2x.png",
"scale" : "2x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-App-76x76@1x.png",
"scale" : "1x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-App-76x76@2x.png",
"scale" : "2x"
},
{
"size" : "83.5x83.5",
"idiom" : "ipad",
"filename" : "Icon-App-83.5x83.5@2x.png",
"scale" : "2x"
},
{
"size" : "1024x1024",
"idiom" : "ios-marketing",
"filename" : "Icon-App-1024x1024@1x.png",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"filename" : "LaunchImage.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "LaunchImage@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "LaunchImage@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md
================================================
# Launch Screen Assets
You can customize the launch screen with your own desired assets by replacing the image files in this directory.
You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
================================================
FILE: example/ios/Runner/Base.lproj/LaunchScreen.storyboard
================================================
================================================
FILE: example/ios/Runner/Base.lproj/Main.storyboard
================================================
================================================
FILE: example/ios/Runner/Info.plist
================================================
CADisableMinimumFrameDurationOnPhone
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleDisplayName
nfc_manager_example
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
nfc_manager_example
CFBundlePackageType
APPL
CFBundleShortVersionString
$(FLUTTER_BUILD_NAME)
CFBundleSignature
????
CFBundleVersion
$(FLUTTER_BUILD_NUMBER)
LSRequiresIPhoneOS
UIApplicationSceneManifest
UIApplicationSupportsMultipleScenes
UISceneConfigurations
UIWindowSceneSessionRoleApplication
UISceneClassName
UIWindowScene
UISceneConfigurationName
flutter
UISceneDelegateClassName
$(PRODUCT_MODULE_NAME).SceneDelegate
UISceneStoryboardFile
Main
UIApplicationSupportsIndirectInputEvents
UILaunchStoryboardName
LaunchScreen
UIMainStoryboardFile
Main
UISupportedInterfaceOrientations
UIInterfaceOrientationPortrait
UIInterfaceOrientationLandscapeLeft
UIInterfaceOrientationLandscapeRight
UISupportedInterfaceOrientations~ipad
UIInterfaceOrientationPortrait
UIInterfaceOrientationPortraitUpsideDown
UIInterfaceOrientationLandscapeLeft
UIInterfaceOrientationLandscapeRight
================================================
FILE: example/ios/Runner/Runner-Bridging-Header.h
================================================
#import "GeneratedPluginRegistrant.h"
================================================
FILE: example/ios/Runner/SceneDelegate.swift
================================================
import Flutter
class SceneDelegate: FlutterSceneDelegate {}
================================================
FILE: example/ios/Runner.xcodeproj/project.pbxproj
================================================
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 54;
objects = {
/* Begin PBXBuildFile section */
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
7884E8682EC3CC0700C636F2 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */; };
78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
331C8085294A63A400263BE5 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 97C146E61CF9000F007C117D /* Project object */;
proxyType = 1;
remoteGlobalIDString = 97C146ED1CF9000F007C117D;
remoteInfo = Runner;
};
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
9705A1C41CF9048500538489 /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; };
331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; };
331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; };
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; };
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; };
78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = FlutterGeneratedPluginSwiftPackage; path = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; sourceTree = ""; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; };
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; };
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
97C146EB1CF9000F007C117D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
331C8082294A63A400263BE5 /* RunnerTests */ = {
isa = PBXGroup;
children = (
331C807B294A618700263BE5 /* RunnerTests.swift */,
);
path = RunnerTests;
sourceTree = "";
};
9740EEB11CF90186004384FC /* Flutter */ = {
isa = PBXGroup;
children = (
78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */,
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
9740EEB21CF90195004384FC /* Debug.xcconfig */,
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
9740EEB31CF90195004384FC /* Generated.xcconfig */,
);
name = Flutter;
sourceTree = "";
};
97C146E51CF9000F007C117D = {
isa = PBXGroup;
children = (
9740EEB11CF90186004384FC /* Flutter */,
97C146F01CF9000F007C117D /* Runner */,
97C146EF1CF9000F007C117D /* Products */,
331C8082294A63A400263BE5 /* RunnerTests */,
);
sourceTree = "";
};
97C146EF1CF9000F007C117D /* Products */ = {
isa = PBXGroup;
children = (
97C146EE1CF9000F007C117D /* Runner.app */,
331C8081294A63A400263BE5 /* RunnerTests.xctest */,
);
name = Products;
sourceTree = "";
};
97C146F01CF9000F007C117D /* Runner */ = {
isa = PBXGroup;
children = (
97C146FA1CF9000F007C117D /* Main.storyboard */,
97C146FD1CF9000F007C117D /* Assets.xcassets */,
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
97C147021CF9000F007C117D /* Info.plist */,
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */,
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
);
path = Runner;
sourceTree = "";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
331C8080294A63A400263BE5 /* RunnerTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */;
buildPhases = (
331C807D294A63A400263BE5 /* Sources */,
331C807F294A63A400263BE5 /* Resources */,
);
buildRules = (
);
dependencies = (
331C8086294A63A400263BE5 /* PBXTargetDependency */,
);
name = RunnerTests;
productName = RunnerTests;
productReference = 331C8081294A63A400263BE5 /* RunnerTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
97C146ED1CF9000F007C117D /* Runner */ = {
isa = PBXNativeTarget;
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = (
9740EEB61CF901F6004384FC /* Run Script */,
97C146EA1CF9000F007C117D /* Sources */,
97C146EB1CF9000F007C117D /* Frameworks */,
97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
);
buildRules = (
);
dependencies = (
);
name = Runner;
packageProductDependencies = (
78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */,
);
productName = Runner;
productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = YES;
LastUpgradeCheck = 1510;
ORGANIZATIONNAME = "";
TargetAttributes = {
331C8080294A63A400263BE5 = {
CreatedOnToolsVersion = 14.0;
TestTargetID = 97C146ED1CF9000F007C117D;
};
97C146ED1CF9000F007C117D = {
CreatedOnToolsVersion = 7.3.1;
LastSwiftMigration = 1100;
};
};
};
buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
compatibilityVersion = "Xcode 9.3";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 97C146E51CF9000F007C117D;
packageReferences = (
781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */,
);
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
97C146ED1CF9000F007C117D /* Runner */,
331C8080294A63A400263BE5 /* RunnerTests */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
331C807F294A63A400263BE5 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
97C146EC1CF9000F007C117D /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
);
name = "Thin Binary";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Run Script";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
331C807D294A63A400263BE5 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
97C146EA1CF9000F007C117D /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
7884E8682EC3CC0700C636F2 /* SceneDelegate.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
331C8086294A63A400263BE5 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 97C146ED1CF9000F007C117D /* Runner */;
targetProxy = 331C8085294A63A400263BE5 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
97C146FA1CF9000F007C117D /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
97C146FB1CF9000F007C117D /* Base */,
);
name = Main.storyboard;
sourceTree = "";
};
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
97C147001CF9000F007C117D /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
249021D3217E4FDB00AE95B9 /* Profile */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Profile;
};
249021D4217E4FDB00AE95B9 /* Profile */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = "";
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = dev.flutter.plugins.nfcmanagerexample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
};
name = Profile;
};
331C8088294A63A400263BE5 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = dev.flutter.plugins.nfcmanagerexample.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
};
name = Debug;
};
331C8089294A63A400263BE5 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = dev.flutter.plugins.nfcmanagerexample.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
};
name = Release;
};
331C808A294A63A400263BE5 /* Profile */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = dev.flutter.plugins.nfcmanagerexample.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
};
name = Profile;
};
97C147031CF9000F007C117D /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
97C147041CF9000F007C117D /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
97C147061CF9000F007C117D /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = "";
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = dev.flutter.plugins.nfcmanagerexample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
};
name = Debug;
};
97C147071CF9000F007C117D /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = "";
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = dev.flutter.plugins.nfcmanagerexample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
331C8088294A63A400263BE5 /* Debug */,
331C8089294A63A400263BE5 /* Release */,
331C808A294A63A400263BE5 /* Profile */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
isa = XCConfigurationList;
buildConfigurations = (
97C147031CF9000F007C117D /* Debug */,
97C147041CF9000F007C117D /* Release */,
249021D3217E4FDB00AE95B9 /* Profile */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
isa = XCConfigurationList;
buildConfigurations = (
97C147061CF9000F007C117D /* Debug */,
97C147071CF9000F007C117D /* Release */,
249021D4217E4FDB00AE95B9 /* Profile */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
/* Begin XCLocalSwiftPackageReference section */
781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */ = {
isa = XCLocalSwiftPackageReference;
relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage;
};
/* End XCLocalSwiftPackageReference section */
/* Begin XCSwiftPackageProductDependency section */
78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = {
isa = XCSwiftPackageProductDependency;
productName = FlutterGeneratedPluginSwiftPackage;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = 97C146E61CF9000F007C117D /* Project object */;
}
================================================
FILE: example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
================================================
================================================
FILE: example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
================================================
IDEDidComputeMac32BitWarning
================================================
FILE: example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
================================================
PreviewsEnabled
================================================
FILE: example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
================================================
================================================
FILE: example/ios/Runner.xcworkspace/contents.xcworkspacedata
================================================
================================================
FILE: example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
================================================
IDEDidComputeMac32BitWarning
================================================
FILE: example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
================================================
PreviewsEnabled
================================================
FILE: example/ios/RunnerTests/RunnerTests.swift
================================================
import XCTest
@testable import nfc_manager
class RunnerTests: XCTestCase {}
================================================
FILE: example/lib/main.dart
================================================
import 'package:flutter/material.dart';
void main() {
WidgetsFlutterBinding.ensureInitialized();
runApp(MaterialApp(home: Material(child: Center(child: Text('Hello World')))));
}
================================================
FILE: example/pubspec.yaml
================================================
name: nfc_manager_example
description: Demonstrates how to use the nfc_manager plugin.
publish_to: none
environment:
sdk: ^3.11.4
dependencies:
flutter:
sdk: flutter
nfc_manager:
path: ../
dev_dependencies:
flutter_lints: ^6.0.0
flutter:
uses-material-design: true
================================================
FILE: ios/.gitignore
================================================
.idea/
.vagrant/
.sconsign.dblite
.svn/
.DS_Store
*.swp
profile
DerivedData/
build/
GeneratedPluginRegistrant.h
GeneratedPluginRegistrant.m
.generated/
*.pbxuser
*.mode1v3
*.mode2v3
*.perspectivev3
!default.pbxuser
!default.mode1v3
!default.mode2v3
!default.perspectivev3
xcuserdata
*.moved-aside
*.pyc
*sync/
Icon?
.tags*
/Flutter/Generated.xcconfig
/Flutter/ephemeral/
/Flutter/flutter_export_environment.sh
================================================
FILE: ios/nfc_manager/Package.swift
================================================
// swift-tools-version: 5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "nfc_manager",
platforms: [
.iOS("13.0")
],
products: [
.library(name: "nfc-manager", targets: ["nfc_manager"])
],
dependencies: [],
targets: [
.target(
name: "nfc_manager",
dependencies: [],
resources: []
)
]
)
================================================
FILE: ios/nfc_manager/Sources/nfc_manager/NfcManagerPlugin.swift
================================================
import CoreNFC
import Flutter
public class NfcManagerPlugin: NSObject, FlutterPlugin, HostApiPigeon {
private let flutterApi: FlutterApiPigeon
private var shouldInvalidateSessionAfterFirstRead: Bool = true
private var tagSession: NFCTagReaderSession? = nil
private var vasSession: NFCVASReaderSession? = nil
private var cachedTags: [String : NFCNDEFTag] = [:]
public static func register(with registrar: FlutterPluginRegistrar) {
HostApiPigeonSetup.setUp(binaryMessenger: registrar.messenger(), api: NfcManagerPlugin(binaryMessenger: registrar.messenger()))
}
private init(binaryMessenger: FlutterBinaryMessenger) {
flutterApi = FlutterApiPigeon(binaryMessenger: binaryMessenger)
}
func tagSessionReadingAvailable() throws -> Bool {
return NFCTagReaderSession.readingAvailable
}
func tagSessionBegin(pollingOptions: [PollingOptionPigeon], alertMessage: String?, invalidateAfterFirstRead: Bool) throws {
if tagSession != nil || vasSession != nil {
throw FlutterError(code: "session_already_exists", message: "Multiple sessions cannot be active at the same time.", details: nil)
}
tagSession = NFCTagReaderSession(pollingOption: convert(pollingOptions), delegate: self)
if let alertMessage = alertMessage {
tagSession?.alertMessage = alertMessage
}
shouldInvalidateSessionAfterFirstRead = invalidateAfterFirstRead
tagSession?.begin()
}
func tagSessionInvalidate(alertMessage: String?, errorMessage: String?) throws {
guard let tagSession = tagSession else {
throw FlutterError(code: "no_active_sessions", message: "Session is not active.", details: nil)
}
if let alertMessage = alertMessage {
tagSession.alertMessage = alertMessage
}
if let errorMessage = errorMessage {
tagSession.invalidate(errorMessage: errorMessage)
} else {
tagSession.invalidate()
}
self.tagSession = nil
cachedTags.removeAll() // Consider when to remove the tag.
}
func tagSessionRestartPolling() throws {
guard let tagSession = tagSession else {
throw FlutterError(code: "no_active_sessions", message: "Session is not active.", details: nil)
}
tagSession.restartPolling()
}
func tagSessionSetAlertMessage(alertMessage: String) throws {
guard let tagSession = tagSession else {
throw FlutterError(code: "no_active_sessions", message: "Session is not active.", details: nil)
}
tagSession.alertMessage = alertMessage
}
func vasSessionReadingAvailable() throws -> Bool {
return NFCVASReaderSession.readingAvailable
}
func vasSessionBegin(configurations: [NfcVasCommandConfigurationPigeon], alertMessage: String?) throws {
if vasSession != nil || tagSession != nil {
throw FlutterError(code: "session_already_exists", message: "Multiple sessions cannot be active at the same time.", details: nil)
}
vasSession = NFCVASReaderSession(vasCommandConfigurations: configurations.map { convert($0) }, delegate: self, queue: nil)
if let alertMessage = alertMessage {
vasSession?.alertMessage = alertMessage
}
vasSession?.begin()
}
func vasSessionInvalidate(alertMessage: String?, errorMessage: String?) throws {
guard let vasSession = vasSession else {
throw FlutterError(code: "no_active_sessions", message: "Session is not active.", details: nil)
}
if let alertMessage = alertMessage {
vasSession.alertMessage = alertMessage
}
if let errorMessage = errorMessage {
vasSession.invalidate(errorMessage: errorMessage)
} else {
vasSession.invalidate()
}
self.vasSession = nil
}
func vasSessionSetAlertMessage(alertMessage: String) throws {
guard let vasSession = vasSession else {
throw FlutterError(code: "no_active_sessions", message: "Session is not active.", details: nil)
}
vasSession.alertMessage = alertMessage
}
func ndefQueryNdefStatus(handle: String, completion: @escaping (Result) -> Void) {
guard let tag = cachedTags[handle] else {
completion(.failure(FlutterError(code: "tag_not_found", message: "You may have disable the session.", details: nil)))
return
}
tag.queryNDEFStatus { status, capacity, error in
if let error = error {
completion(.failure(error))
return
}
completion(.success(NdefQueryStatusPigeon(status: convert(status), capacity: Int64(capacity))))
}
}
func ndefReadNdef(handle: String, completion: @escaping (Result) -> Void) {
guard let tag = cachedTags[handle] else {
completion(.failure(FlutterError(code: "tag_not_found", message: "You may have disable the session.", details: nil)))
return
}
tag.readNDEF { message, error in
if let error = error {
completion(.failure(error))
return
}
guard let message = message else {
completion(.success(nil))
return
}
completion(.success(convert(message)))
}
}
func ndefWriteNdef(handle: String, message: NdefMessagePigeon, completion: @escaping (Result) -> Void) {
guard let tag = cachedTags[handle] else {
completion(.failure(FlutterError(code: "tag_not_found", message: "You may have disable the session.", details: nil)))
return
}
tag.writeNDEF(convert(message)) { error in
if let error = error {
completion(.failure(error))
return
}
completion(.success(()))
}
}
func ndefWriteLock(handle: String, completion: @escaping (Result) -> Void) {
guard let tag = cachedTags[handle] else {
completion(.failure(FlutterError(code: "tag_not_found", message: "You may have disable the session.", details: nil)))
return
}
tag.writeLock { error in
if let error = error {
completion(.failure(error))
return
}
completion(.success(()))
}
}
func feliCaPolling(handle: String, systemCode: FlutterStandardTypedData, requestCode: FeliCaPollingRequestCodePigeon, timeSlot: FeliCaPollingTimeSlotPigeon, completion: @escaping (Result) -> Void) {
guard let tag = cachedTags[handle] as? NFCFeliCaTag else {
completion(.failure(FlutterError(code: "tag_not_found", message: "You may have disable the session.", details: nil)))
return
}
tag.polling(systemCode: systemCode.data, requestCode: convert(requestCode), timeSlot: convert(timeSlot)) { manufacturerParameter, requestData, error in
if let error = error {
completion(.failure(error))
return
}
completion(.success(FeliCaPollingResponsePigeon(
manufacturerParameter: FlutterStandardTypedData(bytes: manufacturerParameter),
requestData: FlutterStandardTypedData(bytes: requestData)
)))
}
}
func feliCaRequestService(handle: String, nodeCodeList: [FlutterStandardTypedData], completion: @escaping (Result<[FlutterStandardTypedData], Error>) -> Void) {
guard let tag = cachedTags[handle] as? NFCFeliCaTag else {
completion(.failure(FlutterError(code: "tag_not_found", message: "You may have disable the session.", details: nil)))
return
}
tag.requestService(nodeCodeList: nodeCodeList.map { $0.data }) { nodeCodeList, error in
if let error = error {
completion(.failure(error))
return
}
completion(.success(nodeCodeList.map { FlutterStandardTypedData(bytes: $0) }))
}
}
func feliCaRequestResponse(handle: String, completion: @escaping (Result) -> Void) {
guard let tag = cachedTags[handle] as? NFCFeliCaTag else {
completion(.failure(FlutterError(code: "tag_not_found", message: "You may have disable the session.", details: nil)))
return
}
tag.requestResponse { mode, error in
if let error = error {
completion(.failure(error))
return
}
completion(.success(Int64(mode)))
}
}
func feliCaReadWithoutEncryption(handle: String, serviceCodeList: [FlutterStandardTypedData], blockList: [FlutterStandardTypedData], completion: @escaping (Result) -> Void) {
guard let tag = cachedTags[handle] as? NFCFeliCaTag else {
completion(.failure(FlutterError(code: "tag_not_found", message: "You may have disable the session.", details: nil)))
return
}
tag.readWithoutEncryption(serviceCodeList: serviceCodeList.map { $0.data }, blockList: blockList.map { $0.data }) { statusFlag1, statusFlag2, blockData, error in
if let error = error {
completion(.failure(error))
return
}
completion(.success(FeliCaReadWithoutEncryptionResponsePigeon(
statusFlag1: Int64(statusFlag1),
statusFlag2: Int64(statusFlag2),
blockData: blockData.map { FlutterStandardTypedData(bytes: $0) }
)))
}
}
func feliCaWriteWithoutEncryption(handle: String, serviceCodeList: [FlutterStandardTypedData], blockList: [FlutterStandardTypedData], blockData: [FlutterStandardTypedData], completion: @escaping (Result) -> Void) {
guard let tag = cachedTags[handle] as? NFCFeliCaTag else {
completion(.failure(FlutterError(code: "tag_not_found", message: "You may have disable the session.", details: nil)))
return
}
tag.writeWithoutEncryption(serviceCodeList: serviceCodeList.map { $0.data }, blockList: blockList.map { $0.data }, blockData: blockData.map { $0.data }) { statusFlag1, statusFlag2, error in
if let error = error {
completion(.failure(error))
return
}
completion(.success(FeliCaStatusFlagPigeon(
statusFlag1: Int64(statusFlag1),
statusFlag2: Int64(statusFlag2)
)))
}
}
func feliCaRequestSystemCode(handle: String, completion: @escaping (Result<[FlutterStandardTypedData], Error>) -> Void) {
guard let tag = cachedTags[handle] as? NFCFeliCaTag else {
completion(.failure(FlutterError(code: "tag_not_found", message: "You may have disable the session.", details: nil)))
return
}
tag.requestSystemCode() { systemCodeList, error in
if let error = error {
completion(.failure(error))
return
}
completion(.success(systemCodeList.map { FlutterStandardTypedData(bytes: $0) }))
}
}
func feliCaRequestServiceV2(handle: String, nodeCodeList: [FlutterStandardTypedData], completion: @escaping (Result) -> Void) {
guard let tag = cachedTags[handle] as? NFCFeliCaTag else {
completion(.failure(FlutterError(code: "tag_not_found", message: "You may have disable the session.", details: nil)))
return
}
tag.requestServiceV2(nodeCodeList: nodeCodeList.map { $0.data }) { statusFlag1, statusFlag2, encryptionIdentifier, nodeKeyVersionListAes, nodeKeyVersionListDes, error in
if let error = error {
completion(.failure(error))
return
}
completion(.success(FeliCaRequestServiceV2ResponsePigeon(
statusFlag1: Int64(statusFlag1),
statusFlag2: Int64(statusFlag2),
encryptionIdentifier: Int64(encryptionIdentifier.rawValue),
nodeKeyVersionListAES: nodeKeyVersionListAes.map { FlutterStandardTypedData(bytes: $0) },
nodeKeyVersionListDES: nodeKeyVersionListDes.map { FlutterStandardTypedData(bytes: $0) }
)))
}
}
func feliCaRequestSpecificationVersion(handle: String, completion: @escaping (Result) -> Void) {
guard let tag = cachedTags[handle] as? NFCFeliCaTag else {
completion(.failure(FlutterError(code: "tag_not_found", message: "You may have disable the session.", details: nil)))
return
}
tag.requestSpecificationVersion() { statusFlag1, statusFlag2, basicVersion, optionVersion, error in
if let error = error {
completion(.failure(error))
return
}
completion(.success(FeliCaRequestSpecificationVersionResponsePigeon(
statusFlag1: Int64(statusFlag1),
statusFlag2: Int64(statusFlag2),
basicVersion: FlutterStandardTypedData(bytes: basicVersion),
optionVersion: FlutterStandardTypedData(bytes: optionVersion)
)))
}
}
func feliCaResetMode(handle: String, completion: @escaping (Result) -> Void) {
guard let tag = cachedTags[handle] as? NFCFeliCaTag else {
completion(.failure(FlutterError(code: "tag_not_found", message: "You may have disable the session.", details: nil)))
return
}
tag.resetMode() { statusFlag1, statusFlag2, error in
if let error = error {
completion(.failure(error))
return
}
completion(.success(FeliCaStatusFlagPigeon(
statusFlag1: Int64(statusFlag1),
statusFlag2: Int64(statusFlag2)
)))
}
}
func feliCaSendFeliCaCommand(handle: String, commandPacket: FlutterStandardTypedData, completion: @escaping (Result) -> Void) {
guard let tag = cachedTags[handle] as? NFCFeliCaTag else {
completion(.failure(FlutterError(code: "tag_not_found", message: "You may have disable the session.", details: nil)))
return
}
tag.sendFeliCaCommand(commandPacket: commandPacket.data) { data, error in
if let error = error {
completion(.failure(error))
return
}
completion(.success(FlutterStandardTypedData(bytes: data)))
}
}
func miFareSendMiFareCommand(handle: String, commandPacket: FlutterStandardTypedData, completion: @escaping (Result) -> Void) {
guard let tag = cachedTags[handle] as? NFCMiFareTag else {
completion(.failure(FlutterError(code: "tag_not_found", message: "You may have disable the session.", details: nil)))
return
}
tag.sendMiFareCommand(commandPacket: commandPacket.data) { data, error in
if let error = error {
completion(.failure(error))
return
}
completion(.success(FlutterStandardTypedData(bytes: data)))
}
}
func miFareSendMiFareISO7816Command(handle: String, apdu: Iso7816ApduPigeon, completion: @escaping (Result) -> Void) {
guard let tag = cachedTags[handle] as? NFCMiFareTag else {
completion(.failure(FlutterError(code: "tag_not_found", message: "You may have disable the session.", details: nil)))
return
}
tag.sendMiFareISO7816Command(convert(apdu)) { payload, statusWord1, statusWord2, error in
if let error = error {
completion(.failure(error))
return
}
completion(.success(Iso7816ResponseApduPigeon(
payload: FlutterStandardTypedData(bytes: payload),
statusWord1: Int64(statusWord1),
statusWord2: Int64(statusWord2)
)))
}
}
func miFareSendMiFareISO7816CommandRaw(handle: String, data: FlutterStandardTypedData, completion: @escaping (Result) -> Void) {
guard let tag = cachedTags[handle] as? NFCMiFareTag else {
completion(.failure(FlutterError(code: "tag_not_found", message: "You may have disable the session.", details: nil)))
return
}
tag.sendMiFareISO7816Command(NFCISO7816APDU(data: data.data)!) { payload, statusWord1, statusWord2, error in
if let error = error {
completion(.failure(error))
return
}
completion(.success(Iso7816ResponseApduPigeon(
payload: FlutterStandardTypedData(bytes: payload),
statusWord1: Int64(statusWord1),
statusWord2: Int64(statusWord2)
)))
}
}
func iso7816SendCommand(handle: String, apdu: Iso7816ApduPigeon, completion: @escaping (Result) -> Void) {
guard let tag = cachedTags[handle] as? NFCISO7816Tag else {
completion(.failure(FlutterError(code: "tag_not_found", message: "You may have disable the session.", details: nil)))
return
}
tag.sendCommand(apdu: convert(apdu)) { payload, statusWord1, statusWord2, error in
if let error = error {
completion(.failure(error))
return
}
completion(.success(Iso7816ResponseApduPigeon(
payload: FlutterStandardTypedData(bytes: payload),
statusWord1: Int64(statusWord1),
statusWord2: Int64(statusWord2)
)))
}
}
func iso7816SendCommandRaw(handle: String, data: FlutterStandardTypedData, completion: @escaping (Result) -> Void) {
guard let tag = cachedTags[handle] as? NFCISO7816Tag else {
completion(.failure(FlutterError(code: "tag_not_found", message: "You may have disable the session.", details: nil)))
return
}
tag.sendCommand(apdu: NFCISO7816APDU(data: data.data)!) { payload, statusWord1, statusWord2, error in
if let error = error {
completion(.failure(error))
return
}
completion(.success(Iso7816ResponseApduPigeon(
payload: FlutterStandardTypedData(bytes: payload),
statusWord1: Int64(statusWord1),
statusWord2: Int64(statusWord2)
)))
}
}
func iso15693StayQuiet(handle: String, completion: @escaping (Result) -> Void) {
guard let tag = cachedTags[handle] as? NFCISO15693Tag else {
completion(.failure(FlutterError(code: "tag_not_found", message: "You may have disable the session.", details: nil)))
return
}
tag.stayQuiet() { error in
if let error = error {
completion(.failure(error))
return
}
completion(.success(()))
}
}
func iso15693ReadSingleBlock(handle: String, requestFlags: [Iso15693RequestFlagPigeon], blockNumber: Int64, completion: @escaping (Result) -> Void) {
guard let tag = cachedTags[handle] as? NFCISO15693Tag else {
completion(.failure(FlutterError(code: "tag_not_found", message: "You may have disable the session.", details: nil)))
return
}
tag.readSingleBlock(requestFlags: convert(requestFlags), blockNumber: UInt8(blockNumber)) { dataBlock, error in
if let error = error {
completion(.failure(error))
return
}
completion(.success(FlutterStandardTypedData(bytes: dataBlock)))
}
}
func iso15693WriteSingleBlock(handle: String, requestFlags: [Iso15693RequestFlagPigeon], blockNumber: Int64, dataBlock: FlutterStandardTypedData, completion: @escaping (Result) -> Void) {
guard let tag = cachedTags[handle] as? NFCISO15693Tag else {
completion(.failure(FlutterError(code: "tag_not_found", message: "You may have disable the session.", details: nil)))
return
}
tag.writeSingleBlock(requestFlags: convert(requestFlags), blockNumber: UInt8(blockNumber), dataBlock: dataBlock.data) { error in
if let error = error {
completion(.failure(error))
return
}
completion(.success(()))
}
}
func iso15693LockBlock(handle: String, requestFlags: [Iso15693RequestFlagPigeon], blockNumber: Int64, completion: @escaping (Result) -> Void) {
guard let tag = cachedTags[handle] as? NFCISO15693Tag else {
completion(.failure(FlutterError(code: "tag_not_found", message: "You may have disable the session.", details: nil)))
return
}
tag.lockBlock(requestFlags: convert(requestFlags), blockNumber: UInt8(blockNumber)) { error in
if let error = error {
completion(.failure(error))
return
}
completion(.success(()))
}
}
func iso15693ReadMultipleBlocks(handle: String, requestFlags: [Iso15693RequestFlagPigeon], blockNumber: Int64, numberOfBlocks: Int64, completion: @escaping (Result<[FlutterStandardTypedData], Error>) -> Void) {
guard let tag = cachedTags[handle] as? NFCISO15693Tag else {
completion(.failure(FlutterError(code: "tag_not_found", message: "You may have disable the session.", details: nil)))
return
}
tag.readMultipleBlocks(requestFlags: convert(requestFlags), blockRange: convert(blockNumber, numberOfBlocks)) { dataBlocks, error in
if let error = error {
completion(.failure(error))
return
}
completion(.success(dataBlocks.map { FlutterStandardTypedData(bytes: $0) }))
}
}
func iso15693WriteMultipleBlocks(handle: String, requestFlags: [Iso15693RequestFlagPigeon], blockNumber: Int64, numberOfBlocks: Int64, dataBlocks: [FlutterStandardTypedData], completion: @escaping (Result) -> Void) {
guard let tag = cachedTags[handle] as? NFCISO15693Tag else {
completion(.failure(FlutterError(code: "tag_not_found", message: "You may have disable the session.", details: nil)))
return
}
tag.writeMultipleBlocks(requestFlags: convert(requestFlags), blockRange: convert(blockNumber, numberOfBlocks), dataBlocks: dataBlocks.map { $0.data }) { error in
if let error = error {
completion(.failure(error))
return
}
completion(.success(()))
}
}
func iso15693Select(handle: String, requestFlags: [Iso15693RequestFlagPigeon], completion: @escaping (Result) -> Void) {
guard let tag = cachedTags[handle] as? NFCISO15693Tag else {
completion(.failure(FlutterError(code: "tag_not_found", message: "You may have disable the session.", details: nil)))
return
}
tag.select(requestFlags: convert(requestFlags)) { error in
if let error = error {
completion(.failure(error))
return
}
completion(.success(()))
}
}
func iso15693ResetToReady(handle: String, requestFlags: [Iso15693RequestFlagPigeon], completion: @escaping (Result) -> Void) {
guard let tag = cachedTags[handle] as? NFCISO15693Tag else {
completion(.failure(FlutterError(code: "tag_not_found", message: "You may have disable the session.", details: nil)))
return
}
tag.resetToReady(requestFlags: convert(requestFlags)) { error in
if let error = error {
completion(.failure(error))
return
}
completion(.success(()))
}
}
func iso15693WriteAfi(handle: String, requestFlags: [Iso15693RequestFlagPigeon], afi: Int64, completion: @escaping (Result) -> Void) {
guard let tag = cachedTags[handle] as? NFCISO15693Tag else {
completion(.failure(FlutterError(code: "tag_not_found", message: "You may have disable the session.", details: nil)))
return
}
tag.writeAFI(requestFlags: convert(requestFlags), afi: UInt8(afi)) { error in
if let error = error {
completion(.failure(error))
return
}
completion(.success(()))
}
}
func iso15693LockAfi(handle: String, requestFlags: [Iso15693RequestFlagPigeon], completion: @escaping (Result) -> Void) {
guard let tag = cachedTags[handle] as? NFCISO15693Tag else {
completion(.failure(FlutterError(code: "tag_not_found", message: "You may have disable the session.", details: nil)))
return
}
tag.lockAFI(requestFlags: convert(requestFlags)) { error in
if let error = error {
completion(.failure(error))
return
}
completion(.success(()))
}
}
func iso15693WriteDsfId(handle: String, requestFlags: [Iso15693RequestFlagPigeon], dsfId: Int64, completion: @escaping (Result) -> Void) {
guard let tag = cachedTags[handle] as? NFCISO15693Tag else {
completion(.failure(FlutterError(code: "tag_not_found", message: "You may have disable the session.", details: nil)))
return
}
tag.writeDSFID(requestFlags: convert(requestFlags), dsfid: UInt8(dsfId)) { error in
if let error = error {
completion(.failure(error))
return
}
completion(.success(()))
}
}
func iso15693LockDsfId(handle: String, requestFlags: [Iso15693RequestFlagPigeon], completion: @escaping (Result) -> Void) {
guard let tag = cachedTags[handle] as? NFCISO15693Tag else {
completion(.failure(FlutterError(code: "tag_not_found", message: "You may have disable the session.", details: nil)))
return
}
tag.lockDFSID(requestFlags: convert(requestFlags)) { error in
if let error = error {
completion(.failure(error))
return
}
completion(.success(()))
}
}
func iso15693GetSystemInfo(handle: String, requestFlags: [Iso15693RequestFlagPigeon], completion: @escaping (Result) -> Void) {
guard let tag = cachedTags[handle] as? NFCISO15693Tag else {
completion(.failure(FlutterError(code: "tag_not_found", message: "You may have disable the session.", details: nil)))
return
}
tag.getSystemInfo(requestFlags: convert(requestFlags)) { dataStorageFormatIdentifier, applicationFamilyIdentifier, blockSize, totalBlocks, icReference, error in
if let error = error {
completion(.failure(error))
return
}
completion(.success(Iso15693SystemInfoPigeon(
dataStorageFormatIdentifier: Int64(dataStorageFormatIdentifier),
applicationFamilyIdentifier: Int64(applicationFamilyIdentifier),
blockSize: Int64(blockSize),
totalBlocks: Int64(totalBlocks),
icReference: Int64(icReference)
)))
}
}
func iso15693GetMultipleBlockSecurityStatus(handle: String, requestFlags: [Iso15693RequestFlagPigeon], blockNumber: Int64, numberOfBlocks: Int64, completion: @escaping (Result<[Int64], Error>) -> Void) {
guard let tag = cachedTags[handle] as? NFCISO15693Tag else {
completion(.failure(FlutterError(code: "tag_not_found", message: "You may have disable the session.", details: nil)))
return
}
tag.getMultipleBlockSecurityStatus(requestFlags: convert(requestFlags), blockRange: convert(blockNumber, numberOfBlocks)) { status, error in
if let error = error {
completion(.failure(error))
return
}
completion(.success(status.map { Int64(truncating: $0) }))
}
}
func iso15693CustomCommand(handle: String, requestFlags: [Iso15693RequestFlagPigeon], customCommandCode: Int64, customRequestParameters: FlutterStandardTypedData, completion: @escaping (Result) -> Void) {
guard let tag = cachedTags[handle] as? NFCISO15693Tag else {
completion(.failure(FlutterError(code: "tag_not_found", message: "You may have disable the session.", details: nil)))
return
}
tag.customCommand(requestFlags: convert(requestFlags), customCommandCode: Int(customCommandCode), customRequestParameters: customRequestParameters.data) { data, error in
if let error = error {
completion(.failure(error))
return
}
completion(.success(FlutterStandardTypedData(bytes: data)))
}
}
}
extension NfcManagerPlugin: NFCTagReaderSessionDelegate {
public func tagReaderSessionDidBecomeActive(_ session: NFCTagReaderSession) {
DispatchQueue.main.sync {
flutterApi.tagSessionDidBecomeActive { _ in /* no op */ }
}
}
public func tagReaderSession(_ session: NFCTagReaderSession, didInvalidateWithError error: Error) {
let pigeonError = NfcReaderSessionErrorPigeon(
code: convert((error as! NFCReaderError).code),
message: error.localizedDescription
)
DispatchQueue.main.sync {
flutterApi.tagSessionDidInvalidateWithError(error: pigeonError) { _ in /* no op */ }
}
}
public func tagReaderSession(_ session: NFCTagReaderSession, didDetect tags: [NFCTag]) {
session.connect(to: tags.first!) { error in
if let error = error {
// skip tag detection
print(error)
if !self.shouldInvalidateSessionAfterFirstRead {
session.restartPolling()
}
return
}
convert(tags.first!) { tag, pigeon, error in
if let error = error {
// skip tag detection
print(error)
if !self.shouldInvalidateSessionAfterFirstRead {
session.restartPolling()
}
return
}
guard let pigeon = pigeon else {
// skip tag detection
if !self.shouldInvalidateSessionAfterFirstRead {
session.restartPolling()
}
return
}
self.cachedTags[pigeon.handle] = tag
DispatchQueue.main.sync {
self.flutterApi.tagSessionDidDetect(tag: pigeon) { _ in /* no op */ }
}
if !self.shouldInvalidateSessionAfterFirstRead {
session.restartPolling()
}
}
}
}
}
extension NfcManagerPlugin: NFCVASReaderSessionDelegate {
public func readerSessionDidBecomeActive(_ session: NFCVASReaderSession) {
DispatchQueue.main.sync {
flutterApi.vasSessionDidBecomeActive { _ in /* no op */ }
}
}
public func readerSession(_ session: NFCVASReaderSession, didInvalidateWithError error: Error) {
let pigeonError = NfcReaderSessionErrorPigeon(
code: convert((error as! NFCReaderError).code),
message: error.localizedDescription
)
DispatchQueue.main.sync {
flutterApi.vasSessionDidInvalidateWithError(error: pigeonError) { _ in /* no op */ }
}
}
public func readerSession(_ session: NFCVASReaderSession, didReceive responses: [NFCVASResponse]) {
DispatchQueue.main.sync {
flutterApi.vasSessionDidReceive(responses: responses.map { convert($0) }) { _ in /* no op */ }
}
}
}
private func convert(_ value: NFCTag, _ completionHandler: @escaping (NFCNDEFTag, TagPigeon?, Error?) -> Void) {
switch (value) {
case .feliCa(let tag): convert(tag) { pigeon, error in completionHandler(tag, pigeon, error) }
case .iso15693(let tag): convert(tag) { pigeon, error in completionHandler(tag, pigeon, error) }
case .iso7816(let tag): convert(tag) { pigeon, error in completionHandler(tag, pigeon, error) }
case .miFare(let tag): convert(tag) { pigeon, error in completionHandler(tag, pigeon, error) }
@unknown default: fatalError()
}
}
private func convert(_ value: NFCNDEFTag, _ completionHandler: @escaping (TagPigeon?, Error?) -> Void) {
var pigeon = TagPigeon(handle: NSUUID().uuidString)
if let value = value as? NFCFeliCaTag {
pigeon.feliCa = FeliCaPigeon(
currentSystemCode: FlutterStandardTypedData(bytes: value.currentSystemCode),
currentIDm: FlutterStandardTypedData(bytes: value.currentIDm)
)
}
else if let value = value as? NFCISO15693Tag {
pigeon.iso15693 = Iso15693Pigeon(
icManufacturerCode: Int64(value.icManufacturerCode),
icSerialNumber: FlutterStandardTypedData(bytes: value.icSerialNumber),
identifier: FlutterStandardTypedData(bytes: value.identifier)
)
}
else if let value = value as? NFCISO7816Tag {
pigeon.iso7816 = Iso7816Pigeon(
initialSelectedAID: value.initialSelectedAID,
identifier: FlutterStandardTypedData(bytes: value.identifier),
historicalBytes: value.historicalBytes != nil ? FlutterStandardTypedData(bytes: value.historicalBytes!) : nil,
applicationData: value.applicationData != nil ? FlutterStandardTypedData(bytes: value.applicationData!) : nil,
proprietaryApplicationDataCoding: value.proprietaryApplicationDataCoding
)
}
else if let value = value as? NFCMiFareTag {
pigeon.miFare = MiFarePigeon(
mifareFamily: convert(value.mifareFamily),
identifier: FlutterStandardTypedData(bytes: value.identifier),
historicalBytes: value.historicalBytes != nil ? FlutterStandardTypedData(bytes: value.historicalBytes!) : nil
)
}
value.queryNDEFStatus { status, capacity, error in
if let error = error {
completionHandler(nil, error)
return
}
pigeon.ndef = NdefPigeon(
status: convert(status),
capacity: Int64(capacity)
)
if status == .notSupported {
completionHandler(pigeon, nil)
return
}
value.readNDEF { message, error in
if let error = error as? NSError, error.code != 403 {
completionHandler(nil, error)
return
}
if let message = message {
pigeon.ndef?.cachedNdefMessage = convert(message)
}
completionHandler(pigeon, nil)
}
}
}
private func convert(_ value: NdefMessagePigeon) -> NFCNDEFMessage {
return NFCNDEFMessage(
records: value.records.map { NFCNDEFPayload(
format: convert($0.typeNameFormat),
type: $0.type.data,
identifier: $0.identifier.data,
payload: $0.payload.data
) }
)
}
private func convert(_ value: NFCNDEFMessage) -> NdefMessagePigeon {
return NdefMessagePigeon(records: value.records.map { convert($0) })
}
private func convert(_ value: NFCNDEFPayload) -> NdefPayloadPigeon {
return NdefPayloadPigeon(
typeNameFormat: convert(value.typeNameFormat),
type: FlutterStandardTypedData(bytes: value.type),
identifier: FlutterStandardTypedData(bytes: value.identifier),
payload: FlutterStandardTypedData(bytes: value.payload)
)
}
private func convert(_ value: [PollingOptionPigeon]) -> NFCTagReaderSession.PollingOption {
var option = NFCTagReaderSession.PollingOption()
value.forEach { option.insert(convert($0)) }
return option
}
private func convert(_ value: PollingOptionPigeon) -> NFCTagReaderSession.PollingOption {
switch (value) {
case .iso14443: return .iso14443
case .iso15693: return .iso15693
case .iso18092: return .iso18092
}
}
private func convert(_ value: NFCNDEFStatus) -> NdefStatusPigeon {
switch (value) {
case .notSupported: return .notSupported
case .readWrite: return .readWrite
case .readOnly: return .readOnly
default: fatalError()
}
}
private func convert(_ value: FeliCaPollingRequestCodePigeon) -> PollingRequestCode {
switch (value) {
case .noRequest: return .noRequest
case .systemCode: return .systemCode
case .communicationPerformance: return .communicationPerformance
}
}
private func convert(_ value: FeliCaPollingTimeSlotPigeon) -> PollingTimeSlot {
switch (value) {
case .max1: return .max1
case .max2: return .max2
case .max4: return .max4
case .max8: return .max8
case .max16: return .max16
}
}
private func convert(_ value: Iso7816ApduPigeon) -> NFCISO7816APDU {
return NFCISO7816APDU(
instructionClass: UInt8(value.instructionClass),
instructionCode: UInt8(value.instructionCode),
p1Parameter: UInt8(value.p1Parameter),
p2Parameter: UInt8(value.p2Parameter),
data: value.data.data,
expectedResponseLength: Int(value.expectedResponseLength)
)
}
private func convert(_ value: [Iso15693RequestFlagPigeon]) -> RequestFlag {
var flag = RequestFlag()
value.forEach { flag.insert(convert($0)) }
return flag
}
private func convert(_ value: NfcVasCommandConfigurationPigeon) -> NFCVASCommandConfiguration {
return NFCVASCommandConfiguration(
vasMode: convert(value.mode),
passTypeIdentifier: value.passIdentifier,
url: (value.url == nil) ? nil : URL(string: value.url!)
)
}
private func convert(_ value: NFCVASResponse) -> NfcVasResponsePigeon {
return NfcVasResponsePigeon(
status: convert(value.status),
vasData: FlutterStandardTypedData(bytes: value.vasData),
mobileToken: FlutterStandardTypedData(bytes: value.mobileToken)
)
}
private func convert(_ value: Iso15693RequestFlagPigeon) -> RequestFlag {
switch (value) {
case .address: return .address
case .dualSubCarriers: return .dualSubCarriers
case .highDataRate: return .highDataRate
case .option: return .option
case .protocolExtension: return .protocolExtension
case .select: return .select
}
}
private func convert(_ value: NFCMiFareFamily) -> MiFareFamilyPigeon {
switch (value) {
case .unknown: return .unknown
case .ultralight: return .ultralight
case .plus: return .plus
case .desfire: return .desfire
@unknown default: fatalError()
}
}
private func convert(_ value: TypeNameFormatPigeon) -> NFCTypeNameFormat {
switch (value) {
case .empty: return .empty
case .wellKnown: return .nfcWellKnown
case .media: return .media
case .absoluteUri: return .absoluteURI
case .external: return .nfcExternal
case .unknown: return .unknown
case .unchanged: return .unchanged
}
}
private func convert(_ value: NFCTypeNameFormat) -> TypeNameFormatPigeon {
switch (value) {
case .empty: return .empty
case .nfcWellKnown: return .wellKnown
case .media: return .media
case .absoluteURI: return .absoluteUri
case .nfcExternal: return .external
case .unknown: return .unknown
case .unchanged: return .unchanged
@unknown default: fatalError()
}
}
private func convert(_ value: NfcVasCommandConfigurationModePigeon) -> NFCVASCommandConfiguration.Mode {
switch value {
case .normal: return .normal
case .urlOnly: return .urlOnly
}
}
private func convert(_ value: NFCReaderError.Code) -> NfcReaderErrorCodePigeon {
switch value {
case .readerSessionInvalidationErrorFirstNDEFTagRead: return .readerSessionInvalidationErrorFirstNdefTagRead
case .readerSessionInvalidationErrorSessionTerminatedUnexpectedly: return .readerSessionInvalidationErrorSessionTerminatedUnexpectedly
case .readerSessionInvalidationErrorSessionTimeout: return .readerSessionInvalidationErrorSessionTimeout
case .readerSessionInvalidationErrorSystemIsBusy: return .readerSessionInvalidationErrorSystemIsBusy
case .readerSessionInvalidationErrorUserCanceled: return .readerSessionInvalidationErrorUserCanceled
case .ndefReaderSessionErrorTagNotWritable: return .ndefReaderSessionErrorTagNotWritable
case .ndefReaderSessionErrorTagSizeTooSmall: return .ndefReaderSessionErrorTagSizeTooSmall
case .ndefReaderSessionErrorTagUpdateFailure: return .ndefReaderSessionErrorTagUpdateFailure
case .ndefReaderSessionErrorZeroLengthMessage: return .ndefReaderSessionErrorZeroLengthMessage
case .readerTransceiveErrorRetryExceeded: return .readerTransceiveErrorRetryExceeded
case .readerTransceiveErrorTagConnectionLost: return .readerTransceiveErrorTagConnectionLost
case .readerTransceiveErrorTagNotConnected: return .readerTransceiveErrorTagNotConnected
case .readerTransceiveErrorTagResponseError: return .readerTransceiveErrorTagResponseError
case .readerTransceiveErrorSessionInvalidated: return .readerTransceiveErrorSessionInvalidated
case .readerTransceiveErrorPacketTooLong: return .readerTransceiveErrorPacketTooLong
case .tagCommandConfigurationErrorInvalidParameters: return .tagCommandConfigurationErrorInvalidParameters
case .readerErrorUnsupportedFeature: return .readerErrorUnsupportedFeature
case .readerErrorInvalidParameter: return .readerErrorInvalidParameter
case .readerErrorInvalidParameterLength: return .readerErrorInvalidParameterLength
case .readerErrorParameterOutOfBound: return .readerErrorParameterOutOfBound
case .readerErrorRadioDisabled: return .readerErrorRadioDisabled
case .readerErrorSecurityViolation: return .readerErrorSecurityViolation
default:
// Introduced in iOS SDK 26; since we added it before 26 was widely adopted, compare `rawValue` to maintain backward compatibility.
// See: https://github.com/okadan/flutter-nfc-manager/issues/249
if (value.rawValue == 7) { return .readerErrorIneligible }
if (value.rawValue == 8) { return .readerErrorAccessNotAccepted }
fatalError()
}
}
private func convert(_ value: NFCVASResponse.ErrorCode) -> NfcVasResponseErrorCodePigeon {
switch (value) {
case .success: return .success
case .userIntervention: return .userIntervention
case .dataNotActivated: return .dataNotActivated
case .dataNotFound: return .dataNotFound
case .incorrectData: return .incorrectData
case .unsupportedApplicationVersion: return .unsupportedApplicationVersion
case .wrongLCField: return .wrongLCField
case .wrongParameters: return .wrongParameters
@unknown default: fatalError()
}
}
private func convert(_ value1: Int64, _ value2: Int64) -> NSRange {
return NSRange(location: Int(value1), length: Int(value2))
}
extension FlutterError: Error {}
================================================
FILE: ios/nfc_manager/Sources/nfc_manager/Pigeon.swift
================================================
// Autogenerated from Pigeon (v26.3.3), do not edit directly.
// See also: https://pub.dev/packages/pigeon
import Foundation
#if os(iOS)
import Flutter
#elseif os(macOS)
import FlutterMacOS
#else
#error("Unsupported platform.")
#endif
/// Error class for passing custom error details to Dart side.
final class PigeonError: Error {
let code: String
let message: String?
let details: Sendable?
init(code: String, message: String?, details: Sendable?) {
self.code = code
self.message = message
self.details = details
}
var localizedDescription: String {
return
"PigeonError(code: \(code), message: \(message ?? ""), details: \(details ?? "")"
}
}
private func wrapResult(_ result: Any?) -> [Any?] {
return [result]
}
private func wrapError(_ error: Any) -> [Any?] {
if let pigeonError = error as? PigeonError {
return [
pigeonError.code,
pigeonError.message,
pigeonError.details,
]
}
if let flutterError = error as? FlutterError {
return [
flutterError.code,
flutterError.message,
flutterError.details,
]
}
return [
"\(error)",
"\(Swift.type(of: error))",
"Stacktrace: \(Thread.callStackSymbols)",
]
}
private func createConnectionError(withChannelName channelName: String) -> PigeonError {
return PigeonError(code: "channel-error", message: "Unable to establish connection on channel: '\(channelName)'.", details: "")
}
private func isNullish(_ value: Any?) -> Bool {
return value is NSNull || value == nil
}
private func nilOrValue(_ value: Any?) -> T? {
if value is NSNull { return nil }
return value as! T?
}
private func doubleEqualsPigeon(_ lhs: Double, _ rhs: Double) -> Bool {
return (lhs.isNaN && rhs.isNaN) || lhs == rhs
}
private func doubleHashPigeon(_ value: Double, _ hasher: inout Hasher) {
if value.isNaN {
hasher.combine(0x7FF8000000000000)
} else {
// Normalize -0.0 to 0.0
hasher.combine(value == 0 ? 0 : value)
}
}
func deepEqualsPigeon(_ lhs: Any?, _ rhs: Any?) -> Bool {
let cleanLhs = nilOrValue(lhs) as Any?
let cleanRhs = nilOrValue(rhs) as Any?
switch (cleanLhs, cleanRhs) {
case (nil, nil):
return true
case (nil, _), (_, nil):
return false
case (let lhs as AnyObject, let rhs as AnyObject) where lhs === rhs:
return true
case is (Void, Void):
return true
case (let lhsArray, let rhsArray) as ([Any?], [Any?]):
guard lhsArray.count == rhsArray.count else { return false }
for (index, element) in lhsArray.enumerated() {
if !deepEqualsPigeon(element, rhsArray[index]) {
return false
}
}
return true
case (let lhsArray, let rhsArray) as ([Double], [Double]):
guard lhsArray.count == rhsArray.count else { return false }
for (index, element) in lhsArray.enumerated() {
if !doubleEqualsPigeon(element, rhsArray[index]) {
return false
}
}
return true
case (let lhsDictionary, let rhsDictionary) as ([AnyHashable: Any?], [AnyHashable: Any?]):
guard lhsDictionary.count == rhsDictionary.count else { return false }
for (lhsKey, lhsValue) in lhsDictionary {
var found = false
for (rhsKey, rhsValue) in rhsDictionary {
if deepEqualsPigeon(lhsKey, rhsKey) {
if deepEqualsPigeon(lhsValue, rhsValue) {
found = true
break
} else {
return false
}
}
}
if !found { return false }
}
return true
case (let lhs as Double, let rhs as Double):
return doubleEqualsPigeon(lhs, rhs)
case (let lhsHashable, let rhsHashable) as (AnyHashable, AnyHashable):
return lhsHashable == rhsHashable
default:
return false
}
}
func deepHashPigeon(value: Any?, hasher: inout Hasher) {
let cleanValue = nilOrValue(value) as Any?
if let cleanValue = cleanValue {
if let doubleValue = cleanValue as? Double {
doubleHashPigeon(doubleValue, &hasher)
} else if let valueList = cleanValue as? [Any?] {
for item in valueList {
deepHashPigeon(value: item, hasher: &hasher)
}
} else if let valueList = cleanValue as? [Double] {
for item in valueList {
doubleHashPigeon(item, &hasher)
}
} else if let valueDict = cleanValue as? [AnyHashable: Any?] {
var result = 0
for (key, value) in valueDict {
var entryKeyHasher = Hasher()
deepHashPigeon(value: key, hasher: &entryKeyHasher)
var entryValueHasher = Hasher()
deepHashPigeon(value: value, hasher: &entryValueHasher)
result = result &+ ((entryKeyHasher.finalize() &* 31) ^ entryValueHasher.finalize())
}
hasher.combine(result)
} else if let hashableValue = cleanValue as? AnyHashable {
hasher.combine(hashableValue)
} else {
hasher.combine(String(describing: cleanValue))
}
} else {
hasher.combine(0)
}
}
enum PollingOptionPigeon: Int {
case iso14443 = 0
case iso15693 = 1
case iso18092 = 2
}
enum NdefStatusPigeon: Int {
case notSupported = 0
case readWrite = 1
case readOnly = 2
}
enum TypeNameFormatPigeon: Int {
case empty = 0
case wellKnown = 1
case media = 2
case absoluteUri = 3
case external = 4
case unknown = 5
case unchanged = 6
}
enum FeliCaPollingRequestCodePigeon: Int {
case noRequest = 0
case systemCode = 1
case communicationPerformance = 2
}
enum FeliCaPollingTimeSlotPigeon: Int {
case max1 = 0
case max2 = 1
case max4 = 2
case max8 = 3
case max16 = 4
}
enum MiFareFamilyPigeon: Int {
case unknown = 0
case ultralight = 1
case plus = 2
case desfire = 3
}
enum Iso15693RequestFlagPigeon: Int {
case address = 0
case dualSubCarriers = 1
case highDataRate = 2
case option = 3
case protocolExtension = 4
case select = 5
}
enum NfcVasCommandConfigurationModePigeon: Int {
case normal = 0
case urlOnly = 1
}
enum NfcReaderErrorCodePigeon: Int {
case readerSessionInvalidationErrorFirstNdefTagRead = 0
case readerSessionInvalidationErrorSessionTerminatedUnexpectedly = 1
case readerSessionInvalidationErrorSessionTimeout = 2
case readerSessionInvalidationErrorSystemIsBusy = 3
case readerSessionInvalidationErrorUserCanceled = 4
case ndefReaderSessionErrorTagNotWritable = 5
case ndefReaderSessionErrorTagSizeTooSmall = 6
case ndefReaderSessionErrorTagUpdateFailure = 7
case ndefReaderSessionErrorZeroLengthMessage = 8
case readerTransceiveErrorRetryExceeded = 9
case readerTransceiveErrorTagConnectionLost = 10
case readerTransceiveErrorTagNotConnected = 11
case readerTransceiveErrorTagResponseError = 12
case readerTransceiveErrorSessionInvalidated = 13
case readerTransceiveErrorPacketTooLong = 14
case tagCommandConfigurationErrorInvalidParameters = 15
case readerErrorAccessNotAccepted = 16
case readerErrorIneligible = 17
case readerErrorUnsupportedFeature = 18
case readerErrorInvalidParameter = 19
case readerErrorInvalidParameterLength = 20
case readerErrorParameterOutOfBound = 21
case readerErrorRadioDisabled = 22
case readerErrorSecurityViolation = 23
}
enum NfcVasResponseErrorCodePigeon: Int {
case success = 0
case userIntervention = 1
case dataNotActivated = 2
case dataNotFound = 3
case incorrectData = 4
case unsupportedApplicationVersion = 5
case wrongLCField = 6
case wrongParameters = 7
}
/// Generated class from Pigeon that represents data sent in messages.
struct TagPigeon: Hashable {
var handle: String
var ndef: NdefPigeon? = nil
var feliCa: FeliCaPigeon? = nil
var iso15693: Iso15693Pigeon? = nil
var iso7816: Iso7816Pigeon? = nil
var miFare: MiFarePigeon? = nil
// swift-format-ignore: AlwaysUseLowerCamelCase
static func fromList(_ pigeonVar_list: [Any?]) -> TagPigeon? {
let handle = pigeonVar_list[0] as! String
let ndef: NdefPigeon? = nilOrValue(pigeonVar_list[1])
let feliCa: FeliCaPigeon? = nilOrValue(pigeonVar_list[2])
let iso15693: Iso15693Pigeon? = nilOrValue(pigeonVar_list[3])
let iso7816: Iso7816Pigeon? = nilOrValue(pigeonVar_list[4])
let miFare: MiFarePigeon? = nilOrValue(pigeonVar_list[5])
return TagPigeon(
handle: handle,
ndef: ndef,
feliCa: feliCa,
iso15693: iso15693,
iso7816: iso7816,
miFare: miFare
)
}
func toList() -> [Any?] {
return [
handle,
ndef,
feliCa,
iso15693,
iso7816,
miFare,
]
}
static func == (lhs: TagPigeon, rhs: TagPigeon) -> Bool {
if Swift.type(of: lhs) != Swift.type(of: rhs) {
return false
}
return deepEqualsPigeon(lhs.handle, rhs.handle) && deepEqualsPigeon(lhs.ndef, rhs.ndef) && deepEqualsPigeon(lhs.feliCa, rhs.feliCa) && deepEqualsPigeon(lhs.iso15693, rhs.iso15693) && deepEqualsPigeon(lhs.iso7816, rhs.iso7816) && deepEqualsPigeon(lhs.miFare, rhs.miFare)
}
func hash(into hasher: inout Hasher) {
hasher.combine("TagPigeon")
deepHashPigeon(value: handle, hasher: &hasher)
deepHashPigeon(value: ndef, hasher: &hasher)
deepHashPigeon(value: feliCa, hasher: &hasher)
deepHashPigeon(value: iso15693, hasher: &hasher)
deepHashPigeon(value: iso7816, hasher: &hasher)
deepHashPigeon(value: miFare, hasher: &hasher)
}
}
/// Generated class from Pigeon that represents data sent in messages.
struct NdefPigeon: Hashable {
var status: NdefStatusPigeon
var capacity: Int64
var cachedNdefMessage: NdefMessagePigeon? = nil
// swift-format-ignore: AlwaysUseLowerCamelCase
static func fromList(_ pigeonVar_list: [Any?]) -> NdefPigeon? {
let status = pigeonVar_list[0] as! NdefStatusPigeon
let capacity = pigeonVar_list[1] as! Int64
let cachedNdefMessage: NdefMessagePigeon? = nilOrValue(pigeonVar_list[2])
return NdefPigeon(
status: status,
capacity: capacity,
cachedNdefMessage: cachedNdefMessage
)
}
func toList() -> [Any?] {
return [
status,
capacity,
cachedNdefMessage,
]
}
static func == (lhs: NdefPigeon, rhs: NdefPigeon) -> Bool {
if Swift.type(of: lhs) != Swift.type(of: rhs) {
return false
}
return deepEqualsPigeon(lhs.status, rhs.status) && deepEqualsPigeon(lhs.capacity, rhs.capacity) && deepEqualsPigeon(lhs.cachedNdefMessage, rhs.cachedNdefMessage)
}
func hash(into hasher: inout Hasher) {
hasher.combine("NdefPigeon")
deepHashPigeon(value: status, hasher: &hasher)
deepHashPigeon(value: capacity, hasher: &hasher)
deepHashPigeon(value: cachedNdefMessage, hasher: &hasher)
}
}
/// Generated class from Pigeon that represents data sent in messages.
struct FeliCaPigeon: Hashable {
var currentSystemCode: FlutterStandardTypedData
var currentIDm: FlutterStandardTypedData
// swift-format-ignore: AlwaysUseLowerCamelCase
static func fromList(_ pigeonVar_list: [Any?]) -> FeliCaPigeon? {
let currentSystemCode = pigeonVar_list[0] as! FlutterStandardTypedData
let currentIDm = pigeonVar_list[1] as! FlutterStandardTypedData
return FeliCaPigeon(
currentSystemCode: currentSystemCode,
currentIDm: currentIDm
)
}
func toList() -> [Any?] {
return [
currentSystemCode,
currentIDm,
]
}
static func == (lhs: FeliCaPigeon, rhs: FeliCaPigeon) -> Bool {
if Swift.type(of: lhs) != Swift.type(of: rhs) {
return false
}
return deepEqualsPigeon(lhs.currentSystemCode, rhs.currentSystemCode) && deepEqualsPigeon(lhs.currentIDm, rhs.currentIDm)
}
func hash(into hasher: inout Hasher) {
hasher.combine("FeliCaPigeon")
deepHashPigeon(value: currentSystemCode, hasher: &hasher)
deepHashPigeon(value: currentIDm, hasher: &hasher)
}
}
/// Generated class from Pigeon that represents data sent in messages.
struct Iso15693Pigeon: Hashable {
var icManufacturerCode: Int64
var icSerialNumber: FlutterStandardTypedData
var identifier: FlutterStandardTypedData
// swift-format-ignore: AlwaysUseLowerCamelCase
static func fromList(_ pigeonVar_list: [Any?]) -> Iso15693Pigeon? {
let icManufacturerCode = pigeonVar_list[0] as! Int64
let icSerialNumber = pigeonVar_list[1] as! FlutterStandardTypedData
let identifier = pigeonVar_list[2] as! FlutterStandardTypedData
return Iso15693Pigeon(
icManufacturerCode: icManufacturerCode,
icSerialNumber: icSerialNumber,
identifier: identifier
)
}
func toList() -> [Any?] {
return [
icManufacturerCode,
icSerialNumber,
identifier,
]
}
static func == (lhs: Iso15693Pigeon, rhs: Iso15693Pigeon) -> Bool {
if Swift.type(of: lhs) != Swift.type(of: rhs) {
return false
}
return deepEqualsPigeon(lhs.icManufacturerCode, rhs.icManufacturerCode) && deepEqualsPigeon(lhs.icSerialNumber, rhs.icSerialNumber) && deepEqualsPigeon(lhs.identifier, rhs.identifier)
}
func hash(into hasher: inout Hasher) {
hasher.combine("Iso15693Pigeon")
deepHashPigeon(value: icManufacturerCode, hasher: &hasher)
deepHashPigeon(value: icSerialNumber, hasher: &hasher)
deepHashPigeon(value: identifier, hasher: &hasher)
}
}
/// Generated class from Pigeon that represents data sent in messages.
struct Iso7816Pigeon: Hashable {
var initialSelectedAID: String
var identifier: FlutterStandardTypedData
var historicalBytes: FlutterStandardTypedData? = nil
var applicationData: FlutterStandardTypedData? = nil
var proprietaryApplicationDataCoding: Bool
// swift-format-ignore: AlwaysUseLowerCamelCase
static func fromList(_ pigeonVar_list: [Any?]) -> Iso7816Pigeon? {
let initialSelectedAID = pigeonVar_list[0] as! String
let identifier = pigeonVar_list[1] as! FlutterStandardTypedData
let historicalBytes: FlutterStandardTypedData? = nilOrValue(pigeonVar_list[2])
let applicationData: FlutterStandardTypedData? = nilOrValue(pigeonVar_list[3])
let proprietaryApplicationDataCoding = pigeonVar_list[4] as! Bool
return Iso7816Pigeon(
initialSelectedAID: initialSelectedAID,
identifier: identifier,
historicalBytes: historicalBytes,
applicationData: applicationData,
proprietaryApplicationDataCoding: proprietaryApplicationDataCoding
)
}
func toList() -> [Any?] {
return [
initialSelectedAID,
identifier,
historicalBytes,
applicationData,
proprietaryApplicationDataCoding,
]
}
static func == (lhs: Iso7816Pigeon, rhs: Iso7816Pigeon) -> Bool {
if Swift.type(of: lhs) != Swift.type(of: rhs) {
return false
}
return deepEqualsPigeon(lhs.initialSelectedAID, rhs.initialSelectedAID) && deepEqualsPigeon(lhs.identifier, rhs.identifier) && deepEqualsPigeon(lhs.historicalBytes, rhs.historicalBytes) && deepEqualsPigeon(lhs.applicationData, rhs.applicationData) && deepEqualsPigeon(lhs.proprietaryApplicationDataCoding, rhs.proprietaryApplicationDataCoding)
}
func hash(into hasher: inout Hasher) {
hasher.combine("Iso7816Pigeon")
deepHashPigeon(value: initialSelectedAID, hasher: &hasher)
deepHashPigeon(value: identifier, hasher: &hasher)
deepHashPigeon(value: historicalBytes, hasher: &hasher)
deepHashPigeon(value: applicationData, hasher: &hasher)
deepHashPigeon(value: proprietaryApplicationDataCoding, hasher: &hasher)
}
}
/// Generated class from Pigeon that represents data sent in messages.
struct MiFarePigeon: Hashable {
var mifareFamily: MiFareFamilyPigeon
var identifier: FlutterStandardTypedData
var historicalBytes: FlutterStandardTypedData? = nil
// swift-format-ignore: AlwaysUseLowerCamelCase
static func fromList(_ pigeonVar_list: [Any?]) -> MiFarePigeon? {
let mifareFamily = pigeonVar_list[0] as! MiFareFamilyPigeon
let identifier = pigeonVar_list[1] as! FlutterStandardTypedData
let historicalBytes: FlutterStandardTypedData? = nilOrValue(pigeonVar_list[2])
return MiFarePigeon(
mifareFamily: mifareFamily,
identifier: identifier,
historicalBytes: historicalBytes
)
}
func toList() -> [Any?] {
return [
mifareFamily,
identifier,
historicalBytes,
]
}
static func == (lhs: MiFarePigeon, rhs: MiFarePigeon) -> Bool {
if Swift.type(of: lhs) != Swift.type(of: rhs) {
return false
}
return deepEqualsPigeon(lhs.mifareFamily, rhs.mifareFamily) && deepEqualsPigeon(lhs.identifier, rhs.identifier) && deepEqualsPigeon(lhs.historicalBytes, rhs.historicalBytes)
}
func hash(into hasher: inout Hasher) {
hasher.combine("MiFarePigeon")
deepHashPigeon(value: mifareFamily, hasher: &hasher)
deepHashPigeon(value: identifier, hasher: &hasher)
deepHashPigeon(value: historicalBytes, hasher: &hasher)
}
}
/// Generated class from Pigeon that represents data sent in messages.
struct NdefQueryStatusPigeon: Hashable {
var status: NdefStatusPigeon
var capacity: Int64
// swift-format-ignore: AlwaysUseLowerCamelCase
static func fromList(_ pigeonVar_list: [Any?]) -> NdefQueryStatusPigeon? {
let status = pigeonVar_list[0] as! NdefStatusPigeon
let capacity = pigeonVar_list[1] as! Int64
return NdefQueryStatusPigeon(
status: status,
capacity: capacity
)
}
func toList() -> [Any?] {
return [
status,
capacity,
]
}
static func == (lhs: NdefQueryStatusPigeon, rhs: NdefQueryStatusPigeon) -> Bool {
if Swift.type(of: lhs) != Swift.type(of: rhs) {
return false
}
return deepEqualsPigeon(lhs.status, rhs.status) && deepEqualsPigeon(lhs.capacity, rhs.capacity)
}
func hash(into hasher: inout Hasher) {
hasher.combine("NdefQueryStatusPigeon")
deepHashPigeon(value: status, hasher: &hasher)
deepHashPigeon(value: capacity, hasher: &hasher)
}
}
/// Generated class from Pigeon that represents data sent in messages.
struct NdefMessagePigeon: Hashable {
var records: [NdefPayloadPigeon]
// swift-format-ignore: AlwaysUseLowerCamelCase
static func fromList(_ pigeonVar_list: [Any?]) -> NdefMessagePigeon? {
let records = pigeonVar_list[0] as! [NdefPayloadPigeon]
return NdefMessagePigeon(
records: records
)
}
func toList() -> [Any?] {
return [
records
]
}
static func == (lhs: NdefMessagePigeon, rhs: NdefMessagePigeon) -> Bool {
if Swift.type(of: lhs) != Swift.type(of: rhs) {
return false
}
return deepEqualsPigeon(lhs.records, rhs.records)
}
func hash(into hasher: inout Hasher) {
hasher.combine("NdefMessagePigeon")
deepHashPigeon(value: records, hasher: &hasher)
}
}
/// Generated class from Pigeon that represents data sent in messages.
struct NdefPayloadPigeon: Hashable {
var typeNameFormat: TypeNameFormatPigeon
var type: FlutterStandardTypedData
var identifier: FlutterStandardTypedData
var payload: FlutterStandardTypedData
// swift-format-ignore: AlwaysUseLowerCamelCase
static func fromList(_ pigeonVar_list: [Any?]) -> NdefPayloadPigeon? {
let typeNameFormat = pigeonVar_list[0] as! TypeNameFormatPigeon
let type = pigeonVar_list[1] as! FlutterStandardTypedData
let identifier = pigeonVar_list[2] as! FlutterStandardTypedData
let payload = pigeonVar_list[3] as! FlutterStandardTypedData
return NdefPayloadPigeon(
typeNameFormat: typeNameFormat,
type: type,
identifier: identifier,
payload: payload
)
}
func toList() -> [Any?] {
return [
typeNameFormat,
type,
identifier,
payload,
]
}
static func == (lhs: NdefPayloadPigeon, rhs: NdefPayloadPigeon) -> Bool {
if Swift.type(of: lhs) != Swift.type(of: rhs) {
return false
}
return deepEqualsPigeon(lhs.typeNameFormat, rhs.typeNameFormat) && deepEqualsPigeon(lhs.type, rhs.type) && deepEqualsPigeon(lhs.identifier, rhs.identifier) && deepEqualsPigeon(lhs.payload, rhs.payload)
}
func hash(into hasher: inout Hasher) {
hasher.combine("NdefPayloadPigeon")
deepHashPigeon(value: typeNameFormat, hasher: &hasher)
deepHashPigeon(value: type, hasher: &hasher)
deepHashPigeon(value: identifier, hasher: &hasher)
deepHashPigeon(value: payload, hasher: &hasher)
}
}
/// Generated class from Pigeon that represents data sent in messages.
struct FeliCaPollingResponsePigeon: Hashable {
var manufacturerParameter: FlutterStandardTypedData
var requestData: FlutterStandardTypedData? = nil
// swift-format-ignore: AlwaysUseLowerCamelCase
static func fromList(_ pigeonVar_list: [Any?]) -> FeliCaPollingResponsePigeon? {
let manufacturerParameter = pigeonVar_list[0] as! FlutterStandardTypedData
let requestData: FlutterStandardTypedData? = nilOrValue(pigeonVar_list[1])
return FeliCaPollingResponsePigeon(
manufacturerParameter: manufacturerParameter,
requestData: requestData
)
}
func toList() -> [Any?] {
return [
manufacturerParameter,
requestData,
]
}
static func == (lhs: FeliCaPollingResponsePigeon, rhs: FeliCaPollingResponsePigeon) -> Bool {
if Swift.type(of: lhs) != Swift.type(of: rhs) {
return false
}
return deepEqualsPigeon(lhs.manufacturerParameter, rhs.manufacturerParameter) && deepEqualsPigeon(lhs.requestData, rhs.requestData)
}
func hash(into hasher: inout Hasher) {
hasher.combine("FeliCaPollingResponsePigeon")
deepHashPigeon(value: manufacturerParameter, hasher: &hasher)
deepHashPigeon(value: requestData, hasher: &hasher)
}
}
/// Generated class from Pigeon that represents data sent in messages.
struct FeliCaReadWithoutEncryptionResponsePigeon: Hashable {
var statusFlag1: Int64
var statusFlag2: Int64
var blockData: [FlutterStandardTypedData]
// swift-format-ignore: AlwaysUseLowerCamelCase
static func fromList(_ pigeonVar_list: [Any?]) -> FeliCaReadWithoutEncryptionResponsePigeon? {
let statusFlag1 = pigeonVar_list[0] as! Int64
let statusFlag2 = pigeonVar_list[1] as! Int64
let blockData = pigeonVar_list[2] as! [FlutterStandardTypedData]
return FeliCaReadWithoutEncryptionResponsePigeon(
statusFlag1: statusFlag1,
statusFlag2: statusFlag2,
blockData: blockData
)
}
func toList() -> [Any?] {
return [
statusFlag1,
statusFlag2,
blockData,
]
}
static func == (lhs: FeliCaReadWithoutEncryptionResponsePigeon, rhs: FeliCaReadWithoutEncryptionResponsePigeon) -> Bool {
if Swift.type(of: lhs) != Swift.type(of: rhs) {
return false
}
return deepEqualsPigeon(lhs.statusFlag1, rhs.statusFlag1) && deepEqualsPigeon(lhs.statusFlag2, rhs.statusFlag2) && deepEqualsPigeon(lhs.blockData, rhs.blockData)
}
func hash(into hasher: inout Hasher) {
hasher.combine("FeliCaReadWithoutEncryptionResponsePigeon")
deepHashPigeon(value: statusFlag1, hasher: &hasher)
deepHashPigeon(value: statusFlag2, hasher: &hasher)
deepHashPigeon(value: blockData, hasher: &hasher)
}
}
/// Generated class from Pigeon that represents data sent in messages.
struct FeliCaRequestServiceV2ResponsePigeon: Hashable {
var statusFlag1: Int64
var statusFlag2: Int64
var encryptionIdentifier: Int64
var nodeKeyVersionListAES: [FlutterStandardTypedData]? = nil
var nodeKeyVersionListDES: [FlutterStandardTypedData]? = nil
// swift-format-ignore: AlwaysUseLowerCamelCase
static func fromList(_ pigeonVar_list: [Any?]) -> FeliCaRequestServiceV2ResponsePigeon? {
let statusFlag1 = pigeonVar_list[0] as! Int64
let statusFlag2 = pigeonVar_list[1] as! Int64
let encryptionIdentifier = pigeonVar_list[2] as! Int64
let nodeKeyVersionListAES: [FlutterStandardTypedData]? = nilOrValue(pigeonVar_list[3])
let nodeKeyVersionListDES: [FlutterStandardTypedData]? = nilOrValue(pigeonVar_list[4])
return FeliCaRequestServiceV2ResponsePigeon(
statusFlag1: statusFlag1,
statusFlag2: statusFlag2,
encryptionIdentifier: encryptionIdentifier,
nodeKeyVersionListAES: nodeKeyVersionListAES,
nodeKeyVersionListDES: nodeKeyVersionListDES
)
}
func toList() -> [Any?] {
return [
statusFlag1,
statusFlag2,
encryptionIdentifier,
nodeKeyVersionListAES,
nodeKeyVersionListDES,
]
}
static func == (lhs: FeliCaRequestServiceV2ResponsePigeon, rhs: FeliCaRequestServiceV2ResponsePigeon) -> Bool {
if Swift.type(of: lhs) != Swift.type(of: rhs) {
return false
}
return deepEqualsPigeon(lhs.statusFlag1, rhs.statusFlag1) && deepEqualsPigeon(lhs.statusFlag2, rhs.statusFlag2) && deepEqualsPigeon(lhs.encryptionIdentifier, rhs.encryptionIdentifier) && deepEqualsPigeon(lhs.nodeKeyVersionListAES, rhs.nodeKeyVersionListAES) && deepEqualsPigeon(lhs.nodeKeyVersionListDES, rhs.nodeKeyVersionListDES)
}
func hash(into hasher: inout Hasher) {
hasher.combine("FeliCaRequestServiceV2ResponsePigeon")
deepHashPigeon(value: statusFlag1, hasher: &hasher)
deepHashPigeon(value: statusFlag2, hasher: &hasher)
deepHashPigeon(value: encryptionIdentifier, hasher: &hasher)
deepHashPigeon(value: nodeKeyVersionListAES, hasher: &hasher)
deepHashPigeon(value: nodeKeyVersionListDES, hasher: &hasher)
}
}
/// Generated class from Pigeon that represents data sent in messages.
struct FeliCaRequestSpecificationVersionResponsePigeon: Hashable {
var statusFlag1: Int64
var statusFlag2: Int64
var basicVersion: FlutterStandardTypedData? = nil
var optionVersion: FlutterStandardTypedData? = nil
// swift-format-ignore: AlwaysUseLowerCamelCase
static func fromList(_ pigeonVar_list: [Any?]) -> FeliCaRequestSpecificationVersionResponsePigeon? {
let statusFlag1 = pigeonVar_list[0] as! Int64
let statusFlag2 = pigeonVar_list[1] as! Int64
let basicVersion: FlutterStandardTypedData? = nilOrValue(pigeonVar_list[2])
let optionVersion: FlutterStandardTypedData? = nilOrValue(pigeonVar_list[3])
return FeliCaRequestSpecificationVersionResponsePigeon(
statusFlag1: statusFlag1,
statusFlag2: statusFlag2,
basicVersion: basicVersion,
optionVersion: optionVersion
)
}
func toList() -> [Any?] {
return [
statusFlag1,
statusFlag2,
basicVersion,
optionVersion,
]
}
static func == (lhs: FeliCaRequestSpecificationVersionResponsePigeon, rhs: FeliCaRequestSpecificationVersionResponsePigeon) -> Bool {
if Swift.type(of: lhs) != Swift.type(of: rhs) {
return false
}
return deepEqualsPigeon(lhs.statusFlag1, rhs.statusFlag1) && deepEqualsPigeon(lhs.statusFlag2, rhs.statusFlag2) && deepEqualsPigeon(lhs.basicVersion, rhs.basicVersion) && deepEqualsPigeon(lhs.optionVersion, rhs.optionVersion)
}
func hash(into hasher: inout Hasher) {
hasher.combine("FeliCaRequestSpecificationVersionResponsePigeon")
deepHashPigeon(value: statusFlag1, hasher: &hasher)
deepHashPigeon(value: statusFlag2, hasher: &hasher)
deepHashPigeon(value: basicVersion, hasher: &hasher)
deepHashPigeon(value: optionVersion, hasher: &hasher)
}
}
/// Generated class from Pigeon that represents data sent in messages.
struct FeliCaStatusFlagPigeon: Hashable {
var statusFlag1: Int64
var statusFlag2: Int64
// swift-format-ignore: AlwaysUseLowerCamelCase
static func fromList(_ pigeonVar_list: [Any?]) -> FeliCaStatusFlagPigeon? {
let statusFlag1 = pigeonVar_list[0] as! Int64
let statusFlag2 = pigeonVar_list[1] as! Int64
return FeliCaStatusFlagPigeon(
statusFlag1: statusFlag1,
statusFlag2: statusFlag2
)
}
func toList() -> [Any?] {
return [
statusFlag1,
statusFlag2,
]
}
static func == (lhs: FeliCaStatusFlagPigeon, rhs: FeliCaStatusFlagPigeon) -> Bool {
if Swift.type(of: lhs) != Swift.type(of: rhs) {
return false
}
return deepEqualsPigeon(lhs.statusFlag1, rhs.statusFlag1) && deepEqualsPigeon(lhs.statusFlag2, rhs.statusFlag2)
}
func hash(into hasher: inout Hasher) {
hasher.combine("FeliCaStatusFlagPigeon")
deepHashPigeon(value: statusFlag1, hasher: &hasher)
deepHashPigeon(value: statusFlag2, hasher: &hasher)
}
}
/// Generated class from Pigeon that represents data sent in messages.
struct Iso7816ApduPigeon: Hashable {
var instructionClass: Int64
var instructionCode: Int64
var p1Parameter: Int64
var p2Parameter: Int64
var data: FlutterStandardTypedData
var expectedResponseLength: Int64
// swift-format-ignore: AlwaysUseLowerCamelCase
static func fromList(_ pigeonVar_list: [Any?]) -> Iso7816ApduPigeon? {
let instructionClass = pigeonVar_list[0] as! Int64
let instructionCode = pigeonVar_list[1] as! Int64
let p1Parameter = pigeonVar_list[2] as! Int64
let p2Parameter = pigeonVar_list[3] as! Int64
let data = pigeonVar_list[4] as! FlutterStandardTypedData
let expectedResponseLength = pigeonVar_list[5] as! Int64
return Iso7816ApduPigeon(
instructionClass: instructionClass,
instructionCode: instructionCode,
p1Parameter: p1Parameter,
p2Parameter: p2Parameter,
data: data,
expectedResponseLength: expectedResponseLength
)
}
func toList() -> [Any?] {
return [
instructionClass,
instructionCode,
p1Parameter,
p2Parameter,
data,
expectedResponseLength,
]
}
static func == (lhs: Iso7816ApduPigeon, rhs: Iso7816ApduPigeon) -> Bool {
if Swift.type(of: lhs) != Swift.type(of: rhs) {
return false
}
return deepEqualsPigeon(lhs.instructionClass, rhs.instructionClass) && deepEqualsPigeon(lhs.instructionCode, rhs.instructionCode) && deepEqualsPigeon(lhs.p1Parameter, rhs.p1Parameter) && deepEqualsPigeon(lhs.p2Parameter, rhs.p2Parameter) && deepEqualsPigeon(lhs.data, rhs.data) && deepEqualsPigeon(lhs.expectedResponseLength, rhs.expectedResponseLength)
}
func hash(into hasher: inout Hasher) {
hasher.combine("Iso7816ApduPigeon")
deepHashPigeon(value: instructionClass, hasher: &hasher)
deepHashPigeon(value: instructionCode, hasher: &hasher)
deepHashPigeon(value: p1Parameter, hasher: &hasher)
deepHashPigeon(value: p2Parameter, hasher: &hasher)
deepHashPigeon(value: data, hasher: &hasher)
deepHashPigeon(value: expectedResponseLength, hasher: &hasher)
}
}
/// Generated class from Pigeon that represents data sent in messages.
struct Iso7816ResponseApduPigeon: Hashable {
var payload: FlutterStandardTypedData
var statusWord1: Int64
var statusWord2: Int64
// swift-format-ignore: AlwaysUseLowerCamelCase
static func fromList(_ pigeonVar_list: [Any?]) -> Iso7816ResponseApduPigeon? {
let payload = pigeonVar_list[0] as! FlutterStandardTypedData
let statusWord1 = pigeonVar_list[1] as! Int64
let statusWord2 = pigeonVar_list[2] as! Int64
return Iso7816ResponseApduPigeon(
payload: payload,
statusWord1: statusWord1,
statusWord2: statusWord2
)
}
func toList() -> [Any?] {
return [
payload,
statusWord1,
statusWord2,
]
}
static func == (lhs: Iso7816ResponseApduPigeon, rhs: Iso7816ResponseApduPigeon) -> Bool {
if Swift.type(of: lhs) != Swift.type(of: rhs) {
return false
}
return deepEqualsPigeon(lhs.payload, rhs.payload) && deepEqualsPigeon(lhs.statusWord1, rhs.statusWord1) && deepEqualsPigeon(lhs.statusWord2, rhs.statusWord2)
}
func hash(into hasher: inout Hasher) {
hasher.combine("Iso7816ResponseApduPigeon")
deepHashPigeon(value: payload, hasher: &hasher)
deepHashPigeon(value: statusWord1, hasher: &hasher)
deepHashPigeon(value: statusWord2, hasher: &hasher)
}
}
/// Generated class from Pigeon that represents data sent in messages.
struct Iso15693SystemInfoPigeon: Hashable {
var dataStorageFormatIdentifier: Int64
var applicationFamilyIdentifier: Int64
var blockSize: Int64
var totalBlocks: Int64
var icReference: Int64
// swift-format-ignore: AlwaysUseLowerCamelCase
static func fromList(_ pigeonVar_list: [Any?]) -> Iso15693SystemInfoPigeon? {
let dataStorageFormatIdentifier = pigeonVar_list[0] as! Int64
let applicationFamilyIdentifier = pigeonVar_list[1] as! Int64
let blockSize = pigeonVar_list[2] as! Int64
let totalBlocks = pigeonVar_list[3] as! Int64
let icReference = pigeonVar_list[4] as! Int64
return Iso15693SystemInfoPigeon(
dataStorageFormatIdentifier: dataStorageFormatIdentifier,
applicationFamilyIdentifier: applicationFamilyIdentifier,
blockSize: blockSize,
totalBlocks: totalBlocks,
icReference: icReference
)
}
func toList() -> [Any?] {
return [
dataStorageFormatIdentifier,
applicationFamilyIdentifier,
blockSize,
totalBlocks,
icReference,
]
}
static func == (lhs: Iso15693SystemInfoPigeon, rhs: Iso15693SystemInfoPigeon) -> Bool {
if Swift.type(of: lhs) != Swift.type(of: rhs) {
return false
}
return deepEqualsPigeon(lhs.dataStorageFormatIdentifier, rhs.dataStorageFormatIdentifier) && deepEqualsPigeon(lhs.applicationFamilyIdentifier, rhs.applicationFamilyIdentifier) && deepEqualsPigeon(lhs.blockSize, rhs.blockSize) && deepEqualsPigeon(lhs.totalBlocks, rhs.totalBlocks) && deepEqualsPigeon(lhs.icReference, rhs.icReference)
}
func hash(into hasher: inout Hasher) {
hasher.combine("Iso15693SystemInfoPigeon")
deepHashPigeon(value: dataStorageFormatIdentifier, hasher: &hasher)
deepHashPigeon(value: applicationFamilyIdentifier, hasher: &hasher)
deepHashPigeon(value: blockSize, hasher: &hasher)
deepHashPigeon(value: totalBlocks, hasher: &hasher)
deepHashPigeon(value: icReference, hasher: &hasher)
}
}
/// Generated class from Pigeon that represents data sent in messages.
struct NfcReaderSessionErrorPigeon: Hashable {
var code: NfcReaderErrorCodePigeon
var message: String
// swift-format-ignore: AlwaysUseLowerCamelCase
static func fromList(_ pigeonVar_list: [Any?]) -> NfcReaderSessionErrorPigeon? {
let code = pigeonVar_list[0] as! NfcReaderErrorCodePigeon
let message = pigeonVar_list[1] as! String
return NfcReaderSessionErrorPigeon(
code: code,
message: message
)
}
func toList() -> [Any?] {
return [
code,
message,
]
}
static func == (lhs: NfcReaderSessionErrorPigeon, rhs: NfcReaderSessionErrorPigeon) -> Bool {
if Swift.type(of: lhs) != Swift.type(of: rhs) {
return false
}
return deepEqualsPigeon(lhs.code, rhs.code) && deepEqualsPigeon(lhs.message, rhs.message)
}
func hash(into hasher: inout Hasher) {
hasher.combine("NfcReaderSessionErrorPigeon")
deepHashPigeon(value: code, hasher: &hasher)
deepHashPigeon(value: message, hasher: &hasher)
}
}
/// Generated class from Pigeon that represents data sent in messages.
struct NfcVasCommandConfigurationPigeon: Hashable {
var mode: NfcVasCommandConfigurationModePigeon
var passIdentifier: String
var url: String? = nil
// swift-format-ignore: AlwaysUseLowerCamelCase
static func fromList(_ pigeonVar_list: [Any?]) -> NfcVasCommandConfigurationPigeon? {
let mode = pigeonVar_list[0] as! NfcVasCommandConfigurationModePigeon
let passIdentifier = pigeonVar_list[1] as! String
let url: String? = nilOrValue(pigeonVar_list[2])
return NfcVasCommandConfigurationPigeon(
mode: mode,
passIdentifier: passIdentifier,
url: url
)
}
func toList() -> [Any?] {
return [
mode,
passIdentifier,
url,
]
}
static func == (lhs: NfcVasCommandConfigurationPigeon, rhs: NfcVasCommandConfigurationPigeon) -> Bool {
if Swift.type(of: lhs) != Swift.type(of: rhs) {
return false
}
return deepEqualsPigeon(lhs.mode, rhs.mode) && deepEqualsPigeon(lhs.passIdentifier, rhs.passIdentifier) && deepEqualsPigeon(lhs.url, rhs.url)
}
func hash(into hasher: inout Hasher) {
hasher.combine("NfcVasCommandConfigurationPigeon")
deepHashPigeon(value: mode, hasher: &hasher)
deepHashPigeon(value: passIdentifier, hasher: &hasher)
deepHashPigeon(value: url, hasher: &hasher)
}
}
/// Generated class from Pigeon that represents data sent in messages.
struct NfcVasResponsePigeon: Hashable {
var status: NfcVasResponseErrorCodePigeon
var vasData: FlutterStandardTypedData
var mobileToken: FlutterStandardTypedData
// swift-format-ignore: AlwaysUseLowerCamelCase
static func fromList(_ pigeonVar_list: [Any?]) -> NfcVasResponsePigeon? {
let status = pigeonVar_list[0] as! NfcVasResponseErrorCodePigeon
let vasData = pigeonVar_list[1] as! FlutterStandardTypedData
let mobileToken = pigeonVar_list[2] as! FlutterStandardTypedData
return NfcVasResponsePigeon(
status: status,
vasData: vasData,
mobileToken: mobileToken
)
}
func toList() -> [Any?] {
return [
status,
vasData,
mobileToken,
]
}
static func == (lhs: NfcVasResponsePigeon, rhs: NfcVasResponsePigeon) -> Bool {
if Swift.type(of: lhs) != Swift.type(of: rhs) {
return false
}
return deepEqualsPigeon(lhs.status, rhs.status) && deepEqualsPigeon(lhs.vasData, rhs.vasData) && deepEqualsPigeon(lhs.mobileToken, rhs.mobileToken)
}
func hash(into hasher: inout Hasher) {
hasher.combine("NfcVasResponsePigeon")
deepHashPigeon(value: status, hasher: &hasher)
deepHashPigeon(value: vasData, hasher: &hasher)
deepHashPigeon(value: mobileToken, hasher: &hasher)
}
}
private class PigeonPigeonCodecReader: FlutterStandardReader {
override func readValue(ofType type: UInt8) -> Any? {
switch type {
case 129:
let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?)
if let enumResultAsInt = enumResultAsInt {
return PollingOptionPigeon(rawValue: enumResultAsInt)
}
return nil
case 130:
let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?)
if let enumResultAsInt = enumResultAsInt {
return NdefStatusPigeon(rawValue: enumResultAsInt)
}
return nil
case 131:
let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?)
if let enumResultAsInt = enumResultAsInt {
return TypeNameFormatPigeon(rawValue: enumResultAsInt)
}
return nil
case 132:
let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?)
if let enumResultAsInt = enumResultAsInt {
return FeliCaPollingRequestCodePigeon(rawValue: enumResultAsInt)
}
return nil
case 133:
let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?)
if let enumResultAsInt = enumResultAsInt {
return FeliCaPollingTimeSlotPigeon(rawValue: enumResultAsInt)
}
return nil
case 134:
let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?)
if let enumResultAsInt = enumResultAsInt {
return MiFareFamilyPigeon(rawValue: enumResultAsInt)
}
return nil
case 135:
let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?)
if let enumResultAsInt = enumResultAsInt {
return Iso15693RequestFlagPigeon(rawValue: enumResultAsInt)
}
return nil
case 136:
let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?)
if let enumResultAsInt = enumResultAsInt {
return NfcVasCommandConfigurationModePigeon(rawValue: enumResultAsInt)
}
return nil
case 137:
let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?)
if let enumResultAsInt = enumResultAsInt {
return NfcReaderErrorCodePigeon(rawValue: enumResultAsInt)
}
return nil
case 138:
let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?)
if let enumResultAsInt = enumResultAsInt {
return NfcVasResponseErrorCodePigeon(rawValue: enumResultAsInt)
}
return nil
case 139:
return TagPigeon.fromList(self.readValue() as! [Any?])
case 140:
return NdefPigeon.fromList(self.readValue() as! [Any?])
case 141:
return FeliCaPigeon.fromList(self.readValue() as! [Any?])
case 142:
return Iso15693Pigeon.fromList(self.readValue() as! [Any?])
case 143:
return Iso7816Pigeon.fromList(self.readValue() as! [Any?])
case 144:
return MiFarePigeon.fromList(self.readValue() as! [Any?])
case 145:
return NdefQueryStatusPigeon.fromList(self.readValue() as! [Any?])
case 146:
return NdefMessagePigeon.fromList(self.readValue() as! [Any?])
case 147:
return NdefPayloadPigeon.fromList(self.readValue() as! [Any?])
case 148:
return FeliCaPollingResponsePigeon.fromList(self.readValue() as! [Any?])
case 149:
return FeliCaReadWithoutEncryptionResponsePigeon.fromList(self.readValue() as! [Any?])
case 150:
return FeliCaRequestServiceV2ResponsePigeon.fromList(self.readValue() as! [Any?])
case 151:
return FeliCaRequestSpecificationVersionResponsePigeon.fromList(self.readValue() as! [Any?])
case 152:
return FeliCaStatusFlagPigeon.fromList(self.readValue() as! [Any?])
case 153:
return Iso7816ApduPigeon.fromList(self.readValue() as! [Any?])
case 154:
return Iso7816ResponseApduPigeon.fromList(self.readValue() as! [Any?])
case 155:
return Iso15693SystemInfoPigeon.fromList(self.readValue() as! [Any?])
case 156:
return NfcReaderSessionErrorPigeon.fromList(self.readValue() as! [Any?])
case 157:
return NfcVasCommandConfigurationPigeon.fromList(self.readValue() as! [Any?])
case 158:
return NfcVasResponsePigeon.fromList(self.readValue() as! [Any?])
default:
return super.readValue(ofType: type)
}
}
}
private class PigeonPigeonCodecWriter: FlutterStandardWriter {
override func writeValue(_ value: Any) {
if let value = value as? PollingOptionPigeon {
super.writeByte(129)
super.writeValue(value.rawValue)
} else if let value = value as? NdefStatusPigeon {
super.writeByte(130)
super.writeValue(value.rawValue)
} else if let value = value as? TypeNameFormatPigeon {
super.writeByte(131)
super.writeValue(value.rawValue)
} else if let value = value as? FeliCaPollingRequestCodePigeon {
super.writeByte(132)
super.writeValue(value.rawValue)
} else if let value = value as? FeliCaPollingTimeSlotPigeon {
super.writeByte(133)
super.writeValue(value.rawValue)
} else if let value = value as? MiFareFamilyPigeon {
super.writeByte(134)
super.writeValue(value.rawValue)
} else if let value = value as? Iso15693RequestFlagPigeon {
super.writeByte(135)
super.writeValue(value.rawValue)
} else if let value = value as? NfcVasCommandConfigurationModePigeon {
super.writeByte(136)
super.writeValue(value.rawValue)
} else if let value = value as? NfcReaderErrorCodePigeon {
super.writeByte(137)
super.writeValue(value.rawValue)
} else if let value = value as? NfcVasResponseErrorCodePigeon {
super.writeByte(138)
super.writeValue(value.rawValue)
} else if let value = value as? TagPigeon {
super.writeByte(139)
super.writeValue(value.toList())
} else if let value = value as? NdefPigeon {
super.writeByte(140)
super.writeValue(value.toList())
} else if let value = value as? FeliCaPigeon {
super.writeByte(141)
super.writeValue(value.toList())
} else if let value = value as? Iso15693Pigeon {
super.writeByte(142)
super.writeValue(value.toList())
} else if let value = value as? Iso7816Pigeon {
super.writeByte(143)
super.writeValue(value.toList())
} else if let value = value as? MiFarePigeon {
super.writeByte(144)
super.writeValue(value.toList())
} else if let value = value as? NdefQueryStatusPigeon {
super.writeByte(145)
super.writeValue(value.toList())
} else if let value = value as? NdefMessagePigeon {
super.writeByte(146)
super.writeValue(value.toList())
} else if let value = value as? NdefPayloadPigeon {
super.writeByte(147)
super.writeValue(value.toList())
} else if let value = value as? FeliCaPollingResponsePigeon {
super.writeByte(148)
super.writeValue(value.toList())
} else if let value = value as? FeliCaReadWithoutEncryptionResponsePigeon {
super.writeByte(149)
super.writeValue(value.toList())
} else if let value = value as? FeliCaRequestServiceV2ResponsePigeon {
super.writeByte(150)
super.writeValue(value.toList())
} else if let value = value as? FeliCaRequestSpecificationVersionResponsePigeon {
super.writeByte(151)
super.writeValue(value.toList())
} else if let value = value as? FeliCaStatusFlagPigeon {
super.writeByte(152)
super.writeValue(value.toList())
} else if let value = value as? Iso7816ApduPigeon {
super.writeByte(153)
super.writeValue(value.toList())
} else if let value = value as? Iso7816ResponseApduPigeon {
super.writeByte(154)
super.writeValue(value.toList())
} else if let value = value as? Iso15693SystemInfoPigeon {
super.writeByte(155)
super.writeValue(value.toList())
} else if let value = value as? NfcReaderSessionErrorPigeon {
super.writeByte(156)
super.writeValue(value.toList())
} else if let value = value as? NfcVasCommandConfigurationPigeon {
super.writeByte(157)
super.writeValue(value.toList())
} else if let value = value as? NfcVasResponsePigeon {
super.writeByte(158)
super.writeValue(value.toList())
} else {
super.writeValue(value)
}
}
}
private class PigeonPigeonCodecReaderWriter: FlutterStandardReaderWriter {
override func reader(with data: Data) -> FlutterStandardReader {
return PigeonPigeonCodecReader(data: data)
}
override func writer(with data: NSMutableData) -> FlutterStandardWriter {
return PigeonPigeonCodecWriter(data: data)
}
}
class PigeonPigeonCodec: FlutterStandardMessageCodec, @unchecked Sendable {
static let shared = PigeonPigeonCodec(readerWriter: PigeonPigeonCodecReaderWriter())
}
/// Generated protocol from Pigeon that represents Flutter messages that can be called from Swift.
protocol FlutterApiPigeonProtocol {
func tagSessionDidBecomeActive(completion: @escaping (Result) -> Void)
func tagSessionDidDetect(tag tagArg: TagPigeon, completion: @escaping (Result) -> Void)
func tagSessionDidInvalidateWithError(error errorArg: NfcReaderSessionErrorPigeon, completion: @escaping (Result) -> Void)
func vasSessionDidBecomeActive(completion: @escaping (Result) -> Void)
func vasSessionDidReceive(responses responsesArg: [NfcVasResponsePigeon], completion: @escaping (Result) -> Void)
func vasSessionDidInvalidateWithError(error errorArg: NfcReaderSessionErrorPigeon, completion: @escaping (Result) -> Void)
}
class FlutterApiPigeon: FlutterApiPigeonProtocol {
private let binaryMessenger: FlutterBinaryMessenger
private let messageChannelSuffix: String
init(binaryMessenger: FlutterBinaryMessenger, messageChannelSuffix: String = "") {
self.binaryMessenger = binaryMessenger
self.messageChannelSuffix = messageChannelSuffix.count > 0 ? ".\(messageChannelSuffix)" : ""
}
var codec: PigeonPigeonCodec {
return PigeonPigeonCodec.shared
}
func tagSessionDidBecomeActive(completion: @escaping (Result) -> Void) {
let channelName: String = "dev.flutter.pigeon.nfc_manager.FlutterApiPigeon.tagSessionDidBecomeActive\(messageChannelSuffix)"
let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec)
channel.sendMessage(nil) { response in
guard let listResponse = response as? [Any?] else {
completion(.failure(createConnectionError(withChannelName: channelName)))
return
}
if listResponse.count > 1 {
let code: String = listResponse[0] as! String
let message: String? = nilOrValue(listResponse[1])
let details: String? = nilOrValue(listResponse[2])
completion(.failure(PigeonError(code: code, message: message, details: details)))
} else {
completion(.success(()))
}
}
}
func tagSessionDidDetect(tag tagArg: TagPigeon, completion: @escaping (Result