Class: MobileBackend

Class: MobileBackend

MobileBackend

Represents a mobile backend in Oracle Mobile Cloud Enterprise and provides access to all capabilities of the backend. Callers should use mcs's mobileBackend property...

Constructor

new MobileBackend()

Source:

Members

(readonly) analytics :Analytics

Returns the Analytics object that enables capture of mobile analytics events.
Type:
Source:

(readonly) appConfig :object

Returns an instance of the application configuration object. Callers can download the configuration from the service by invoking loadAppConfig().
Type:
  • object
Source:

(readonly) authorization :Authorization

Returns the Authorization object used to authorize a mobile user against Oracle Mobile Cloud Enterprise. Please use mcs#mobileBackend#setAuthenticationType to initialize this property.
Type:
Source:

(readonly) customCode :CustomCode

Returns the CustomCode object that enables calls to custom APIs.
Type:
Source:

(readonly) diagnostics :Diagnostics

Returns the Diagnostics object that enables end-end debugging across application and cloud.
Type:
Source:

(readonly) name :string

The name of the MobileBackend as read from the configuration.
Type:
  • string
Source:

(readonly) notifications :Notifications

Returns the Notifications object that provides notification capabilities.
Type:
Source:

(readonly) storage :Storage

Returns the Storage object that provides cloud-based object storage capabilities.
Type:
Source:

(readonly) synchronization :Synchronization

Returns the Synchronization object that provides caching and synchronization capabilities.
Type:
Source:

Methods

getCustomCodeUrl(path) → {string}

Constructs a full URL by prepending the prefix for custom API REST endpoints to the given endpoint path.
Parameters:
Name Type Description
path string The relative path of the endpoint following the platform prefix, i.e. {BaseUrl}/mobile/custom.
Source:
Returns:
The full URL.
Type
string

getHttpHeaders(headersopt) → {Headers}

Populates auth and diagnostics HTTP headers for making REST calls to a mobile backend.
Parameters:
Name Type Attributes Description
headers Headers <optional>
An optional object with which to populate with the headers.
Source:
Returns:
The headers parameter that is passed in. If not provided, a new object with the populated headers as properties of that object is created.
Type
Headers

getPlatformUrl(path) → {string}

Constructs a full URL by pre-pending the prefix for platform API REST endpoints to the given endpoint path.
Parameters:
Name Type Description
path string The relative path of the endpoint following the platform prefix, i.e. /mobile/platform.
Source:
Returns:
The full URL.
Type
string

loadAppConfig() → {Promise.<NetworkResponse>}

Downloads the configuration from the service. The AppConfig property will contain the downloaded configuration.
Source:
Returns:
Type
Promise.<NetworkResponse>

setAuthenticationType(type) → {Authorization}

Initialize and returns the Authorization object that provides authorization capabilities and access to user properties.
Parameters:
Name Type Description
type string For Basic authentication, you would specify "basic" to use the Basic Authentication security schema.
For OAuth authentication, you would specify "oauth" to use OAuth Authentication security schema.
Source:
Throws:
When unrecognized authentication type provided, this method will throw an Exception stating that the type of Authentication that you provided is not supported at this time.
Returns:
Type
Authorization
Examples

Example usage of mobileBackend.setAuthenticationType()

// Basic Authorization schema
mcs.mobileBackend.setAuthenticationType('basic');
// OAuth Authorization schema
mcs.mobileBackend.setAuthenticationType('oauth');