getPref

Preferences

Returns the value of the specified preference.

$m.getPref("user_id");

Syntax

        $m.getPref(key, [global])

Parameters

key

string (required)

Key of the preference to be read.

global

boolean (optional)

True, if the preference being retrieved is a global preference. Default value is false.

Return Value

preference - {Object}.

The value of the preference name passed if it is available in the preferences.

Remarks

Preferences can be used to store app data that needs to persist across app restarts. By default, the preferences stored in a page are accessible in other pages provided if the pages belong to the same pack. In order to share preferences across packs, use the global parameter.