I have successfully implemented the Link OS iOS SDK into my Xcode project.
I created a bridging header for the .h files, and I am able to print successfully to our Zebra Printers
I am having an issue where extra tags are being printed. Explained:
- Connection is open with IP and port
- ZPL data is sent to printer, and tag prints successfully
- Connection is closed
About 20% of the time, when the app is opened again to the main page, the zebra printer will open the tcp connection and print the same tag again. I am stumped and have no idea what is causing this. Any help is appreciated. I added a time stamp to print on the labels, when the extra tag is printed it's using the time stamp form the original tag printed.
I have already tried the following but the issue is still happening:
- Set the TcpPrinterConnection object to nil after closing
- Wrapped the function in an autoreleasepool
Code:
autoreleasepool {
var connection = TcpPrinterConnection.init(address: printerIP, andWithPort: 6101)
if connection!.open() == true {
do {
try tool!.sendCommand(writeDate)
connection!.close()
} catch {
connection!.close()
print(error.localizedDescription)
}
}
}