MCESdk Class Reference

Inherits from NSObject
Declared in MCESdk.h
MCESdk.m

Overview

The MCESdk class is the central integration point for the SDK as a whole.

Other Methods

+ sharedInstance

This method returns the singleton object of this class.

+ (instancetype)sharedInstance

Discussion

This method returns the singleton object of this class.

Declared In

MCESdk.h

– handleApplicationLaunch

Initialize SDK, must be called in either application delegate init or application:didFinishLaunchingWithOptions:.

- (void)handleApplicationLaunch

Discussion

Initialize SDK, must be called in either application delegate init or application:didFinishLaunchingWithOptions:.

This method loads configuration from MceConfig.json. Either this method or handleApplicationLaunch: must be called before any other SDK method is called.

Declared In

MCESdk.h

– handleApplicationLaunchWithConfig:

Initialize SDK, must be called in either application delegate init or application:didFinishLaunchingWithOptions:. Either this method or handleApplicationLaunch must be called before any other SDK method is called.

- (void)handleApplicationLaunchWithConfig:(NSDictionary *)config

Parameters

config

Configuration is passed in via config dictionary instead of being loaded from MceConfig.json.

Discussion

Initialize SDK, must be called in either application delegate init or application:didFinishLaunchingWithOptions:. Either this method or handleApplicationLaunch must be called before any other SDK method is called.

Declared In

MCESdk.h

– manualLocationInitialization

Manually initialize location services for SDK, requires location’s autoInitialize=FALSE MceConfig.json flag. This is used to delay location services initialization until desired.

- (void)manualLocationInitialization

Discussion

Manually initialize location services for SDK, requires location’s autoInitialize=FALSE MceConfig.json flag. This is used to delay location services initialization until desired.

Declared In

MCESdk.h

– gdprState

This property returns true in the case that the SDK has been reset via a GDPR request but has not yet re-registered with the server. This could be due to the “autoReinitialize” flag being set to false or there is no connectivity. If the “autoReinitialize” flag is set to false and this property returns true, you could present a dialog to the user to verify that they agree to anonymous data collection and execute the manualInitialization method to re-register with the server.

- (BOOL)gdprState

Discussion

This property returns true in the case that the SDK has been reset via a GDPR request but has not yet re-registered with the server. This could be due to the “autoReinitialize” flag being set to false or there is no connectivity. If the “autoReinitialize” flag is set to false and this property returns true, you could present a dialog to the user to verify that they agree to anonymous data collection and execute the manualInitialization method to re-register with the server.

Please note, this method is deprecated, please use MCERegistrationDetails.sharedInstance.userInvalidated instead.

Declared In

MCESdk.h

– invalidateExistingUser

This method will reset the current state of the SDK to the installed state. If the autoReinitialize configuration parameter is set to true, the system will register with the server and create a new anonymous user. If the autoReinitialize configuration parameter is set to false the system will not register with the server and the userId and channelId values will be nil until the manualInitialization method is called to begin the registration with the server.

- (BOOL)invalidateExistingUser

Discussion

This method will reset the current state of the SDK to the installed state. If the autoReinitialize configuration parameter is set to true, the system will register with the server and create a new anonymous user. If the autoReinitialize configuration parameter is set to false the system will not register with the server and the userId and channelId values will be nil until the manualInitialization method is called to begin the registration with the server.

Declared In

MCESdk-Private.h

– manualInitialization

Manually initialize SDK, is used to wait until an event occurs before beginning to interact with the Acoustic servers. For example, you might not want to create a userid/channelid until after a user logs into your system. Requires autoInitialize=FALSE MceConfig.json flag. This method may also be used if the autoReinitialize flag is set to false in the MceConfig.json file and the SDK is in the GDPR reset state.

- (void)manualInitialization

Discussion

Manually initialize SDK, is used to wait until an event occurs before beginning to interact with the Acoustic servers. For example, you might not want to create a userid/channelid until after a user logs into your system. Requires autoInitialize=FALSE MceConfig.json flag. This method may also be used if the autoReinitialize flag is set to false in the MceConfig.json file and the SDK is in the GDPR reset state.

Declared In

MCESdk.h

– sdkVersion

Get the current SDK Version number as a string.

- (NSString *)sdkVersion

Discussion

Get the current SDK Version number as a string.

Declared In

MCESdk.h

– deviceTokenRegistartionFailed

This method should be called if the application:didFailToRegisterForRemoteNotificationsWithError: method is called if manual integration is used.

- (void)deviceTokenRegistartionFailed

Discussion

This method should be called if the application:didFailToRegisterForRemoteNotificationsWithError: method is called if manual integration is used.

Declared In

MCESdk.h

– registerDeviceToken:

Register device token with Acoustic Push Notification servers

- (void)registerDeviceToken:(NSData *)deviceToken

Parameters

deviceToken

from APNS registration request in application delegate application:didRegisterForRemoteNotificationsWithDeviceToken:

Discussion

Register device token with Acoustic Push Notification servers

Declared In

MCESdk.h

– alertControllerClass

This property returns the current alert view controller class, it can be customized by the developer of the application.

- (Class)alertControllerClass

Discussion

This property returns the current alert view controller class, it can be customized by the developer of the application.

Declared In

MCESdk.h

– findCurrentViewController

This method walks through the view controller stack for the top view controller.

- (UIViewController *)findCurrentViewController

Discussion

This method walks through the view controller stack for the top view controller.

Declared In

MCESdk.h

– performNotificationAction:

Performs action defined in “notification-action” part of the payload.

- (void)performNotificationAction:(NSDictionary *)userInfo

Parameters

userInfo

push payload from APNS

Discussion

Performs action defined in “notification-action” part of the payload.

Declared In

MCESdk.h

– presentDynamicCategoryNotification:

Shows a dynamic category notification, integration point of the application delegate application:didReceiveRemoteNotification:fetchCompletionHandler: method.

- (void)presentDynamicCategoryNotification:(NSDictionary *)userInfo

Parameters

userInfo

passed from didReceiveRemoteNotification parameter of caller

Discussion

Shows a dynamic category notification, integration point of the application delegate application:didReceiveRemoteNotification:fetchCompletionHandler: method.

Declared In

MCESdk.h

– processDynamicCategoryNotification:identifier:userText:

Process specified dynamic category notification for local notifications, integration point of the application delegate application:handleActionWithIdentifier:forLocalNotification:completionHandler:

- (void)processDynamicCategoryNotification:(NSDictionary *)userInfo identifier:(NSString *)identifier userText:(NSString *)userText

Parameters

userInfo

notification.userInfo of the forLocalNotification parameter of the caller

identifier

the identifier parameter of the caller

Discussion

Process specified dynamic category notification for local notifications, integration point of the application delegate application:handleActionWithIdentifier:forLocalNotification:completionHandler:

Declared In

MCESdk.h

– processCategoryNotification:identifier:

Process specified dynamic category notification for remote notifications, integration point of the application delegate application:handleActionWithIdentifier:forRemoteNotification:completionHandler:

- (void)processCategoryNotification:(NSDictionary *)userInfo identifier:(NSString *)identifier

Parameters

userInfo

notification.userInfo of the forLocalNotification parameter of the caller

identifier

the identifier parameter of the caller

Discussion

Process specified dynamic category notification for remote notifications, integration point of the application delegate application:handleActionWithIdentifier:forRemoteNotification:completionHandler:

Declared In

MCESdk.h

Other Methods

  customAlertControllerClass

This property sets the current alert view controller class, it can be customized by the developer of the application.

@property Class customAlertControllerClass

Discussion

This property sets the current alert view controller class, it can be customized by the developer of the application.

Declared In

MCESdk.h

  presentNotification

This property can be used to override if a notification is delivered to the device when the app is running.

@property (copy) BOOL ( ^ ) ( NSDictionary *userInfo ) presentNotification

Discussion

This property can be used to override if a notification is delivered to the device when the app is running.

Declared In

MCESdk.h

  openSettingsForNotification

This method allows your app to respond to the open settings for notification request for notification quick settings *

@property (copy) void ( ^ ) ( UNNotification *notification ) ( ios ( 12.0 ) ) openSettingsForNotification

Discussion

This method allows your app to respond to the open settings for notification request for notification quick settings *

Declared In

MCESdk.h

Initialization

– extractAlert:

Extract the message string from the APS dictionary, including string vs dictionary structure and localization and format arguments.

- (NSString *)extractAlert:(NSDictionary *)aps

Parameters

aps

the aps dictionary of the APNS push payload

Discussion

Extract the message string from the APS dictionary, including string vs dictionary structure and localization and format arguments.

Declared In

MCESdk.h