Taplinx iOS - apduExchange(withByteArray apduData: Data) -> TL_TagAPDUResponse?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Taplinx iOS - apduExchange(withByteArray apduData: Data) -> TL_TagAPDUResponse?

506 Views
sh4
Contributor II

according to UG10045 I setup the project, but apduExchange method not calling. Can you provide the sample project or detail about how to initialise TLLibraryManager and create instance. 

7 Replies

434 Views
DamianD
Contributor III

there is no sample app that i know of, i also asked here about it and got no helpful answer. On what line exactly does you app crashes? show some code

0 Kudos
Reply

427 Views
sh4
Contributor II

 

  func beginSession() {

    guard NFCTagReaderSession.readingAvailable else {

      onError?("NFC not supported on this device.")

      return

    }

    session = NFCTagReaderSession(pollingOption: [.iso14443], delegate: self, queue: queue)

    session?.alertMessage = "Hold your iPhone near the NFC tag."

    session?.begin()

    self.handler = TapLinxApduHandler()

    self.handler?.delegate = self

    TLLibraryManager.shared().setApduHandlerWithApduHandler(handler)

  }

when I define TLLibraryManager.shared() then it getting crash with error 

error: memory read failed for 0x10.

0 Kudos
Reply

423 Views
DamianD
Contributor III
call first TapLinxLibrary.SharedLibrary.VerifyLicense - does it also crash on call to verifyLicense?
0 Kudos
Reply

420 Views
sh4
Contributor II

No, not crash on that. 

and I got it.

"Online license verified successfully, time to explore Taplinx Library"

0 Kudos
Reply

417 Views
DamianD
Contributor III
ok, please take a look at https://community.nxp.com/t5/TapLinx-SDK-TagWriter-and/Taplinx-iOS-appcrash-on-tag-response/m-p/1991... and see if sample code in swift posted there by nxp employee helps you. You will have to move setting apduHandler into tag detected event because reader needs access to that tag.
0 Kudos
Reply

452 Views
DamianD
Contributor III

1. header files are lying - you have to return IOSByteArray from apduExchange method, not TL_TagAPDUResponse. As for calling your apduExchange method, do something like this:

Taplinx.iOS.TapLinxLibrary.SharedLibrary.VerifyLicense(licenseKey, (success, errMsg) =>
{  
    if (success == true)
    {
        NFCTagReaderSession = new NFCTagReaderSession(NFCPollingOption.Iso14443 
            , this, DispatchQueue.DefaultGlobalQueue);        
        NFCTagReaderSession.BeginSession();
        TLLibraryManager.Shared.SetApduHandlerWithApduHandler(apduHandler);
    }    
});

and in tag detection event, just connect tag to session and call appropriate methods, example:

 TLLibraryManager.Shared.GetTagDetailsOnCompletion

0 Kudos
Reply

436 Views
sh4
Contributor II

I have a Mifare Desfire EV2 tag and when I am creating an instance like that TLLibraryManager.shared() and the application getting crashes and return an error  

error: memory read failed for 0x24.

I detected a tag in this method

func tagReaderSession(_ session: NFCTagReaderSession, didDetect tags: [NFCTag]).

can you please share more details or the sample app for 
reference?

0 Kudos
Reply