DEV Community

Cover image for How to connect Zebra thermal printer to a custom iOS application

How to connect Zebra thermal printer to a custom iOS application

Ihor Feoktistov on November 08, 2019

I work at Relevant Software and we’ve been developing an app that allows event managers to track the attendance of their events and check-in/check-...
Collapse
 
ihor_feoktistov profile image
Ihor Feoktistov

Did you have any experience developing an app for printing?

Collapse
 
renanzdm profile image
renanzdm

I would appreciate your help as I couldn't find much material about it, there is the possibility of printing on other types of thermal printers other than Zebra. Would there be some material on this subject where I can learn a little more

Collapse
 
renanzdm profile image
renanzdm

hi, i have been working with flutter lately i am having a challenge to create a plugin that makes ios and android imprint, but i have no experience with ios it has been a huge challenge

Collapse
 
kevinvandrielatharbor profile image
KevinVandrielAtHarbor • Edited

I'm most of the way through with incorporating what you have here. I have a "Connected and ready to print" status and have preserved the writeCharacteristic by declaring it as a variable of type CBCharacteristic. The next piece of code, "sendZPLToPrinter", contains a reference to self.selectedDevice? and this is throwing me for a loop. It'll be interesting to get through this. However, I'm blown away how far I've gotten so far. Thank you.

Collapse
 
kevinvandrielatharbor profile image
KevinVandrielAtHarbor • Edited

I figured it out. The self.selectedDevice? is actually the discovered peripheral. In my case I set the discovered peripheral to a declared variable earlier in the class, so this line: "var myPerif: CBPeripheral?;", so upon discovery I held on to the peripheral as such: "self.myPerif = peripheral; self.myPerif?.delegate = self" and so later, when printing, it looks like this: "for chunk in chunks {self.myPerif!.writeValue(chunk, for: writeCharacteristic, type: .withResponse)}"