
Product
Introducing Socket Fix for Safe, Automated Dependency Upgrades
Automatically fix and test dependency updates with socket fix—a new CLI tool that turns CVE alerts into safe, automated upgrades.
This is the official plugin for Layar in Apache Cordova/PhoneGap!
The Layar plugin for Apache Cordova allows you to use the JavaScript code in your Cordova application as you use in your web application to build an augmented reality app.
To use this plugin you will need to make sure you've registered with Layar and obtained your Layar Key and Layar Secret.
Callbacks are not supported in the plugin. With the plugin you can launch a scan view or open a layar but cannot get javascript callbacks about what is going on. To implement callbacks please use the iOS and Android SDK natively.
This plugin requires Cordova CLI.
To install the plugin in your app, execute the following (replace variables where necessary):
# Create initial Cordova app
$ cordova create myApp
$ cd myApp/
$ cordova platform add ios (For iOS)
$ cordova platform add android (For Android)
# Add the plugin
$ cordova -d plugin add <path-to-phonegap-layar-plugin>
Its that simple!
We have provided an example app with the plugin. You can just copy the javascript file index.js and the corresponding html file index.htmland use it in your example app. Please dont forget to replace your key and secret in the index.js file.
Optionally you can also automatically generate an example and run it using dart. Just run 'dart test/run-sample.dart <ios/android>' from the command line.
LayarPlugin.initialize(Layar Key, Layar Secret)
Initializes the layar plugin with a consumer key and secret
parameter (key) The oauth consumer key. Please contact layer support to obtain a license if you dont have one.
parameter (secret) The consumer secret. Please contact layer support to obtain a license if you dont have one.
return {Q.Promise} which you can use to implement success and failure callbacks.
For example:
LayarPlugin.initialize('asdasd;adiaspdiasdpa', 'asdasdasdasdadsasd'). then(Layar.success). fail(Layar.failure). done()
LayarPlugin.openScanView()
Opens the scan view.
return {Q.Promise} which you can use to implement success and failure callbacks.
For example:
LayarPlugin.openScanView(). then(Layar.success). fail(Layar.failure). done()
LayarPlugin.openURL(Layar URL)
Opens a layar view with a layar URL. Especially useful for opening geo layers
parameter (url) The URL to open. Example-> layar://carscen7g?param=value
return {Q.Promise} which you can use to implement success and failure callbacks.
For example:.
LayarPlugin.openURL('layar://carscen7g?param=value'). then(Layar.success). fail(Layar.failure). done()
LayarPlugin.openLayar(Layar Name)
Opens a layar view with a layar name. Especially useful for opening geo layers
parameter (layarname) The name of the layar to open. Example-> carscen7g
return {Q.Promise} which you can use to implement success and failure callbacks.
For example:
LayarPlugin.openLayar('carscen7g'). then(Layar.success). fail(Layar.failure). done()
FAQs
PhoneGap/Cordova plugin for Layar to create Augmented Reality Apps
The npm package Layar receives a total of 0 weekly downloads. As such, Layar popularity was classified as not popular.
We found that Layar demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Automatically fix and test dependency updates with socket fix—a new CLI tool that turns CVE alerts into safe, automated upgrades.
Security News
CISA denies CVE funding issues amid backlash over a new CVE foundation formed by board members, raising concerns about transparency and program governance.
Product
We’re excited to announce a powerful new capability in Socket: historical data and enhanced analytics.