LiManager Reference
Inherits From: NSObject
Declared In: LiManager.h
Overview
A class to handle fundamental Applicasa SDK and framework interactions, expose native datastore objects to your application, as well as provide access to the functionality and configuration values stored in LiConfig.
LiManager is used by the Applicasa frameworks, and developers will rarely, if ever, need to use these methods in their own applications.
Tasks
Datastore Setup and Handling
+
initDatabase
+
conflictFoundBetweenLocalItem:andServerItem:ofClass:
Checking Application Settings
+
getApplicationId
+
getSecretKey
Checking Behavior Settings
+
isPushEnabled
+
shouldConfirmPushOnStart
+
isDebugEnabled
+
isLocationEnabled
+
isOfflineEnabled
+
isSandboxEnabled
Checking SDK Settings
+
getSDKVersion
+
getFrameworkVersion
+
getSchemaDate
Class Methods
initDatabase
Class method used to initialize the local Applicasa sqlite database.
+
(void) initDatabase;
Discussion:
Class method used to initialize the local Applicasa sqlite database. This method creates a mirror of your application's remote data on a user's device, allowing you to perform local-only queries, as well as ensuring your application continues to operate properly in the absence of a network connection.
conflictFoundBetweenLocalItem:andServerItem:ofClass:
Handles conflict events between a local item and an item on the server of a particular class.
+
(void) conflictFoundBetweenLocalItem:(NSDictionary*)localItem andServerItem:(NSDictionary*)serverItem ofClass:(LiObjectClass)className;
Parameters:
localItem
An NSDictionary representing the local item in conflict.
serverItem
An NSDictionary representing the server item in conflict.
className
The class of objects in conflict.
Discussion:
This method will not be used directly by a developer. However, LiManager uses this method to post a notification to NSNotificationCenter whenever conflicts occur. Resulting notifications are named as [className]ConflictFoundNotification, along with an array containing localItem and serverItem that can be used to respond to conflicts as you wish. See Apple's NSNotificationCenter documentation for more details about responding to NSNotifications.
getSchemaDate
Returns the value of SCHEMA_DATE, as defined in LiConfig.
+
(int) getSchemaDate;
Return Value:
An integer value identifying the current version of your application’s schema.
Discussion:
Returns the value of SCHEMA_DATE, as defined in LiConfig.
getApplicationId
Returns the value of APPLICATION_ID, as defined in LiConfig.
+
(NSString*) getApplicationId;
Return Value:
An NSString containing your application’s Applicasa ID.
Discussion:
Returns the value of APPLICATION_ID, as defined in LiConfig..
getSecretKey
Returns the value of SECRET_KEY, as defined in LiConfig.
+
(NSString*) getSecretKey;
Return Value:
An NSString containing your application’s Applicasa secret key.
Discussion:
Returns the value of SECRET_KEY, as defined in LiConfig..
getSDKVersion
Returns the value of SDK_VERSION, as defined in LiConfig.
+
(float) getSDKVersion;
Return Value:
A float value identifying the current version of your application’s SDK.
Discussion:
Returns the value of SDK_VERSION, as defined in LiConfig.
getFrameworkVersion
Returns the value of FRAMEWORK_VERSION, as defined in LiConfig.
+
(float) getFrameworkVersion;
Return Value:
A float value identifying the current version of your application’s LiCore.framework.
Discussion:
Returns the value of FRAMEWORK_VERSION, as defined in LiConfig.
isPushEnabled
Returns the value of ENABLE_PUSH as defined in LiConfig.
+
(BOOL) isPushEnabled;
Return Value:
A boolean value indicating whether Push is enabled or disabled in your application.
Discussion:
Indicates whether your application has enabled/disabled Push notifications.
shouldConfirmPushOnStart
Returns the value of CONFIRM_PUSH_ON_START as defined in LiConfig.
+
(BOOL) shouldConfirmPushOnStart;
Return Value:
A boolean value indicating whether users should be asked to allow Push notifications.
Discussion:
Indicates whether Applicasa should trigger a UIAlertView to ask the user to allow/disallow Push notifications for your app. To allow Applicasa to ask a user for Push permission, simply set this value to YES. If value is NO, it is your responsibility to implement asking users for Push permissions.
isDebugEnabled
Returns the value of ENABLE_DEBUG as defined in LiConfig.
+
(BOOL) isDebugEnabled;
Return Value:
A boolean value indicating whether the Applicasa SDK's DEBUG mode is enabled or disabled in your application.
Discussion:
Indicates whether your application has enabled/disabled the DEBUG environment. Should be set to YES during development, and NO when app is published.
isLocationEnabled
Returns the value of ENABLE_LOCATION as defined in LiConfig.
+
(BOOL) isLocationEnabled;
Return Value:
A boolean value indicating whether location services are enabled or disabled.
Discussion:
Returns the value of ENABLE_LOCATION as defined in LiConfig, indicating whether location services are enabled or disabled.
isOfflineEnabled
Returns the value of ENABLE_OFFLINE as defined in LiConfig.
+
(BOOL) isOfflineEnabled;
Return Value:
A boolean value indicating whether your application has enabled/disabled the offline database functionality.
Discussion:
Indicates whether your application has enabled/disabled the offline database functionality. Should be set to YES if you want the local sqlite datastore, and NO otherwise.
isSandboxEnabled
Returns the value of ENABLE_SANDBOX as defined in LiConfig.
+
(BOOL) isSandboxEnabled;
Return Value:
A boolean value indicating whether the Applicasa SDK's sandbox is enabled or disabled in your application.
Discussion:
Indicates whether your application has enabled/disabled the sandbox environment. Should be set to YES during development, and NO when app is published.
NOTE: If you publish your app with ENABLE_SANDBOX still set to YES, your published application will be interacting with your development datastore. Be sure to alter this value when you submit your apps.