SDK Functions
onOpenApp(appId, cb)
appId (string): this will be the app unique name
cb (function): this function will be executed when the app is oppened
onCloseApp(appId, cb)
appId (string): this will be the app unique name
cb (function): this function will be executed when the app is closed
setContextMenu(buttons)
buttons (array): array of objects that contain the buttons information
title (string): the label of the button
color (string): the button text color
setPopUp(info)
info (object): element that contains all the information of the popup that will be created
title (string): this is the title of the popup
description (string-optional): this is the description of the popup
input (object-optional): these are the input html attributes
media (string-optional): this is an image or video URL
code (string-optional): this is a big text code
buttons (array): these are the buttons of the popup
title (string): the label of the button
color (string): the color of the button text
cb (function): when a button is clicked, this will be triggered
inputContent (string): this is an attribute that cb returns with the input value
fetchNui(fetchName, data, cb, scriptName)
fetchName (string): this is the name of the nui event
data (object): this is the object that is sent to the nui handler
cb (function): this will return the nui data
scriptName (string): this is the script name that you want the nui event
getSettings(cb)
cb (function): this will return the entire phone settings
getLocale(locale, cb)
locale (string): this is the name of the locale that you will get
cb (function): this will return the text in the user's language
selectGallery(info)
info (object): this is the object containing the information of the gallery created
includeImages (boolean): this will include or exclude images
includeVideos (boolean): this will include or exclude videos
limit (number): this is the limit of selections that the user can do
cb (function): this is will return the images selected by the user
useCamera(info)
info (object): this will be an object containing all the info regarding to the camera control
defaultConfig (object): this will be the starting settings of the camera
type (string): this is the type of media that the phone will take by default
flash (boolean): this is the default status of the flash
camera (string): this is the default starting camera
permissions (object): this will be the posibilities of the player inside the camera
toggleFlash (boolean): player can toggle flash
flipCamera (boolean): player can flip the camera
takePhoto (boolean): player can take photos
takeVideo (boolean): player can take videos
cb (string): this will return the media URL
onSettingsChange(cb)
cb (function): this will return the entire phone settings
isAppInstalled(appId)
appId (string): this is your app unique identifier
Last updated