Mobile API Reference  MicroStrategy 2019
<SecurityHandler> Protocol Reference

#import <SecurityHandler.h>

Instance Methods

(void) - initialize:
 
(UIWindow *_Nullable) - window
 
(void) - authorize
 
(void) - setDelegate:
 
(id< FileManager > _Nullable) - fileManager
 
(SecurityFramework- securityFramework
 
(BOOL- isAuthorized
 
(BOOL- authorizedWithURL:
 
(NSPersistentStoreCoordinator *_Nullable) - newPersistentStoreCoordinatorWithManagedObjectModel:
 
(NSPersistentStore *_Nullable) - addPersistentStoreToCoordinator:WithType:configuration:URL:options:error:
 
(BOOL- featureAvailable:
 
(void) - unAuthorizeOnBackground
 
(BOOL- shouldHideScreenContentsOnBackground
 
(BOOL- canHandleURL:
 
(BOOL- webViewShouldLoadDataUsingURL
 
(void) - updateSecurityPolicy:
 
(id< SecurityPolicyManager > _Nullable) - securityPolicyManager
 
(void) - openWithExternalApp:
 
(void) - applicationLaunchedWithURL
 
(BOOL- getApplicationLaunchedWithURL
 
(void) - applicationLaunchWithURLFailed
 
(BOOL- canPersistCertificate
 
(BOOL- isAuthorizationInProgress
 
(void) - setAuthorizationInProgress:
 
(BOOL- shouldHideCoverScreen
 
(BOOL- shouldThrowExceptionIfAccessedBeforeAuhtorization
 
(BOOL- requiresAuthorizationOnApplicationOfNewURL
 
(BOOL- isSecurityFrameworkURL:
 
(BOOL- handleSecurityFrameworkURL:fromApplication:
 
(void) - sendFileWithData:name:
 
(void) - mailto:
 
(void) - mailWithAttachmentByParameters:controller:delegate:shouldAutorotate:
 
(NSString *_Nullable) - titleForEmail:
 
(void) - cancelMailCompose
 
(BOOL- shouldLoadBakedInConfig
 
(void) - setLoadBakedInConfig:
 
(void) - setSupportLandscapeOnly:
 
(BOOL- canHandleNetworkAuthenticationChallenge:
 
(BOOL- handleNetworkAuthenticationChallenge:completionHandler:
 

Class Methods

(id< SecurityHandler > _Nullable) + securityHandler
 

Method Documentation

◆ addPersistentStoreToCoordinator:WithType:configuration:URL:options:error:()

- (NSPersistentStore* _Nullable) addPersistentStoreToCoordinator: (NSPersistentStoreCoordinator *_Nullable)  persistentCoordinator
WithType: (NSString *_Nullable)  storeType
configuration: (NSString *_Nullable)  configuration
URL: (NSURL *_Nullable)  storeURL
options: (NSDictionary *_Nullable)  options
error: (NSError *_Nullable *_Nullable)  error 

Returns the persistent store based on the current Security Framework. The API is a wrapper on the API addPersistentStoreWithType:configuration:URL:options:error: defined in the class NSPersistentStoreCoordinator

Parameters
objectModelthe objectModel
storeTypethe store type configuration the configuration
storeURLthe storeURL options the options
errorthe error
Returns
persistent store

◆ applicationLaunchedWithURL()

- (void) applicationLaunchedWithURL

◆ applicationLaunchWithURLFailed()

- (void) applicationLaunchWithURLFailed

◆ authorize()

- (void) authorize

Authorize using the current Security Framework

◆ authorizedWithURL:()

- (BOOL) authorizedWithURL: (NSString *_Nullable)  urlString

Returns whether the URL is authenticated. This is only used for Facebook app switch authentication, where we have to handle the URL from Facebook app or Safari. For other types of authentication, this method returns NO

Returns
authorizedByFacebook

◆ cancelMailCompose()

- (void) cancelMailCompose

◆ canHandleNetworkAuthenticationChallenge:()

- (BOOL) canHandleNetworkAuthenticationChallenge: (NSURLAuthenticationChallenge *_Nullable)  challenge

◆ canHandleURL:()

- (BOOL) canHandleURL: (NSURL *_Nullable)  url

◆ canPersistCertificate()

- (BOOL) canPersistCertificate

◆ featureAvailable:()

- (BOOL) featureAvailable: (MSTRFeature feature

Returns whether the feature is avialable with the current Security Framework. The enum for MSTRFeature are defined in Enums.h

Parameters
featurefeature
Returns
whether the feature is supported with the current security framework

◆ fileManager()

- (id<FileManager> _Nullable) fileManager

Returns the current fileManager

◆ getApplicationLaunchedWithURL()

- (BOOL) getApplicationLaunchedWithURL

◆ handleNetworkAuthenticationChallenge:completionHandler:()

- (BOOL) handleNetworkAuthenticationChallenge: (NSURLAuthenticationChallenge *_Nullable)  challenge
completionHandler: (void(^)(NSURLSessionAuthChallengeDisposition, NSURLCredential *_Nonnull))  completionHandler 

◆ handleSecurityFrameworkURL:fromApplication:()

- (BOOL) handleSecurityFrameworkURL: (NSURL *_Nullable)  url
fromApplication: (id)  sourceApplication 

◆ initialize:()

- (void) initialize: (NSArray *_Nullable)  parameters

Initialize the security framework with the paramters read from the property SecurityFramework in the Info.plist. The Info.plist has SecurityFramework property with the value in format "SecurityFramework&Application ID&MSTR Aplication Version"

Parameters
parametersthe paramters used for framework initialization

◆ isAuthorizationInProgress()

- (BOOL) isAuthorizationInProgress

◆ isAuthorized()

- (BOOL) isAuthorized

Returns whether the application has authorized with the current Security Framework

Returns
authorized

◆ isSecurityFrameworkURL:()

- (BOOL) isSecurityFrameworkURL: (NSURL *_Nullable)  url

◆ mailto:()

- (void) mailto: (NSURL *_Nullable)  url

Send mail to the url

◆ mailWithAttachmentByParameters:controller:delegate:shouldAutorotate:()

- (void) mailWithAttachmentByParameters: (NSDictionary *_Nonnull)  parameters
controller: (UIViewController *_Nonnull)  controller
delegate: (id< MFMailComposeViewControllerDelegate > _Nullable)  delegate
shouldAutorotate: (BOOL shouldAutorotate 

Send mail with attachment data

Parameters
parametersare used to create the MFMailComposeViewController: Key "attachment" is a NSData instance containing the contents of the attachment, it must not be nil. Key @"mimeType" is a NSString specifying the MIME type for the attachment, as specified by the IANA. It must not be nil. Key @"fileName" is a NSString specifying the intended filename for the attachment which is displayed below the attachment's icon if the attachment is not decoded when displayed. Must not be nil. Key @"subject" is a NSString specifying the message's Subject header. Key @"body" is a NSString containing the body contents of the email message. Key @"isHTML" is a NSString indicating if the body argument is to be interpreted as HTML content, @"true" for YES.
controlleris the UIViewController where the MFMailComposeViewController would be displayed on.
delegateis the mailComposeDelegate for the MFMailComposeViewController.
shouldAutorotateis a Boolean that controls whether the MFMailComposeViewController can be autorotated.

◆ newPersistentStoreCoordinatorWithManagedObjectModel:()

- (NSPersistentStoreCoordinator* _Nullable) newPersistentStoreCoordinatorWithManagedObjectModel: (NSManagedObjectModel *_Nullable)  objectModel

Returns the persistent store coordinator based on the current Security Frameowrk. This API is the wrapper on the API initWithManagedObjectModel: defined in the class NSPersistentStoreCoordinator

Parameters
objectModelthe objectModel
Returns
persistent store coordinator

◆ openWithExternalApp:()

- (void) openWithExternalApp: (NSString *_Nullable)  url

◆ requiresAuthorizationOnApplicationOfNewURL()

- (BOOL) requiresAuthorizationOnApplicationOfNewURL

◆ securityFramework()

- (SecurityFramework) securityFramework

Returns the current SecurityFramework enum which is defined in Enums.h

Returns
the securityFramework

◆ securityHandler()

+ (id<SecurityHandler> _Nullable) securityHandler

Returns the singleton secuirty handler for the current security framework

Returns
the security handle

◆ securityPolicyManager()

- (id<SecurityPolicyManager> _Nullable) securityPolicyManager

◆ sendFileWithData:name:()

- (void) sendFileWithData: (NSData *_Nonnull)  fileData
name: (NSString *_Nullable)  fileName 

◆ setAuthorizationInProgress:()

- (void) setAuthorizationInProgress: (BOOL authorizationInProgress

◆ setDelegate:()

- (void) setDelegate: (id< SecurityHandlerDelegate > _Nullable)  delegate

Set the delegate to recevie the SecurityHandler callback

Parameters
delegatethe delegate

◆ setLoadBakedInConfig:()

- (void) setLoadBakedInConfig: (BOOL loadBakedInConfig

◆ setSupportLandscapeOnly:()

- (void) setSupportLandscapeOnly: (BOOL value

◆ shouldHideCoverScreen()

- (BOOL) shouldHideCoverScreen

◆ shouldHideScreenContentsOnBackground()

- (BOOL) shouldHideScreenContentsOnBackground

Return whether the contents of the application should be covered when the application goes in background so that the contents are not shown when user launches the application again until the user authorizes

Returns
whether the contents needs to be covered

◆ shouldLoadBakedInConfig()

- (BOOL) shouldLoadBakedInConfig

◆ shouldThrowExceptionIfAccessedBeforeAuhtorization()

- (BOOL) shouldThrowExceptionIfAccessedBeforeAuhtorization

◆ titleForEmail:()

- (NSString * _Nullable) titleForEmail: (NSString *_Nullable)  originalString

Convert the original title to the correct title.

Parameters
originalStringthe original title
Returns
the correct title

◆ unAuthorizeOnBackground()

- (void) unAuthorizeOnBackground

Implement the method in case the framework needs to unauthorize the application when tha application goes in the background

◆ updateSecurityPolicy:()

- (void) updateSecurityPolicy: (SecurityPolicy *_Nullable)  securityPolicy

◆ webViewShouldLoadDataUsingURL()

- (BOOL) webViewShouldLoadDataUsingURL

◆ window()

- (UIWindow* _Nullable) window

Returns the current UIWindow for the application based on the Security Framework of the application

Parameters
UIWindowthe UIWindow