Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App crash on iOS 14 when trying to print #8

Open
TheDude70 opened this issue Oct 16, 2020 · 3 comments
Open

App crash on iOS 14 when trying to print #8

TheDude70 opened this issue Oct 16, 2020 · 3 comments

Comments

@TheDude70
Copy link

TheDude70 commented Oct 16, 2020

When trying to connect and print our react native app crashes with the following error caught.

NSInternalInconsistencyExceptionfacebook::react::JSIExecutor::defaultTimeoutInvoker(std::__1::function<void ()> const&, std::__1::function<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > ()>)
Invalid parameter not satisfying: characteristic != nil

Seems that characteristic != nil is not caught/handled correctly.

RNZebraBluetoothPrinter.connectDevice(this.state.zebra_printer.address)
    .then((result) => {
         if (!result) { 
            Alert.alert('Could not connect to printer. Please check printer connection.') 
        }
        RNZebraBluetoothPrinter.print(zpl)
            .then((result) => { 
                if (!result) { 
                    Alert.alert('Printing failed. Please check printer connection.') 
                } 
            })
            .catch(e => console.log(e.message))
     }) 
     .catch(e => console.log(e))
@jrtheurer
Copy link

Seeing the same issue on iOS 14. Were you able to find a workaround?

@ASchwad
Copy link

ASchwad commented Apr 27, 2021

For me it helped to implement a brief timeout between the methods connectDevice and print. Just a workaround - not a solution for the root problem.

await RNZebraBluetoothPrinter.connectDevice(printerSerial)
   .then(() => {
      new Promise((res) => setTimeout(() => res(true), 500))
      .then(async () => {
         await RNZebraBluetoothPrinter.print(zpl)
      })
   })

@kkureli
Copy link

kkureli commented Nov 19, 2021

hi could u solve? I cant print on ios

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants