HeligPfleigh / react-native-thermal-receipt-printer

A RN library for thermal printer
163 stars 103 forks source link

iOS App is crashing at the BLEPrinter.init() #26

Open InheritxSolution opened 3 years ago

InheritxSolution commented 3 years ago

Hello,

I have been trying to run the release app into the iOS device but unfortunately, the app is crashing at the start where I have called BLEPrinter.init() along with the await statement.

After that, I have downloaded the example app which is given in this doc and run the project and set up the certificates for that to prepare a build and after successfully preparing the build I have installed that in one of my iOS device but the same thing happened there that app is crashing even in the example app at iOS platform.

Please do needful here as I am stuck in the middle of something that Is really urgent to deliver to someone.

Thanks.

HeligPfleigh commented 3 years ago

Please provide the detail crash log to eleborate this issue

swapnil-panchal commented 3 years ago

As I have mentioned earlier that it is caused in release build so that I can not able to get the logs but after making build multiple times by made changes into the code I can come to know that the writing BLEPrinter.init() is the main reason to crash the app in release mode.

tahaferhani commented 3 years ago

Try to add the usage descriptions to Info.plist

<key>NSBluetoothPeripheralUsageDescription</key>
<string>We use bluetooth for printing</string>
<key>NSBluetoothAlwaysUsageDescription</key>
<string>We use bluetooth for printing</string>
Rc85 commented 3 years ago

Also crashing on IOS when calling init on BLEPrinter. Calling init on NetPrinter is okay, but calling NetPrinter.getDeviceList after will crash.

tahaferhani commented 3 years ago

@Rc85 Have you requested permission to use Bluetooth ?

datpt11 commented 3 years ago

@Rc85 have you connected the printer to bluetooth on ios?

Rc85 commented 3 years ago

@Rc85 have you connected the printer to bluetooth on ios?

I haven't because my iPhone's BT is messed up, it cannot find nearby devices. But I'm not getting the crash as stated in this issue. If I try to print a receipt without connecting the printer to my app, it just gives me an error saying no printer connected.

Edit - I just discovered that I had to download an app that the printer came with to connect the printer. But even then, this library cannot find the printer.

piyasil commented 3 years ago

Have you found any solution for this ? I've encountered the same issue here. Device paired successfully, but crashing on calling BLEPrinter.init().

chukiatt commented 2 years ago

i same