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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

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

1,694 次查看
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 回复数

1,622 次查看
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 项奖励
回复

1,615 次查看
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 项奖励
回复

1,611 次查看
DamianD
Contributor III
call first TapLinxLibrary.SharedLibrary.VerifyLicense - does it also crash on call to verifyLicense?
0 项奖励
回复

1,608 次查看
sh4
Contributor II

No, not crash on that. 

and I got it.

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

0 项奖励
回复

1,605 次查看
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 项奖励
回复

1,640 次查看
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 项奖励
回复

1,624 次查看
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 项奖励
回复