↳ Profile

AirConsole

new AirConsole(opts) → {AirConsoleObject}

Your gateway object to AirConsole. There are getter and setter functions for all properties. Do not access properties of this object directly.
Parameters:
Name Type Description
opts AirConsole~Config Constructor config, see bellow.
Source:
Returns:
The AirConsole object.
Type
AirConsoleObject

Methods

editProfile()

Lets the user change his nickname, profile picture and email address. If you need a real nickname of the user, use this function. onDeviceProfileChange will be called if the user logs in.
Source:

getNickname(device_id) → {string|undefined}

Returns the nickname of a user.
Parameters:
Name Type Description
device_id number | undefined The device id for which you want the nickname. Default is this device. Screens don't have nicknames.
Source:
Returns:
Type
string | undefined

getProfilePicture(device_id_or_uid, size) → {string|undefined}

Returns the url to a profile picture of the user.
Parameters:
Name Type Description
device_id_or_uid number | string | undefined The device id or uid for which you want the profile picture. Default is the current user. Screens don't have profile pictures.
size number | undefined The size of in pixels of the picture. Default is 64.
Source:
Returns:
Type
string | undefined

getUID(device_id) → {string|undefined}

Returns the globally unique id of a device.
Parameters:
Name Type Description
device_id number | undefined The device id for which you want the uid. Default is this device.
Source:
Returns:
Type
string | undefined

isUserLoggedIn(device_id) → {boolean}

Returns true if a user is logged in.
Parameters:
Name Type Description
device_id number | undefined The device_id of the user. Default is this device.
Source:
Returns:
Type
boolean

(abstract) onDeviceProfileChange(device_id)

Gets called when a device updates it's profile pic, nickname or email.
Parameters:
Name Type Description
device_id number The device_id that changed its profile.
Source:

(abstract) onEmailAddress(email_address)

Gets called if the request of requestEmailAddress() was granted. For privacy reasons, you need to whitelist your game in order to receive the email address of the user. To whitelist your game, contact developers@airconsole.com. For development purposes, localhost is always allowed.
Parameters:
Name Type Description
email_address string | undefined The email address of the user if it was set.
Source:

requestEmailAddress()

Requests the email address of this device and calls onEmailAddress iff the request was granted. For privacy reasons, you need to whitelist your game in order to receive the email address of the user. To whitelist your game, contact developers@airconsole.com. For development purposes, localhost is always allowed.
Source: