OMCMobileBackend Class Reference

Inherits from NSObject
Declared in OMCMobileBackend.h

Overview

A mobile backend object holds the settings that allow a service proxy to communicate with an MCS mobile backend.

Extends OMCMobileBackend with Notifications-specific methods.

Extends OMCMobileBackend with Location-specific methods.

Extends OMCMobileBackend with Synchronization-specific methods.

Extends OMCMobileBackend with Storage-specific methods.

Extends OMCMobileBackend with Analytics-specific methods.

Other Methods

  manager

The mobile backend’s manager.

@property (readonly, nonatomic) OMCMobileBackendManager *manager

Declared In

OMCMobileBackend.h

  name

The mobile backend’s name.

@property (readonly, nonatomic) NSString *name

Declared In

OMCMobileBackend.h

  applicationKey

The mobile backend’s application key, which is generated by the MCS portal, specified in the OMC property list file (OMC.plist), and passed as an HTTP header in every HTTP call to the MCS server.

@property (readonly, nonatomic) NSString *applicationKey

Declared In

OMCMobileBackend.h

  appConfig

The mobile backend’s application configuration. The application configuration will be empty until it is loaded.

@property (readonly) OMCAppConfig *appConfig

Declared In

OMCMobileBackend.h

  baseURL

The mobile backend’s base URL, upon which requests such as HTTP URLs are built. Typically, this URL is set via the OMC property list file (OMC.plist) and is in the form http://<host>:<port>.

@property (copy) NSURL *baseURL

Declared In

OMCMobileBackend.h

  path

The mobile backend’s path, which is appended to the baseURL to form the url. The default mobile backend path is OMCMobileBackendPathDefault.

@property (copy) NSString *path

Declared In

OMCMobileBackend.h

  url

The mobile backend’s URL, upon which requests such as HTTP URLs are built. This URL is built by appending the current path to the current baseURL.

@property (readonly) NSURL *url

Declared In

OMCMobileBackend.h

  platformPath

The mobile backend’s platform path, which is appended to the url to form the platformURL. The default platform path is OMCMobileBackendPlatformPathDefault.

@property (copy) NSString *platformPath

Declared In

OMCMobileBackend.h

  platformURL

The mobile backend’s platform URL, upon which requests such as HTTP URLs are built. This URL is built by appending the current platformPath to the current url.

@property (readonly) NSURL *platformURL

Declared In

OMCMobileBackend.h

  appConfigPath

The mobile backend’s application configuration path, which is appended to the platformURL to form the appConfigURL. The default application configuration path is OMCMobileBackendAppConfigPathDefault.

@property (copy) NSString *appConfigPath

Declared In

OMCMobileBackend.h

  appConfigURL

The mobile backend’s application configuration URL, upon which requests such as HTTP URLs are built. This URL is built by appending the current appConfigPath to the current platformURL.

@property (readonly) NSURL *appConfigURL

Declared In

OMCMobileBackend.h

  customCodePath

The mobile backend’s custom API path, which is appended to the url to form the customCodeURL. The default custom API path is OMCMobileBackendCustomCodePathDefault.

@property (copy) NSString *customCodePath

Declared In

OMCMobileBackend.h

  customCodeURL

The mobile backend’s custom API URL, upon which requests such as HTTP URLs are built. This URL is built by appending the current customCodePath to the current url.

@property (readonly) NSURL *customCodeURL

Declared In

OMCMobileBackend.h

  diagnostics

The mobile backend’s diagnostics.

@property (readonly, nonatomic) OMCDiagnostics *diagnostics

Declared In

OMCMobileBackend.h

  authorization

The mobile backend’s authorization.

@property (readonly, nonatomic) OMCAuthorization *authorization

Declared In

OMCMobileBackend.h

  customCodeClient

The mobile backend’s custom code client.

@property (readonly, nonatomic) OMCCustomCodeClient *customCodeClient

Declared In

OMCMobileBackend.h

  properties

The mobile backend’s properties, as specified by the OMC property list file (OMC.plist).

@property (readonly, nonatomic) NSDictionary<NSString*id> *properties

Declared In

OMCMobileBackend.h

– serviceProxyForClass:

Returns the receiver’s instance of the specified service proxy, if present. If the specified service proxy is not present, creates it via reflection and returns the new instance.

- (nullable OMCServiceProxy *)serviceProxyForClass:(Class)serviceProxyClass

Parameters

serviceProxyClass

The type of service proxy.

Discussion

Warning: Raises an NSInvalidArgumentException if serviceProxyClass is nil.

Declared In

OMCMobileBackend.h

– removeServiceProxy:

Removes the specified service proxy from the receiver.

- (void)removeServiceProxy:(OMCServiceProxy *)serviceProxy

Parameters

serviceProxy

The service proxy.

Discussion

Does nothing if the receiver does not contain serviceProxy.

Warning: Raises an NSInvalidArgumentException if serviceProxy is nil.

Declared In

OMCMobileBackend.h

– removeServiceProxyForClass:

Removes the receiver’s instance of the specified service proxy.

- (void)removeServiceProxyForClass:(Class)serviceProxyClass

Parameters

serviceProxyClass

The type of service proxy.

Discussion

Does nothing if the receiver does not contain the specified service proxy.

Warning: Raises an NSInvalidArgumentException if serviceProxyClass is nil.

Declared In

OMCMobileBackend.h

– appConfigWithCompletionHandler:

Loads the receiver’s application configuration asynchronously.

- (void)appConfigWithCompletionHandler:(OMCAppConfigCompletionBlock)completionHandler

Parameters

completionHandler

The completion block invoked when the application configuration is loaded or an error occurs.

Declared In

OMCMobileBackend.h

– urlRequestWithPath:

Returns a URL request configured with a URL with the specified path, relative to the mobile backend’s URL.

- (NSMutableURLRequest *)urlRequestWithPath:(nullable NSString *)relativePath

Parameters

relativePath

The return request’s URL path, relative to the mobile backend’s URL.

Discussion

The request will be configured with the appropriate MCS HTTP headers:

Declared In

OMCMobileBackend.h

– urlRequestWithPath:completionHandler:

Builds a URL request configured with a URL with the specified path, relative to the mobile backend’s URL.

- (void)urlRequestWithPath:(nullable NSString *)relativePath completionHandler:(OMCURLRequestCompletionBlock)completionHandler

Parameters

relativePath

The return request’s URL path, relative to the mobile backend’s URL.

completionHandler

The completion block invoked when the URL request is built or an error occurs.

Declared In

OMCMobileBackend.h

– platformURLRequestWithPath:

Returns a URL request configured with a URL with the specified path, relative to the mobile backend’s platform URL.

- (NSMutableURLRequest *)platformURLRequestWithPath:(nullable NSString *)relativePath

Parameters

relativePath

The return request’s URL path, relative to the mobile backend’s platform URL.

Discussion

The request will be configured with the appropriate MCS HTTP headers:

Declared In

OMCMobileBackend.h

– platformURLRequestWithPath:completionHandler:

Builds a URL request configured with a URL with the specified path, relative to the mobile backend’s platform URL.

- (void)platformURLRequestWithPath:(nullable NSString *)relativePath completionHandler:(OMCURLRequestCompletionBlock)completionHandler

Parameters

relativePath

The return request’s URL path, relative to the mobile backend’s platform URL.

completionHandler

The completion block invoked when the URL request is built or an error occurs.

Declared In

OMCMobileBackend.h

– customCodeURLRequestWithPath:

Returns a URL request configured with a URL with the specified path, relative to the mobile backend’s custom code URL.

- (NSMutableURLRequest *)customCodeURLRequestWithPath:(nullable NSString *)relativePath

Parameters

relativePath

The return request’s URL path, relative to the mobile backend’s custom code URL.

Discussion

The request will be configured with the appropriate MCS HTTP headers:

Declared In

OMCMobileBackend.h

– customCodeURLRequestWithPath:completionHandler:

Builds a URL request configured with a URL with the specified path, relative to the mobile backend’s custom code URL.

- (void)customCodeURLRequestWithPath:(nullable NSString *)relativePath completionHandler:(OMCURLRequestCompletionBlock)completionHandler

Parameters

relativePath

The return request’s URL path, relative to the mobile backend’s custom code URL.

completionHandler

The completion block invoked when the URL request is built or an error occurs.

Declared In

OMCMobileBackend.h

– appConfigURLRequestWithPath:

Returns an HTTP URL GET request configured with a URL with the specified path, relative to the mobile backend’s application configuration URL.

- (NSMutableURLRequest *)appConfigURLRequestWithPath:(nullable NSString *)relativePath

Parameters

relativePath

The return request’s URL path, relative to the mobile backend’s application configuration URL.

Discussion

The request will be configured with the appropriate MCS HTTP headers:

Declared In

OMCMobileBackend.h

– appConfigURLRequestWithPath:completionHandler:

Builds an HTTP URL GET request configured with a URL with the specified path, relative to the mobile backend’s application configuration URL.

- (void)appConfigURLRequestWithPath:(nullable NSString *)relativePath completionHandler:(OMCURLRequestCompletionBlock)completionHandler

Parameters

relativePath

The return request’s URL path, relative to the mobile backend’s application configuration URL.

completionHandler

The completion block invoked when the URL request is built or an error occurs.

Declared In

OMCMobileBackend.h

– setHTTPHeadersOnRequest:

Sets the receiver’s HTTP headers on the specified URL request. The headers will include the application key, authorization settings, and the diagnostics context state. Call this method to ensure that all the required MCS headers are included.

- (void)setHTTPHeadersOnRequest:(NSMutableURLRequest *)request

Parameters

request

A URL request.

Discussion

Warning: Raises an NSInvalidArgumentException if request is nil.

Declared In

OMCMobileBackend.h

– setHTTPHeadersOnRequest:completionHandler:

Sets the receiver’s HTTP headers on the specified URL request. The headers will include the application key, authorization settings, and the diagnostics context state. Call this method to ensure that all the required MCS headers are included.

- (void)setHTTPHeadersOnRequest:(NSMutableURLRequest *)request completionHandler:(OMCErrorCompletionBlock)completionHandler

Parameters

request

A URL request.

completionHandler

The completion block invoked once the mobile backend’s HTTP headers have been added to the URL request or an error occurs.

Discussion

Warning: Raises an NSInvalidArgumentException if request is nil.

Declared In

OMCMobileBackend.h

OMC_Notifications Methods

– notifications

Returns the receiver’s notifications service.

- (OMCNotifications *)notifications

Declared In

OMCMobileBackend+OMC_Notifications.h

– removeNotifications

Removes the receiver’s notifications service.

- (void)removeNotifications

Declared In

OMCMobileBackend+OMC_Notifications.h

OMC_Location Methods

– location

Returns the receiver’s location service.

- (OMCLocation *)location

Declared In

OMCMobileBackend+OMC_Location.h

– removeLocation

Removes the receiver’s location service.

- (void)removeLocation

Declared In

OMCMobileBackend+OMC_Location.h

OMC_Synchronization Methods

– synchronization

Returns the receiver’s synchronization service.

- (OMCSynchronization *)synchronization

Declared In

OMCMobileBackend+OMC_Synchronization.h

– removeSynchronization

Removes the receiver’s synchronization service.

- (void)removeSynchronization

Declared In

OMCMobileBackend+OMC_Synchronization.h

OMCStorage Methods

– storage

Returns the receiver’s storage service.

- (OMCStorage *)storage

Declared In

OMCMobileBackend+OMC_Storage.h

– removeStorage

Removes the receiver’s storage service.

- (void)removeStorage

Declared In

OMCMobileBackend+OMC_Storage.h

OMC_Analytics Methods

– analytics

Returns the receiver’s analytics service.

- (OMCAnalytics *)analytics

Declared In

OMCMobileBackend+OMC_Analytics.h

– removeAnalytics

Removes the receiver’s analytics service.

- (void)removeAnalytics

Declared In

OMCMobileBackend+OMC_Analytics.h