npm.io
0.0.2 • Published 7 years ago

cordova-plugin-viewar

Licence
MIT
Version
0.0.2
Deps
0
Size
119.3 MB
Vulns
0
Weekly
0

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
    1. Install this Plugin

      $cordova plugin add cordova-plugin-viewar

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

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

  2. ensure that you have -lstdc++ in Build Settings -> Linking -> Other Linker Flags

  1. 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); }

Keywords