Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

bug: Unable to write to tag ISO 7816/14443 #33

Closed
danielcowleypnp opened this issue Oct 19, 2023 · 3 comments
Closed

bug: Unable to write to tag ISO 7816/14443 #33

danielcowleypnp opened this issue Oct 19, 2023 · 3 comments
Labels
bug/fix Something isn't working needs: triage platform: android Android platform platform: ios iOS platform

Comments

@danielcowleypnp
Copy link

Plugin version:
5.0.2

Platform(s):
iOS/Android

Current behavior:
When writing with both iOS and Android it is returning the following errors:
iOS: Tag is not connected
Android(First write is fine any subsequent writes give this error): An unknown error has occurred.

Expected behavior:
It should be writing the NDEF text record I am sending to the device. The devices i am using to test with do return a record after the write which the phonegap-nfc plugin before switching to this plugin one did return the following is an example of the text record been written and the expected result based on the phonegap-nfc plugins previous functionality

LOGIN 123\nSRION YES\nMAKERSET

which would result in the following response from the tag

LOGIN OK\nSRION OK\nMAKERSET OK

Steps to reproduce:
I Get the errors from just using the sample code from the readme i just scan the tag after initiating a session

Related code:

async write(): Promise<void> {
        return new Promise((resolve) => {
            Nfc.addListener('nfcTagScanned', async (event) => {
                await Nfc.write({ 
                      message: {
                          records: [
                              this.nfc.nfcUtils.createNdefTextRecord({ 
                                  text: 'LOGIN 123\nSRION YES\nMAKERSET'
                               }).record
                          ]
                      }
                });
                await Nfc.stopScanSession();
                resolve();
            });

            Nfc.startScanSession();
        });
}

Other information:
the tags i am using are ISO7816/ISO14443 following the NFC Forum Type 4 specification with the communication protocols:
ISO/IEC 1443 Type A
NFC Data Exchange Format - NDEF (Record type TEXT)

Capacitor doctor:

💊   Capacitor Doctor  💊 

Latest Dependencies:

  @capacitor/cli: 5.5.0
  @capacitor/core: 5.5.0
  @capacitor/android: 5.5.0
  @capacitor/ios: 5.5.0

Installed Dependencies:

  @capacitor/cli: 5.4.1
  @capacitor/android: 5.4.1
  @capacitor/ios: 5.4.1
  @capacitor/core: 5.4.1

[success] iOS looking great! 👌
[success] Android looking great! 👌
@robingenz robingenz added bug/fix Something isn't working platform: android Android platform platform: ios iOS platform labels Oct 19, 2023
@robingenz
Copy link
Member

Hey @danielcowleypnp,
thank you for your request. Can you reproduce the issue with this demo app?

@danielcowleypnp
Copy link
Author

Thank you for the reply @robingenz after testing with the demo app it does work as expected. Which suggests this isn't an issue with the plugin rather my app code which is vanilla javascript using the methods provided by the documentation.

@robingenz
Copy link
Member

Alright, in this case i am closing this issue.
However, I would still like to help you troubleshoot. Feel free to provide a Minimal, Reproducible Example using this template in a public GitHub repository so I can take a closer look.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug/fix Something isn't working needs: triage platform: android Android platform platform: ios iOS platform
Projects
None yet
Development

No branches or pull requests

2 participants