Print API not working on iPad

As discussed here, DangerZone.Print.selectPrinterAsync() does not work on iPad.

I am using the latest SDK (27.0.0) and created a brand new project with the XDE. I opened HomeScreen.js and added

async componentDidMount() {
  try {
    console.log('got here', Expo.DangerZone.Print)
    const printers = await Expo.DangerZone.Print.selectPrinterAsync()
    console.log('PRINTERS', printers)
  } catch (error) {
    console.log('ERROR', error)
  }
}

to the HomeScreen class.

I get the following output

13:23:59 [exp] got here Object {
13:23:59 [exp]   "printAsync": [Function printAsync],
13:23:59 [exp]   "selectPrinterAsync": [Function selectPrinterAsync],
13:23:59 [exp] }

After that I get a bunch of warnings that are react related (Warning: isMounted(...)) and I don’t think are relevant to this issue. But I don’t get any log message or indication that anything is happening in the background. Just to be sure, I tested printing to my label printer from this same iPad using an app in the app store and everything worked as expected. I was given a custom dialog with a list of network printers to print to and it printed in the background.

Since the previous post is locked, I’m creating this one to get hopefully a more detailed explanation of why this doesn’t work on iPad.

Thanks for adding this API. I was actually originally the one who proposed that it be added, and I was looking forward to testing it out on iPad, so I hope this is resolved soon!

I cannot run the client App in development at this moment, but I will try if I have time. For reference, here are the relevant files in the repo.

cc @waltershub @msamir @adamjnav (from the other thread)

Hi @itslittlejohn - this is a known issue with the Print API currently, and it looks like you’ve already found the place we’re tracking it: https://github.com/expo/expo/issues/1630 . The ticket has been assigned internally and we’re hoping to have a fix ready soon. Really sorry for the inconvenience!

Thanks for the update. I should have checked github before posting here, but this forum came up first in google. :slight_smile:

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.