AgentSDK.h

Includes:
<Foundation/Foundation.h>
<Cocoa/Cocoa.h>
<CoreLocation/CoreLocation.h>
<UIKit/UIKit.h>
"AgentSDKCertificate.h"

Introduction

Use the links in the table of contents to the left to access the documentation.



Classes

AgentLogEvent
AuthenticationData

Protocols

AgentSdkCoreProtocol


Methods

+acceptTermsAndConditions
+allowUnenroll
+appAwake_multideclaration_block
+authenticateClient:withType:
+connectToDS
+connectToDSManually
+connectToDSUsingAppConfig
+deRegisterDelegate:
+disconnect
+getAppCatalogLink
+getEnrollmentState
+getInstance
+getTermsAndConditionsAcceptedDate
+getTermsAndConditionsLink
+getTermsAndConditionStatus
+getUnverifiedDeploymentServerCertificate
+getUnverifiedDeploymentServerName
+isConfiguredWithDeploymentServer
+isConnected
+registerDelegate:
+rejectTermsAndConditions
+setAppCapability:
+setUserResponseToUnverifiedDeploymentServer:

acceptTermsAndConditions


- (void) acceptTermsAndConditions;  
Discussion

Called when the user accepts the current Terms and Conditions.

Availability
v11

allowUnenroll


- (BOOL) allowUnenroll;  
Return Value

A boolean value denoting whether or not un-enrollment is allowed.

Discussion

Returns whether the MobiControl administrator has allowed agent unenrollment using the "Advanced Settings > Agent Settings" policy. When un-enrollment is disabled the end user is not able to initiate un-enrollment from the "Device Configuration" screen of the MobiControl agent. An SDK-enabled App may wisht o link similar functionality to this setting. This setting does not prevent an end-user from removing the MobiControl Management Profile from the iOS Settings screen.

Availability
v12

appAwake_multideclaration_block


#ifdef MAC_LIBRARY 
- (void)appAwake;  
This method will be used by Mac for updating location from Mac Agent to Helper daemon */- (void)
    locationManagerdidUpdateLocations:(NSArray *)locations;  - (void)
    locationManagerdidFailWithError:(NSError *)error;   #else - (void) performBackgroundOperation:(void (^)(UIBackgroundFetchResult))completionHandler;  #endif   @@end
Discussion

iOS SDK could perform some operation(s) (location data collection) at the Background. Background Fetch is an API involved here and used by SDK. Background Fetch is controlled by an Application (all settings, API calls, etc.). A Client is obligated to implement "application: performFetchWithCompletionHandler:" method of the UIApplicationDelegate and delegate the call to the performBackgroundOperation. That's to allow SDK to perform backgroung operation(s). The operation takes about 3 seconds


authenticateClient:withType:


- (void)authenticateClient:(AuthenticationData *)authenticationData 
        withType:(AuthenticationType)authenticationType;  
Parameters
authenticationData

Contains data that is to be authenticated.

authenticationType

Contains type of authentication to be carried out.

Discussion

Authenticates client data using a specific authentication type. During a Deployment Server connection attempt ConnectionStatus may indicate a requirement for the SDK-enabled App to authenticate the connection, usually when the authentication token provided in the App Config has expired. If authentication is required the type of authentication will correspond to the Add Device Rule that was initially used for enrollment or, if not found, the default Add Device Rule.

Availability
v11

connectToDS


- (void) connectToDS;  
Discussion

Attempts to connect to the Deployment Server using the stored server address. A connection is automatically established when the application is brought to the foreground so this method need only be called if the connection is lost or intentionally disconnected. The delegate connectionStatusUpdate will be called upon completion.

Availability
v11

connectToDSManually


- (void) connectToDSManually;  
Discussion

Registers the delegate for this class. An object that adheres to the AgentSdkCoreProtocol.

Availability
v11

connectToDSUsingAppConfig


- (KAppConfigResults) connectToDSUsingAppConfig;  
Return Value

The App configuration result of the attempt.

Discussion

Gets and stores Deployment Server connection parameters provided by MobiControl, and attempts a connection to the Deployment Server. Requires that the App be installed by MobiControl's App Catalog as "Managed". See the "MobiControl SDK for iOS Integration Guide" for the configuration syntax and additional details.

Availability
v11

deRegisterDelegate:


- (void) deRegisterDelegate:(id<AgentSdkCoreProtocol>)delegate;  
Parameters
delegate

An object that adheres to the AgentSdkCoreProtocol.

Discussion

Deregisters the delegate from this class.

Availability
v11

disconnect


- (void) disconnect;  
Discussion

Disconnects from the Deployment Server.

Availability
v11

getAppCatalogLink


- (NSString *) getAppCatalogLink;  
Return Value

The URL to the Application Catalog.

Discussion

Gets the URL to the application catalog.

Availability
v11

getEnrollmentState


- (EnrollmentState) getEnrollmentState;  
Return Value

The current enrollment state of the SDK-enabled application. Will return either Enrolled, Enrolling or Required.

Discussion

Gets the current enrollment state of the SDK-enabled application.

Availability
v11

getInstance


+ (AgentSdkCore*) getInstance;  
Return Value

The AgentSdkCore singleton.

Discussion

Gets singleton of AgentSdkCore.

Availability
v11

getTermsAndConditionsAcceptedDate


- (NSDate *) getTermsAndConditionsAcceptedDate;  
Return Value

The date when Terms and Conditions were accepted.

Discussion

Gets the date when Terms and Conditions were accepted.

Availability
v11

getTermsAndConditionsLink


- (NSString *) getTermsAndConditionsLink;  
Return Value

The URL to the current Terms and Conditions.

Discussion

Gets the URL to the current the Terms and Conditions.

Availability
v11

getTermsAndConditionStatus


- (TermsAndConditionStatus) getTermsAndConditionStatus;  
Return Value

The status of the current Terms and Conditions.

Discussion

Gets the current status of the Terms and Conditions. If no Terms and Conditions exist, method will return nil.

Availability
v11

getUnverifiedDeploymentServerCertificate


- (AgentSdkCertificateInfo *) getUnverifiedDeploymentServerCertificate;  
Return Value

The unverified Deployment Server certificate.

Discussion

Gets the unverfied Deployment Server certificate in the event trust validation of the server failed.

Availability
v11

getUnverifiedDeploymentServerName


- (NSString *) getUnverifiedDeploymentServerName;  
Return Value

The unverified Deployment Server information.

Discussion

Get the unverified Deployment Server info (in response to a connectionStatusUpdate with status kConnectionStatusUnverified) in the event trust validation of the server failed.

Availability
v11

isConfiguredWithDeploymentServer


- (bool) isConfiguredWithDeploymentServer;  
Return Value

A Boolean value denoting whether or not the SDK-enabled App is configured with Deployment Server connection parameters.

Discussion

Checks if the SDK-enabled App is configured with Deployment Server connection parameters.

If return value is true, connectToDS will succeed. Otherwise, connectToDSUsingAppConfig should be called to obtain the connnection parameters.

Availability
v11

isConnected


- (BOOL) isConnected;  
Return Value

A Boolean value denoting whether or not the SDK-enabled App is connected to the Deployment Server.

Discussion

Checks if the SDK-enabled App is connected to the Deployment Server.

Availability
v11

registerDelegate:


- (void) registerDelegate:(id<AgentSdkCoreProtocol>)delegate;  
Parameters
delegate

An object that adheres to the AgentSdkCoreProtocol.

Discussion

Registers the delegate for this class.

Availability
v11

rejectTermsAndConditions


- (void) rejectTermsAndConditions;  
Discussion

Called when the user rejects the current Terms and Conditions.

Availability
v11

setAppCapability:


-(void)setAppCapability:(APP_CAPABILITIES)appCapability;  
Parameters
appCapability

The app's capabilities

Discussion

Used to set the application's required capabilities.

Availability
v13.4.0 MR8 or greater OR v14.1.4 or greater

setUserResponseToUnverifiedDeploymentServer:


- (void) setUserResponseToUnverifiedDeploymentServer:(BOOL)isDeploymentServerTrusted;  
Parameters
isDeploymentServerTrusted

A Boolean value denoting whether or not the Deployment Server is trusted.

Discussion

Saves the user response to an unverified Deployment Server connection (in response to a connectionStatusUpdate with status kConnectionStatusUnverified). Value is remembered for subsequent connection attempts.

Availability
v11

Typedefs

APP_CAPABILITIES
AuthenticationType
ConnectionStatus
EnrollmentState
EnrollmentStatus
kAppConfigResults
KAppConfigResults
RemoteViewStatus
TermsAndConditionStatus

APP_CAPABILITIES


typedef enum { 
    kAPP_CAPABILITIES_ALL = 0xFFFFFFFF, 
    kAPP_CAPABILITIES_REMOTEVIEW = 1, 
}APP_CAPABILITIES;  
Constants
kAPP_CAPABILITIES_ALL

All app capabilities are required

kAPP_CAPABILITIES_REMOTEVIEW

Only Remove View capability is required

Discussion

Type used to represent the app's required capabilities.


AuthenticationType


typedef enum { 
    kAuthenticationTypeSimple, 
    kAuthenticationTypeAD, 
    kAuthenticationTypeToken 
} AuthenticationType;  
Constants
kAuthenticationTypeSimple

Static password as defined in the corresponding Add Device Rule.

kAuthenticationTypeAD

Directory service (LDAP) credentials of the authenticating user as defined in the corresponding Add Device Rule.

Discussion

Type used to represent current enrollment authentication status.

Availability
v12

ConnectionStatus


typedef NSString* ConnectionStatus;  
Constants
kConnectionStatusOK

Predefined ConnectionStatus type denoting the SDK-enabled App is successfully connected.

kConnectionStatusFailed

Predefined ConnectionStatus type denoting the SDK-enabled App failed to connect to Deployment Server.

kConnectionStatusUnverified

Predefined ConnectionStatus type denoting the SDK-enabled App failed to verify the Deployment Server certificate and requires user to explicity trust and continue with the connection attempt.

kConnectionStatusUntrusted

Predefined ConnectionStatus type denoting SDK-enabled App failed to verify the Deployment Server certificate and will not proceed with the connection.

kConnectionStatusDisconnected

Predefined ConnectionStatus type denoting the SDK-enabled App is now disconnected.

kConnectionStatusRequireSimpleAuth

Predefined ConnectionStatus type denoting the SDK-enabled App requires Simple Authentication.

kConnectionStatusTokenFailureRequireSimpleAuth

Predefined ConnectionStatus type denoting SDK-enabled App agent requires Simple Authentication after token authentication failure.

kConnectionStatusRequireLoginAuth

Predefined ConnectionStatus type denoting SDK-enabled App agent requires Directory Services Authentication.

kConnectionStatusTokenFailureRequireADAuth

Predefined ConnectionStatus type denoting the SDK-enabled App requires Directory Service Authentication after token authentication failure.

kConnectionStatusFailedLoginAuth

Predefined ConnectionStatus type denoting Login Authentication failed.

Discussion

Represents the connection status between the SDK-enabled App and the Deployment Server as a result of connecting or disconnecting.

Availability
v11

EnrollmentState


Constants
kEnrollmentStateNotEnrolled

Device is not enrolled.

kEnrollmentStateEnrolling

Device is currently enrolling.

kEnrollmentStateEnrolled

Device is enrolled.

Discussion

Type used to represent current enrollment status.

Availability
v11

EnrollmentStatus


typedef NSString* EnrollmentStatus;  
Constants
kEnrollmentStatusEnrolled

Predefined EnrollmentStatus type denoting the SDK-enabled App is currently enrolled.

kEnrollmentStatusRequired

Predefined EnrollmentStatus type denoting the SDK-enabled App must enroll.

kEnrollmentStatusFailedOsVersion

Predefined EnrollmentStatus type denoting the OS version of the device is incompatible with the filters defined in the Add Device Rule.

kEnrollmentStatusInvalidId

Predefined EnrollmentStatus type denoting an invalid enrollment ID was specified.

kEnrollmentStatusValidId

Predefined EnrollmentStatus type denoting a valid enrollment ID was specified.

Discussion

Type used to represent current enrollment status that is always sent after connecting to Deployment Server.

Availability
v11

kAppConfigResults


Constants
KAppConfigDeviceLessThanIOS7

Device iOS version does not support App Config. The SDK-enabled App must be installed on iOS 7 and higher.

KAppConfigInitiationSuccess

Device connected successfully using App Config.

KAppConfigNotFound

Device's App Config was not found. The SDK-enabled might not have been installed via the MobiControl App Catalog, or the Configuration Command was not provided in the App Catalog entry.

kAppConfigUnknownError

Unknown error occurred with App Config.

kAppConfigUnknownState

Device's App Config has unknown State.

Discussion

Used to obtain Deployment Server connection parameters.

See Also

Availability
v11

KAppConfigResults


Constants
KAppConfigDeviceLessThanIOS7

Device iOS version does not support App Config. The SDK-enabled App must be installed on iOS 7 and higher.

KAppConfigInitiationSuccess

Device connected successfully using App Config.

KAppConfigNotFound

Device's App Config was not found. The SDK-enabled might not have been installed via the MobiControl App Catalog, or the Configuration Command was not provided in the App Catalog entry.

kAppConfigUnknownError

Unknown error occurred with App Config.

kAppConfigUnknownState

Device's App Config has unknown State.

Discussion

Used to obtain Deployment Server connection parameters.

See Also


RemoteViewStatus


typedef NSString* RemoteViewStatus;  
Constants
kRemoteViewStatusStarted

Predefined RemoteViewStatus type denoting remote view is started.

kRemoteViewStatusStopped

Predefined RemoteViewStatus type denoting remote view is stopped.

kRemoteViewStatusBroken

Predefined RemoteViewStatus type denoting remote view is broken.

Discussion

Type used to represent the remote view connection status as a result of connecting or disconnecting.

Availability
v11

TermsAndConditionStatus


typedef NSString* TermsAndConditionStatus;  
Constants
kTermsAndConditionsStatusPending

Predefined TermsAndConditionsStatus type denoting new pending Terms and Conditions have been sent by Deployment Server which need to be accepted or rejected.

kTermsAndConditionsStatusNotRequired

Predefined TermsAndConditionsStatus type denoting existing Terms and Conditions have been cancelled.

kTermsAndConditionsStatusAccepted

Predefined TermsAndConditionsStatus type denoting Terms and Conditions have been accepted.

kTermsAndConditionsStatusRejected

Predefined TermsAndConditionsStatus type denoting Terms and Conditions have been rejected.

Discussion

Info regarding what the Deployment Server is telling the SDK-enabled App to do about Terms and Conditions.

Availability
v11

Properties

appConfigAvailable

appConfigAvailable


@property (readonly,
    atomic) BOOL appConfigAvailable;  
Discussion

A Boolean value denoting the availability of the App Configuration.