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.
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
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.
No, not crash on that.
and I got it.
"Online license verified successfully, time to explore Taplinx Library"
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
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?