iPhone & Android Apps

One simple way to run Printess inside of Mobile Apps is to use WebViews. These WebViews should load a publicly accessible webpage, where Printess is implemented. This can be as elementary as our simple example.

Depending on your needs, you can have multiple such endpoints with different settings, or load your settings from the WebView that displays the page, e.g. through the load call.

iPhone App Sample Code

You can easily integrate Printess into an iPhone App.

Here is the swift sample project your iOS developer would like to see

This App is a simple implementation of the WebView approach explained above.

The Printess Page which is loaded into the WebView can be accessed here.

Note, that this page stays blank until you call the startPrintess() function in the app, which in turn calls the window.startPrintessPanel() function, that is defined in the webpage. On the webpage itself you can call window.startPrintessPanel(config) with config being an object { token: YOUR_SHOP_TOKEN, templateName: YOUR_TEMPLATE_NAME, basketId: YOUR_BASKET_ID } in order to load the Printess Editor.

Android App Sample Code

Naturally Printess also works in Android Apps. Here is some good boilerplate code for your dev to start with

This App is a simple implementation of the WebView approach explained above.

Unfortunately, WebViews in Android cannot be previewed using Android Studios Preview functionality, so using a device (simulated or real) is required to develop/test.

The Printess Page which is loaded into the WebView can be accessed here.

You need to register callback functions in your app’s WebView under a namespace (in this example printess_android) and use that to call them. You may only use primitive types for these functions, so more complex data may need to be stringifyed and parsed.

Note, that when you open this page in your web browser, the Printess editor immediately loads with a template. This is because the web endpoint is directly connected to a template and will only load this example. This is opposed to the approach used for our iOS example, where the selection of a template to load happens through executing a script with the corresponding parameters.

Contact us in case you need developer support - we love to help: support@printess.com or use the chat on our homepage.