Concepts

WebXR vs native ARCore

An honest feature-by-feature split of the package's runtimes: what each one actually does, verified against the code — WebXR, native Android ARCore, and (since 1.2.0) native iOS ARKit.

The package contains three AR runtimes that share a JS facade name and almost nothing else. Earlier README wording presented them as "two runtimes, one API" at feature parity. They are not. This page is the corrected, code-verified split, updated for 1.2.0, which added the third runtime: native iOS (ARKit + RealityKit).

Feature by feature

CapabilityWebXR runtime (src/web.js)Native Android (android/)Native iOS (ios/, since 1.2.0)
Session start/stopYes, immersive-ar XR sessionYes, ARCore Session via the pluginYes, ARKit world-tracking session on a RealityKit ARView over the web view
Plane detectionYes, XR planes, dot/mesh visualisationYes, planes tracked, surface state eventsYes, ARKit plane anchors (horizontal + vertical), same surface events
Hit testingYes, centre reticle path; non-centre coordinates use a ray-based hit testYes, real per-coordinate hit test against the frame, served by the render loopYes, RealityKit raycast at the normalised point; position + quaternion rotation, and a real ARAnchor is registered and its id returned
Model renderingYes, GLB/GLTF via Three.js, anchored in the sceneNo, placeModel rejects with NOT_IMPLEMENTED; there is no native renderer (Option B, see below)Yes, USDZ via RealityKit, anchored to real ARAnchors — iOS has no WebXR, so native renders for real
Model transformsYes, position/rotation/scale on placed modelssetTransform / setMaterial reject with NOT_IMPLEMENTEDYes, Euler-degrees rotation + uniform scale on the placed entity; setMaterial applies a flat colour across the model's meshes
moveModelHit-test based (centre or ray)Rejects with NOT_IMPLEMENTEDYes, raycast + re-anchor at the new point
Colours / texturesYes, materials are real and renderedVia the WebXR runtime onlyColours yes (flat SimpleMaterial); textures only as authored in the USDZ
AnchorsYes, XR anchors drive model poses per frameHit tests create real ARCore anchors and return their anchorId; there are no native model placements to anchorYes, placements and hit tests create real ARAnchors
ScreenshotsYes, camera + scene composite (needs the enableScreenshots opt-in)NoNo
GesturesYes, Pointer Events controller over the DOM overlayVia your web UI (the WebView stays on top)RealityKit gestures on placed models (translation / rotation / scale) once placed
Support checkReal, feature detection against navigator.xr, with an INSECURE_CONTEXT code outside secure contextsReal, ArCoreApk.checkAvailability(); unsupported devices and missing ARCore are reported honestlyReal, ARWorldTrackingConfiguration.isSupported; resolves (never throws), with UNSUPPORTED_DEVICE_NOT_CAPABLE when unsupported
Pause/resume with the activityBrowser-managedWired, the plugin forwards Capacitor's pause/resume/destroy to the session and render loopSession runs/pauses with the AR view's attach/detach; plugin destroy detaches the view

Which runtime am I on?

  • createARView, the functional helpers and useARCore → always WebXR, in a browser and inside a Capacitor app alike.
  • The ARCore facade → native plugin on Android and on iOS (both register the jsName ARCore); on web platforms the same plugin name resolves to the WebXR engine, so facade calls in a browser behave like the engine (including rendering).

Guidance

  • Building a product viewer today: on Android/web use the WebXR path (createARView); on iOS use the ARCore facade against the native runtime. Both render models — WebXR from GLB, iOS native from USDZ — so a cross-platform product viewer ships each product in both formats (or passes usdzUrl alongside the GLB modelUrl).
  • Planning on the Android native path: it is session + hit-test + surface events, by decision (audit Option B): the model methods reject with NOT_IMPLEMENTED rather than reporting success for work that never happened. Android native model rendering (Option A) remains an owner decision, not a roadmap promise. The iOS native path is different by necessity: with no WebXR to fall back to, it implements the model methods for real — the honest answer there was to build the renderer, not to reject.
  • Support gating: either runtime's checkSupport() is a real check in 1.1.0: the WebXR one feature-detects navigator.xr (and reports INSECURE_CONTEXT outside secure contexts), the native one asks ARCore itself. Still handle startSession failure: support can change between the check and the session (installs, updates, permissions).

Note

None of this makes the Android native layer useless: availability handling, install flow, session configuration, plane tracking, real hit-test anchors and the render loop for the camera background are real, working code. Its gap is specific, model rendering, and it is documented here rather than discovered by users. The iOS runtime's model pipeline is USDZ end to end: a GLB source maps to its sibling .usdz, an explicit usdzPath / usdzUrl wins when given, remote USDZ files are downloaded to the app Caches folder before loading, and a source with no USDZ available rejects with MODEL_FORMAT_UNSUPPORTED.