cordova-plugin-pixlive
Advanced tools
Comparing version 1.2.9 to 1.2.10
{ | ||
"version": "1.2.9", | ||
"version": "1.2.10", | ||
"name": "cordova-plugin-pixlive", | ||
@@ -52,3 +52,8 @@ "cordova_name": "PixLive", | ||
}, | ||
"homepage": "https://github.com/vidinoti/cordova-plugin-PixLive#readme" | ||
"homepage": "https://github.com/vidinoti/cordova-plugin-PixLive#readme", | ||
"devDependencies": { | ||
"grunt": "^1.0.1", | ||
"grunt-contrib-clean": "^1.0.0", | ||
"grunt-jsdoc": "^2.0.0" | ||
} | ||
} |
@@ -8,3 +8,5 @@ # Cordova plugin for PixLive SDK | ||
## Installation | ||
Create a PixLive Maker account, obtain a licence, download SDKs and register you app at https://www.vidinoti.com/ | ||
Install the plugin by passing the VDARSDK.framework and vdarsdk-release.aar file of the PixLive SDK to the plugin installation command line: | ||
@@ -15,1 +17,35 @@ | ||
``` | ||
## Create an augmented reality app in two minutes! | ||
This demo app show you the basis to use PixLive SDK in your cordova project. | ||
* Create a new Cordova project using cordova-template-PixLive. **Don't forget to register your app on PixLive Maker.** | ||
```bash | ||
cordova create myArApp com.mycompany.myArApp myArApp --template https://github.com/vidinoti/cordova-template-PixLive.git | ||
``` | ||
* Add android and iOS platforms | ||
```bash | ||
cd myArApp | ||
cordova platform add android | ||
cordova platform add ios | ||
``` | ||
* Add the Cordova plugin for PixLive SDK to your project | ||
```bash | ||
cordova plugin add cordova-plugin-pixlive@latest --variable LICENSE_KEY=MyLicenseKey --variable PIXLIVE_SDK_IOS_LOCATION=\"path/to/VDARSDK.framework\" --variable PIXLIVE_SDK_ANDROID_LOCATION=\"path/to/android/vdarsdk-release.aar\" | ||
``` | ||
* Build your project | ||
```bash | ||
cordova buil android | ||
cordova build ios | ||
``` | ||
* Your demo app is ready, you can already test it! | ||
```bash | ||
cordova run android | ||
``` |
var exec = require('cordova/exec'); | ||
/** | ||
* PixLive | ||
* @constructor | ||
*/ | ||
var PixLive = function(handle) { | ||
@@ -70,6 +73,2 @@ this.options = {}; | ||
PixLive.setNotificationsSupport = function( enabled, apiKey ) { | ||
exec(null, null, "PixLive", "setNotificationsSupport", [ enabled ? (apiKey ? apiKey : true) : null]); | ||
}; | ||
PixLive.synchronize = function( tags, success, error ) { | ||
@@ -104,2 +103,38 @@ exec(success, error, "PixLive", "synchronize", [tags]); | ||
// Activates the bookmark feature. A bookmark icon will be shown when a context is | ||
// displayed and the user has the possibility to "save" the context. | ||
PixLive.setBookmarkSupport = function (enabled) { | ||
exec(null, null, "PixLive", "setBookmarkSupport", [enabled]); | ||
}; | ||
// Returns the list of contexts that have been bookmarked. | ||
PixLive.getBookmarks = function(success, error) { | ||
exec(function(list) { | ||
if(success !== null) { | ||
var ret = []; | ||
for (var i = 0; i < list.length; i++) { | ||
var prop = list[i]; | ||
var object = new PixLive.Context(prop); | ||
ret.push(object); | ||
} | ||
success(ret); | ||
} | ||
}, error, "PixLive", "getBookmarks", []); | ||
}; | ||
// Adds the contextId to the list of bookmarked content. | ||
PixLive.addBookmark = function(contextId) { | ||
exec(null, null, "PixLive", "addBookmark", [contextId]); | ||
}; | ||
// Removes the contextId from the list of bookmarked content. | ||
PixLive.removeBookmark = function(contextId) { | ||
exec(null, null, "PixLive", "removeBookmark", [contextId]); | ||
}; | ||
/** The callback success is called with true or false depending if the context ID is bookmarked or not. */ | ||
PixLive.isBookmarked = function(contextId, success, error) { | ||
exec(success, error, "PixLive", "isBookmarked", [contextId]); | ||
}; | ||
// Used to signal the plugin that the page is fully loaded | ||
@@ -106,0 +141,0 @@ document.addEventListener("deviceready", function() { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
239218
29
4968
50
3