Since

0.1

Data is an interface for storing key data on Device like user information, login data or token.

Example

import Data from '@smartface/native/data';

Data.setStringVariable('userName','Smartface');
Data.setStringVariable('userEmail','info@smartface.io');
Data.setIntVariable('userAge',5);
Data.setBooleanVariable('userLogged',true);

// get values from Data
let userName = Data.getStringVariable('userName');
let userEmail = Data.getStringVariable('userEmail');

Hierarchy

  • IData

Methods

  • Get stored string type variable. If variable is not exists, will return null.

    Method

    getStringVariable

    Returns

    Android

    Ios

    Since

    0.1

    Parameters

    • key: string

    Returns null | string

  • Get stored boolean type variable. If variable is not exists, will return null.

    Method

    getBooleanVariable

    Returns

    Android

    Ios

    Since

    0.1

    Parameters

    • key: string

    Returns null | boolean

  • Get stored integer type variable. If variable is not exists, will return null

    Method

    getIntVariable

    Returns

    Android

    Ios

    Since

    0.1

    Parameters

    • key: string

    Returns null | number

  • Get stored float type variable. If variable is not exists, will return null

    Method

    getFloatVariable

    Returns

    Android

    Ios

    Since

    0.1

    Parameters

    • key: string

    Returns null | number

  • Get stored long type variable. If variable is not exists, will return null

    Method

    getLongVariable

    Returns

    Android

    Ios

    Since

    0.1

    Parameters

    • key: string

    Returns null | number

  • Store string type variable

    Method

    setStringVariable

    Android

    Ios

    Since

    0.1

    Parameters

    • key: string
    • value: string

    Returns void

  • Store boolean type variable

    Method

    setBooleanVariable

    Android

    Ios

    Since

    0.1

    Parameters

    • key: string
    • value: boolean

    Returns void

  • Store integer type variable

    Method

    setIntVariable

    Android

    Ios

    Since

    0.1

    Parameters

    • key: string
    • value: number

    Returns void

  • Store float type variable

    Method

    setFloatVariable

    Android

    Ios

    Since

    0.1

    Parameters

    • key: string
    • value: number

    Returns void

  • Store long type variable

    Method

    setLongVariable

    Android

    Ios

    Since

    0.1

    Parameters

    • key: string
    • value: number

    Returns void

  • Check variable exist within storaged variables.

    Method

    containsVariable

    Returns

    Android

    Ios

    Since

    0.1

    Parameters

    • key: string

    Returns boolean

  • Remove variable.

    Method

    removeVariable

    Android

    Ios

    Since

    0.1

    Parameters

    • key: string

    Returns void

  • Removes all variables from storage regardless of their types

    Method

    removeAllVariables

    Android

    Ios

    Since

    0.1

    Returns void

Generated using TypeDoc