Platform Support and Testing

The Zappar package is currently supported for Unity's iOS, Android and WebGL build platforms. You can switch between, and build, for each of these platforms without making any code or scene changes.

If you're building for iOS or Android, or you'd like to self-host a WebGL build on your own domain, you must register your app/site with ZapWorks. For more information see the Licensing article.

Please read the considerations below for the different build platforms:

Android

At this time, the Vulkan rendering API is not supported on Android. Please adjust your player settings on Android to use OpenGLES 2.0 or 3.0.

The package requires Android 6.0 (API version 23) or later so be sure to set the Minimum API level in your player settings to match.

iOS

As the package makes use of the camera, you must set Camera Usage Description in your player settings. This text is displayed to the user when the operating system shows the camera permissions prompt.

The default graphics API on iOS is Metal, however, there may be cases where you wish to use OpenGL. If this is the case, edit the line below within the Assets/Plugins/iOS/zappar-unity.h file to prevent the Zappar library from linking against the Metal framework:

// Comment out the line below if you do not want to include support for Metal. 

#define ZAPPAR_METAL_SUPPORT

If you are building a Face Tracked experience (and / or if you're using the Face Mesh) for iOS you will need to add the ZCV.bundle file into the root level of your generated Xcode project. This file can be found in Assets/Zappar/ZCV.bundle. When including it into the project make sure that it is selected as a target of "Unity-iPhone" (or the relevant name of your application).

WebGL

While Unity's WebGL support for mobile is currently 'experimental', we've found it's possible to build great AR experiences with Unity and deploy to the web.

Unity's built-in WebGL template does not render the player window in fullscreen by default. The Zappar library provides an alternative template that shows a simple loading bar while the Unity content is loading, and fills the full browser window. You can use this template by navigating to the Resolution and Presentation section in the Player Settings menu and selecting the Zappar template.

For Unity 2019 and older versions, use the Zappar 2019 template. For Unity 2020 and above, use the Zappar template.

You can alter this template by editing the Packages/Universal AR/WebGLTemplates/Zappar/index.html file, or alternatively by placing your own index.html file inside a folder of your choice (itself inside the WebGLTemplates folder).

For more information on how to customise WebGL templates, please consult the Unity documentation.

Testing

Throughout development we recommend testing your experience to make sure it's set up and working as expected. Play Mode and locally hosting your project files are two great ways of doing this.

Play Mode

The package features full support for Play mode on both Mac and Windows. This means that you can preview your scenes using a webcam, right inside the Unity editor. With Play mode you can use Face and Image trackers, and preview your content without having to produce a full build. Since Instant World Tracking requires a device gyroscope sensor, it's not currently supported in Play mode.

Web Builds

If you are building for WebGL then you can test your projects by serving the content locally using the ZapWorks CLI. Due to browser restrictions surrounding the use of the camera, you must use HTTPS to view or preview your site, even if doing so locally from your computer. This means that Unity's Build and Run option will not work for previewing and testing your project.

To serve your WebGL output folder over HTTPS for access on your local computer:

zapworks serve

You can also serve the folder for access by other devices on your local network:

zapworks serve --lan

Remember to run these commands within the folder that's generated by Unity when you build your project for WebGL - it should contain an index.html file.

ZapWorks provides complete serving and hosting for your WebGL-based experiences, should you wish to use it. Find out more on our Hosting article.

zapcode branded_zapcode i