januslo / react-native-bluetooth-escpos-printer

React-Native plugin for the bluetooth ESC/POS & TSC printers.
MIT License
351 stars 411 forks source link

IOS map array not working but working fine on android #169

Open Frankiz123 opened 2 years ago

Frankiz123 commented 2 years ago

Hi @januslo I use you library code works fine on android and ios but in ios when I try to execute a column of array data using map function it through thread error in xcode my code is here

    await getorderDetails?.items?.map((val) => {
      BluetoothEscposPrinter.printColumn(
        columnWidths,
        [
          BluetoothEscposPrinter.ALIGN.LEFT,
          BluetoothEscposPrinter.ALIGN.CENTER,
          BluetoothEscposPrinter.ALIGN.CENTER,
        ],
        [
          `${val.itemName}`,
          `${val.quantity}`,
          `$${parseFloat(val.totalPrice).toFixed(2)} `,
        ],
        {}
      );
    });

and please do let me know how can we map array data in you library

Frankiz123 commented 2 years ago
Screenshot 2021-10-14 at 4 57 25 AM
sommerma874 commented 2 years ago

@Frankiz123 also had same issue in ios. If your issue is still active, try using .toString() in map function for your values.