- iOS
cordova plugin add https://github.com/eclettica/cordova-plugin-ar.git
Add the following lines into your config.xml in the platform tag.
<platform name="ios">
<preference name="UseSwiftLanguageVersion" value="4.2" />
</platform>
- cordova.plugins.ar.addARView
- cordova.plugins.ar.removeARView
- cordova.plugins.ar.setListenerForArChanges
- cordova.plugins.ar.reloadSession
Insert the camera view under the WebView
cordova.plugins.ar.addARView();
Remove the camera view
cordova.plugins.ar.removeARView();
Set listener for event from ARKit
Parameter | Type | Description |
---|---|---|
arHandler |
Function |
Is called after initializing an AR session |
arHandler
Parameter | Type | Description |
---|---|---|
str |
String |
Line with camera change information. Format: positionX, positionY, positionZ, quatirionX, quatirionY, quatirionZ, quatirionW |
cordova.plugins.ar.setListenerForArChanges((str) => {});
Reload AR session
cordova.plugins.ar.reloadSession();