Hello dear StackOverflow users,
i have been working on improving the stability of our app at work in conjunction with using mobile thermal printers.
During testing we discovered a scenario in which we can cause our app not to discover the printer again until the printer is restarted. In order to do that we need to start a print, quit the app while the printer is still printing, restart the app and then try to start printing again. This problem can only be fixed by restarting the printer.
Before we start printing, we wait for up to 10 seconds and during that timespan we regularly ask the SharedAccessoryManager for connected accessories only to discover that in the aforementioned scenario connectedAccessories returns an empty array.
We added the protocol string of the printer to Info.plist already and made sure that the printer is connected within the iOS settings.
My question is: How can we fix this issue within our app? Is there a way to deal with the situation within our app to begin with?