API Docs for: 2.6
Show:

plugin_rest_mobile Class

Module: plugins_rest
Parent Module: com_mobile_rest

REST plugin that provides mobile app functions through the following REST API:

POST requests

  1. mobile/push_notifications

mobile/push_notifications

Enable/disable push notifications for a mobile device. The request must contain the following parameters:

  • token: the mobile device token identifier
  • type: ("ionic") the type of the mobile application
  • enable: ("true" | "false") if to enable/disable notifications
  • [lang]: ("en" | "it") the language of mobile application

Example JSON request parameters:

{ "token": "xyz", "type": "ionic", "enable": "true" }
{ "token": "xyz", "type": "ionic", "enable": "true", "lang": "en" }

Methods

push_notifications

(
  • req
  • res
  • next
)

Enable/disable push notifications for a mobile device with the following REST API:

push_notifications

Parameters:

  • req Object

    The client request

  • res Object

    The client response

  • next Function

    Function to run the next handler in the chain.

setCompMobile

(
  • comp
)

Sets the mobile architect component.

Parameters:

  • comp Object

    The mobile architect component.

setCompUtil

(
  • comp
)

Sets the utility architect component.

Parameters:

  • comp Object

    The utility architect component.

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.

Properties

compMobile

Object private

The mobile architect component used for mobile functions.

compUtil

Object private

The utility architect component.

IDLOG

String private final

The module identifier used by the logger.

Default: [plugins_rest/mobile]

logger

Object private

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

Default: console

post

Array

REST API to be requested using HTTP POST request.

Sub-properties:

  • push_notifications String

    To enable/disable push notifications for a mobile device