Hi ALL,
We are trying to invoke printing from shopify POS extensions. We have an endpoint that is returning a PDF content and we would like to print it with the POS app, invoking system printing.
We use the following code to initiate app bridge:
const config = {
apiKey: Secrets.shopify.clientID,
host: new URLSearchParams(location.search).get("host"),
forceRedirect: true // btw, we tried with this value on false anyway, does not work
};
const app = createApp(config);
// const redirect = Redirect.create(app);
app.dispatch(Redirect.toRemote({
url: 'https://ourdomain.com/receipt.pdf' + location. Search,
newContext: true,
}));
app.dispatch(Print.Action.APP);
The expectation was that app will redirect to our pdf and invoke printing on it, then the print dialog will show up.
First, redirect does not happen at all, secondly, printing dialog is not invoked.
We also tried to redirect the app to an html page, instead of a pdf, then invoke printing with window.print() function but this is not invoking printing dialog, probably because the app loads the content into an iframe which blocks printing function.
How did you solved this issue. Has somebody managed to print pdf documents with app bridge and POS iOS app?
Any help is much appreciated. This issue is hunting us for some time.