Skip to content

Commit

Permalink
Update README, package.json, & plugin version
Browse files Browse the repository at this point in the history
tzachari committed Aug 19, 2019

Verified

This commit was signed with the committer’s verified signature.
torkelrogstad Torkel Rogstad
1 parent 92113f7 commit 9ce071e
Showing 3 changed files with 62 additions and 26 deletions.
53 changes: 41 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -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:

<platform name="ios">
@@ -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/):

<content src="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:

<plugin name="cordova-plugin-webxr" spec="^1.17.0">
<variable name="WEBXR_AUTHORIZATION" value="lite" />
</plugin>

- **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:<br/>
`<preference name="AppendUserAgent" value="WebXRViewer CustomUserAgentName" /> `
- **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.

33 changes: 20 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -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"
}
2 changes: 1 addition & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" id="cordova-plugin-webxr" version="1.17.0">
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" id="cordova-plugin-webxr" version="1.17.1">
<name>WebXR</name>
<description>WebXR Plugin</description>
<author>Thomas Zachariah</author>

0 comments on commit 9ce071e

Please sign in to comment.