Device detection

The standard way to detect if the device is capable of using AR would be by reading the value of integration.canAugment or PlattarIntegration.canAugment. This should be checked against when the user wants to enter AR mode, so that a fallback option can be used if they do not support AR. This should be used because on iOS devices, Quicklook is currently only accessable from Safari/Chrome and will not work inside webviews (like inside the facebook or linkedin apps).

If the device does support AR mode, it can be entered by calling integration.startAugment(function(){/*fallback*/});. This will launch Quicklook on iOS devices or Scene Viewer on android devices. At this time, on Android we cannot tell if AR is supported until the user attempts to augment, so it is recommended to pass a function to the startAugment() function which will be called as a fallback if switching to AR fails.

If the device does not support ar mode, the integration object provides a fallback url integration.embedUrl that can be embedded into the page as an iframe or opened in a new tab. This will display the model and allow the user to rotate/zoom around it, but will not provide the AR tracked view.

Alternately you can display a QR code for the user to scan with their phone that will take them to the 3d model and allow for webAR. the field integration.qrUrl will create an image that can be displayed using an img tag on your site: <img src='{integration.qrUrl}'/>

In the example code, there is an iframe with no source set to the same dimensions as the product image. When the user clicks “View in 3D” the iframe has its source set to the integration.embedUrl and is displayed, letting the model load and overlay the product image.

Custom device dection

This library provides some further functions for checking exactly what functions are supported.

  • integration.canQuickLook() // iOS basic AR
  • integration.canRealityViewer() // iOS Advanced AR
  • integration.canSceneViewer() // Android basic AR
  • integration.canFaceTrack() // Plattar facetracking

Along with these checks are the functions for running the respective libraries:

  • integration.startQuickLook() // iOS basic AR
  • integration.startRealityViewer() // iOS Advanced AR
  • integration.startSceneViewer() // Android basic AR