infoxicator / react-native-star-prnt

React-Native bridge to communicate with Star Micronics Bluetooth/LAN Printers
MIT License
67 stars 65 forks source link

star-print crash app in IOS 13.3 #53

Open EsraaMahmoudMohamed opened 4 years ago

EsraaMahmoudMohamed commented 4 years ago

this line crash app in iOS 13.3 with "react": "16.9.0", "react-native": "0.61.4", await StarPRNT.portDiscovery('All');

infoxicator commented 4 years ago

@dnlowman Have you tried iOS13? did you have this issue?

dnlowman commented 4 years ago

We're running iOS13 in production and are not experiencing this, could you please provide a stack trace @EsraaMahmoudMohamed?

EsraaMahmoudMohamed commented 4 years ago

@dnlowman Have you tried iOS13? did you have this issue? its work up to 13.2 but doesn't work on 13.3

EsraaMahmoudMohamed commented 4 years ago

We're running iOS13 in production and are not experiencing this, could you please provide a stack trace @EsraaMahmoudMohamed?

There is no stack trace showing with this line; the app crashes without any errors. if I change All by any another type it will work all of these lines worked with me

 await StarPRNT.portDiscovery('LAN');
 await StarPRNT.portDiscovery('USB');
 await StarPRNT.portDiscovery('Bluetooth');

As mentioned above this only happens with iOS 13.3

EsraaMahmoudMohamed commented 4 years ago

@dnlowman @infoxicator We traced back the issue to this line in RNStarPrnt.m: https://github.com/infoxicator/react-native-star-prnt/blob/d4f523b57efe3d340557b680cd3552528d75d7fb/ios/RNStarPrnt.m#L69

I tried catching the error here, however, it crashed with no stack trace. I checked the StarIO.m and it seems that the available arguments are: https://github.com/infoxicator/react-native-star-prnt/blob/d4f523b57efe3d340557b680cd3552528d75d7fb/ios/Frameworks/StarIO.framework/Headers/SMPort.h#L68

Not sure why crash with 13.3 specifically, any idea why?

As a quick fix, we are now discovering each type separately.

dnlowman commented 4 years ago

Nice find @EsraaMahmoudMohamed, I will try to re-produce what you have found and get back to you on this.

majormaximo commented 4 years ago

Any updates?