diff --git a/README.md b/README.md index d392001..1dba939 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # Cordova WebXR Plugin -Add augmented reality content to your app using the WebXR Device API (well, [Mozilla's version](https://github.com/mozilla/webxr-polyfill/)). +Add augmented reality content to your app using the WebXR Device API ([Mozilla's version](https://github.com/mozilla/webxr-polyfill/)). -This is intended to support all content that is viewable in [Mozilla's iOS WebXR Viewer](https://apps.apple.com/us/app/webxr-viewer/id1295998056). +This is intended to support the same content as Mozilla's [iOS WebXR Viewer](https://apps.apple.com/us/app/webxr-viewer/id1295998056). ## Installation @@ -11,7 +11,7 @@ Install using the Apache Cordova command line: cordova plugin add cordova-plugin-webxr -This plugin can only be used on ARKit-compatible devices and requires an iOS Deployment Target of 12.0 or higher. +This plugin can only be used on [ARKit-compatible devices](https://www.apple.com/ios/augmented-reality/#ac-globalfooter) and requires an iOS Deployment Target of 12.0 or higher. Make sure to adjust the project config.xml accordingly, e.g: @@ -21,26 +21,55 @@ Make sure to adjust the project config.xml accordingly, e.g: ## Try It Out -To test some interactive AR content, set the default source in the project's config.xml to [Mozilla's examples site](https://webxr-ios.webxrexperiments.com/): +To quickly test some interactive AR content, set the default source in the project's config.xml to Mozilla's [example site](https://webxr-ios.webxrexperiments.com/): The source code for the examples can be found in Mozilla's [webxr-ios-js repo](https://github.com/MozillaReality/webxr-ios-js/tree/develop/examples) -## NOTE: Mozilla WebXR ≠ W3C WebXR (yet) -Mozilla's version of the API is substantially different from the W3C draft spec. -They plan to align their's with the W3C spec once it has matured. +## Options +The plugin provides a set of a configurable options: -## Dependencies +- **WEBXR_AUTHORIZATION**: Sets what is shared with a page that uses the WebXR API + - `denied`: Shares no world sensing data and no video + - `minimal` (default): Shares minimal world sensing data, but no video + - `lite`: Shares one real world plane & enables face-based experiences, but no video + - `worldSensing`: Shares full world sensing data, but no video + - `videoCameraAccess`: Shares full world sensing data and video feed + +- **GRAPHICS_FRAMEWORK**: Specifies which graphics framework to use + - `sceneKit` (default): Uses [SceneKit](https://developer.apple.com/scenekit/) + - `metal`: Uses [Metal](https://developer.apple.com/metal/) (experimental) + +To set these options, specify them when adding the plugin, e.g: + + cordova plugin add cordova-plugin-webxr --variable GRAPHICS_FRAMEWORK=metal + +Or add them within the plugin's tag in config.xml, e.g: + + + + -- **iOS 12.0 / ARKit**: The plugin can only be used on ARKit-compatible devices and requires an iOS Deployment Target of 12.0 or higher. +There are also some additional parameters that can be overridden: + +- **CAMERA_USAGE_DESCRIPTION**: Describes why camera access is required. Default: `This app uses the camera for augmented reality` + +- **PRODUCT_MODULE_NAME**: If the Product Module Name in the iOS Target Build Settings differs from the Cordova project name (e.g. when embedding a Cordova WebView into an existing app), the module name must be passed to this variable. If omitted, the app may not build. + + +## NOTE: Mozilla WebXR ≠ W3C WebXR (yet) +Mozilla is in the process of aligning [their version of the API](https://github.com/mozilla/webxr-polyfill/) with the [official draft W3C spec](https://www.w3.org/TR/webxr/). +As such, some features are currently broken. +This plugin will be updated as the API stabilizes. + +## Dependencies -- **User Agent**: The plugin relies on the `AppendUserAgent` preference value. If you plan to override the value in config.xml, ensure it includes "WebXRViewer", e.g:
-` ` +- **iOS 12 / ARKit 2**: The plugin can only be used on ARKit-compatible devices and requires an iOS Deployment Target of 12.0 or higher. -- **Swift Version**: The iOS source code assumes Swift 4.0. It will automatically install `cordova-plugin-add-swift-support`, if it is not already present. +- **Swift 4**: The iOS source code assumes Swift 4.0. It will automatically install `cordova-plugin-add-swift-support`, if it is not already present. - **WKWebView**: The plugin requires WKWebView. It will automatically install `cordova-plugin-wkwebview-engine`, if not already in use. diff --git a/package.json b/package.json index 3e06125..f533d42 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cordova-plugin-webxr", - "version": "1.17.0", + "version": "1.17.1", "description": "WebXR Plugin", "cordova": { "id": "cordova-plugin-webxr", @@ -9,22 +9,21 @@ ] }, "keywords": [ - "ar", - "vr", - "xr", + "ar", + "vr", + "xr", "w3c", - "arkit", + "arkit", "webar", "webvr", - "webxr", - "mozilla", - "polyfill", - "augmented reality", - "virtual reality", + "webxr", + "mozilla", + "polyfill", + "augmented reality", + "virtual reality", "mixed reality", - "immersive web", + "immersive web", "ecosystem:cordova", - "cordova-android", "cordova-ios" ], "engines": [ @@ -34,5 +33,13 @@ } ], "author": "Thomas Zachariah", - "license": "Apache 2.0" + "license": "Apache 2.0", + "repository": { + "type": "git", + "url": "git+https://github.com/tzachari/cordova-plugin-webxr.git" + }, + "bugs": { + "url": "https://github.com/tzachari/cordova-plugin-webxr/issues" + }, + "homepage": "https://github.com/tzachari/cordova-plugin-webxr#readme" } diff --git a/plugin.xml b/plugin.xml index 6bea43c..6404f77 100644 --- a/plugin.xml +++ b/plugin.xml @@ -1,4 +1,4 @@ - + WebXR WebXR Plugin Thomas Zachariah