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

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

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

507件の閲覧回数
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 返答(返信)

435件の閲覧回数
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 件の賞賛
返信

428件の閲覧回数
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 件の賞賛
返信

424件の閲覧回数
DamianD
Contributor III
call first TapLinxLibrary.SharedLibrary.VerifyLicense - does it also crash on call to verifyLicense?
0 件の賞賛
返信

421件の閲覧回数
sh4
Contributor II

No, not crash on that. 

and I got it.

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

0 件の賞賛
返信

418件の閲覧回数
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 件の賞賛
返信

453件の閲覧回数
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 件の賞賛
返信

437件の閲覧回数
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 件の賞賛
返信