Class: PixLive

PixLive

new PixLive()

cordova-plugin-PixLive based class

Use cordova.plugins.PixLive to access the static methods. The instance methods need to be called on the PixLive instances returned by the createARView method, if you do not called the instance methods when it is needed problems will occur.

Your app need to be linked with your PixLive Maker account http://pixlivemaker.com.

To do so you need to register your app in the PixLive SDK->My Applications section and use a valid account license (PixLive SDK->My license) when you install the plugin.

Glossary:

  • context : A context can be an image or a beacon.
  • content: A content displayed when a context is trigger.
Source:

Classes

Context
GPSPoint

Methods

(static) addBookmark(contextId)

Adds the contextId to the list of bookmarked content.
Parameters:
Name Type Description
contextId string id of the context
Source:

(static) computeDistanceBetweenGPSPoints(lat1, lon1, lat2, lon2, success(list), error)

The callback success is called with the distance
Parameters:
Name Type Description
lat1 Number latitude of point 1
lon1 Number longitude of point 1
lat2 Number latitude of point 2
lon2 Number longitude of point 2
success(list) callback success callback with distance
error callback error callback
Source:

(static) createARView(originx, originy, width, height) → {PixLive}

Create a new AR View. Use it only once per ARView.
Parameters:
Name Type Description
originx integer The x origin of the AR view in pxl
originy integer The y origin of the AR view in pxl
width integer The width of the AR view in pxl
height integer The height of the AR view in pxl
Source:
Returns:
- the PixLive instance related to this AR view
Type
PixLive

(static) getBookmarks(success(list), error)

Returns the list of contexts that have been bookmarked.
Parameters:
Name Type Description
success(list) callback success callback with the list of bookmarked contexts as parameter
error callback error callback
Source:

(static) getContext(contextId, success(list), error)

Get the context (need to have been synchronized) with the corresponding contextId. A context can be an image or a beacon
Parameters:
Name Type Description
contextId string id of the context
success(list) callback success callback with the list of contexts as parameter
error callback error callback
Source:

(static) getContexts(success(list), error)

Get all the contexts that have been synchronized. A context can be an image or a beacon
Parameters:
Name Type Description
success(list) callback success callback with the list of contexts as parameter
error callback error callback
Source:

(static) getGPSPointsInBoundingBox(latitude, longitude, latitude, longitude, success(list), error)

Returns the list of GPS points in the bounding box specified by its lower left and uper right corner
Parameters:
Name Type Description
latitude Number of the lower left corner
longitude Number of the lower left corner
latitude Number of the uper right corner
longitude Number of the uper right corner
success(list) callback success callback with the list of GPSPoint
error callback error callback
Source:

(static) getNearbyBeacons(success(list), error)

Returns the list of contexts linked to nearby beacons
Parameters:
Name Type Description
success(list) callback success callback with the list of contexts
error callback error callback
Source:

(static) getNearbyGPSPoints(myLat, myLon, success(list), error)

Returns the list of nearby GPS points
Parameters:
Name Type Description
myLat Number current latitude
myLon Number current longitude
success(list) callback success callback with the list of GPSPoint
error callback error callback
Source:

(static) isBookmarked(contextId, success, error)

The callback success is called with true or false depending if the context ID is bookmarked or not.
Parameters:
Name Type Description
contextId string id of the context
success callback success callback
error callback error callback
Source:

(static) isContainingGPSPoints(success(list), error)

The callback success is called with true or false depending if the app is containing GPS points or not
Parameters:
Name Type Description
success(list) callback success callback with distance
error callback error callback
Source:

(static) openURLInInternalBrowser(url)

Will open an url with the PixLive SDK internal browser
Parameters:
Name Type Description
url string The url
Source:

(static) presentNearbyList(latitude, longitude)

Will show the list of "nearby" contents. It can be either geolocalized points (GPS points) or beacons. If called with the coordinates (0, 0), a loading wheel (progress bar) will be displayed for indicating that the position is being acquired. The list can then be reloaded by calling the function PixLive.refreshNearbyList.
Parameters:
Name Type Description
latitude float the current latitude
longitude float the current longitude
Source:

(static) presentNotificationsList(success, error)

Will show the list of beacons notifications previously received
Parameters:
Name Type Description
success callback success callback
error callback error callback
Source:

(static) refreshNearbyList(latitude, longitude)

If the list displaying the nearby GPS point is displayed, calling this function will reload the nearby elements according to the new given coordinate. The beacon list will be refreshed as well.
Parameters:
Name Type Description
latitude float the current latitude
longitude float the current longitude
Source:

(static) removeBookmark(contextId)

Removes the contextId from the list of bookmarked content.
Parameters:
Name Type Description
contextId string id of the context
Source:

(static) setBookmarkSupport(enabled)

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.
Parameters:
Name Type Description
enabled boolean true to enable, false to disable
Source:

(static) setNotificationsSupport(enabled, apiKey)

Activate the notifactions support
Parameters:
Name Type Description
enabled boolean true to enable, false to disable
apiKey string Google APIs project number for android app
Source:

(static) synchronize(tags, success, error)

Synchronize the app with the linked PixLive Maker account http://pixlivemaker.com
Parameters:
Name Type Description
tags Array.<string> An array of tags to synchronize with (can be left empty) example:
  • [] if you do not want to use tags, all the contexts from the linked PixLive Maker account will be synchronized
  • ['tag1','tag2'] to synchronize with the contexts that are tagged with tag1 or tag2
  • [['tag1','tag2'], 'tag3'] to synchronize with the contexts that are tagged with (tag1 and tag2) or tag3
Specific languages can be attributated to PixLive Maker content, to synchronize your app with a specific language use the tag: 'lang_{{iso_code_of_the_language}}' for example:
  • ['lang_fr'] to sychronize with all the french contents
  • [['tag1','lang_en'], ['tag2','lang_en']] to synronize with the english contents tagged with tag1 or tag2
success callback success callback
error callback error callback
Source:

afterEnter()

Need to be called after enter an arView.
Source:

afterLeave()

Need to be called after leaving an arView
Source:

beforeEnter()

Need to be called before enter an arView.
Source:

beforeLeave()

Need to be called before leaving an arView
Source:

destroy()

Destroy the Ar view
Source:

disableTouch()

disable PixLive SDK to catch the touch event when a content is displayed
Source:

enableTouch()

enable PixLive SDK to catch the touch event when a content is displayed
Source:

resize()

Need to be called when the screen if resized ("orientationchange" window event)
Source: