API Docs for: 2.6
Show:

mobile Class

Module: mobile

Provides the mobile functionalities.

Methods

ionicPushReqCb

(
  • res
)

The callback of the https post request to ionic push notification service.

Parameters:

  • res Object

    The https reponse

ionicPushReqErrorCb

(
  • error
)

The callback of the https post request to ionic push notification service called in error case.

Parameters:

  • error Object

    The error

sendNewPostitNotification

(
  • username
)

Sends a new post-it notification to all mobile apps of the user.

Parameters:

  • username String

    The name of the user to notify

sendNotification

(
  • username
  • msgToI18n
)
private

Sends a notification to all mobile apps of the user. The choise to not receive notifications has to be managed by the device itself.

Parameters:

  • username String

    The name of the user to notify

  • msgToI18n String

    The notification message to be translated before sending

setCompUser

(
  • comp
)

Set the module to be used for user functionalities.

Parameters:

  • comp Object

    The user module.

setLogger

(
  • log
)
static

Set the logger to be used.

Parameters:

  • log Object

    The logger object. It must have at least three methods: info, warn and error as console object.

setPushNotifications

(
  • token
  • appType
  • lang
  • enable
  • username
)
Boolean

Enable/disable push notifications for a mobile device

Parameters:

  • token String

    The device token identifier

  • appType String

    The type of the application (e.g. "ionic")

  • lang String

    The mobile application language

  • enable String

    True/false to enable/disable notifications

  • username String

    The name of the user

Returns:

Boolean:

True if the execution was successful

Properties

compUser

Object private

The user module.

deviceTokens

Object private

The tokens of mobile devices apps logged into the cti. The keys are usernames and the values are objects. Each value object has application types as keys (for example "ionic") and another object as values. This last object contains device tokens as object keys and the language as its value.

Default: {}

IDLOG

String private final

The module identifier used by the logger.

Default: [mobile]

logger

Object private

The logger. It must have at least three methods: info, warn and error.

Default: console