0.0.2 • Published 5 years ago

cordova-plugin-viewar v0.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

Cordova ViewAR Plugin: cordova-plugin-viewar

A Plugin that lets cordova apps (currently we support only iOS) use ViewAR SDK

How to use it

1) Create a new Cordova Project or if using in an existing project skip this step

   $ cordova create mysample com.example.mysample MySample
   $ cd mysample
   $ cordova platform add ios

2) Install this Plugin

   $cordova plugin add cordova-plugin-viewar

3) open the project in XCode and go to "Build Phases" and all the following lines in "Run Script"

npm.io

cp -a ../../plugins/cordova-plugin-viewar/resources/* "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/"

4) ensure that you have -lstdc++ in Build Settings -> Linking -> Other Linker Flags

npm.io

5) To start using ViewAR, add the following function to your index.js script and call it when needed

 startViewAR: function() {

    var success = function(message) {
        console.log('Success calling ViewAR Plugin');
    }

    var failure = function() {
        alert("Error calling ViewAR plugin!!!");
    }
    cordova.plugins.ViewARPlugin.init('init', success, failure);
}