Mobile API Reference
MicroStrategy 2019
|
#import <MSIGeneric.h>
It is a utility class which provides convienent methods to be used.
+ (BOOL) addSkipBackupAttributeToItemAtURL: | (NSURL *) | URL |
Set file attribute to skip backup attribute
URL | Path of the file |
+ (NSString *) apiVersion |
This is the version number of the MicroStrategy API. This is independent of the app version (though for OOTB MSTR Mobile it will be the same), and is generally used for version comparison.
+ (CGRect) applicationFrame |
+ (UIInterfaceOrientation) applicationInterfaceOrientation |
+ (UINavigationController*) applicationNavigationController |
Get the root navigation controller. The Application Delegate should extends from MSIAppDelegate and set a navigation controller to it when a navigation controller is created for this application.
+ (UIViewController*) applicationTopModalViewController |
+ (UIWindow*) applicationWindow |
Get the application window The Application Delegate should extends from MSIAppDelegate to get the window.
+ (NSString*) appName |
+ (NSInteger) authenticationModeForString: | (NSString *) | _authMode |
Convert the authentication mode text to enum value.
_authMode | project authentication mode text |
+ (NSString*) binaryFlag1Info: | (int) | flag1 |
Binary request flags detailed info
+ (NSString*) binaryFlag2Info: | (unsigned) | flag2 |
+ (NSBundle *) bundleNamed: | (NSString *) | bundleName |
Get the bundle from resouce by the bundle name
bundleName | bundle name |
+ (NSCharacterSet *) characterSetWithEscapeCharacters: | (NSString *) | string |
Get all the allowed characters set from escape string for replacing deprecated CFURLCreateStringByAddingPercentEscapes with stringByAddingPercentEncodingWithAllowedCharacters get the characters set for the escape characters
+ (UIButton *) createStdButtonWithTitle: | (NSString *) | title | |
backgroundImage: | (UIImage *) | image | |
target: | (id) | target | |
action: | (SEL) | action | |
return iOS standard barbutton-like button with stretchable background image
title | is the title shown on button |
image | is the background image |
target | is the control target |
action | is the action when button is pressed |
+ (NSString *) currentNetworkID |
+ (void) displayErrorInAlertViewWithTitle: | (NSString *) | title | |
message: | (NSString *) | message | |
delegate: | (id) | delegate | |
dismissPrevious: | (BOOL) | dismiss | |
withOtherButton: | (BOOL) | otherButton | |
okButtonTitle: | (NSString *) | okButtonTitle | |
otherButtonTitle: | (NSString *) | otherButtonTitle | |
+ (BOOL) enableTemplateMultiSelection |
+ (UILabel*) errorLabelForDesc: | (NSString *) | errorDesc | |
containingViewFrame: | (CGRect) | viewFrame | |
Creates an error label with the specified string. The containingViewFrame should provide the size of the view which this label will be added to.
errorDesc | error string displayed in the label |
viewFrame | label frame |
+ (MSTRError*) errorWithErrorDetails: | (NSString *) | details |
Utility method to construct an error object from an error string
details | error message for the error details |
+ (NSBundle *) finalBundle |
Get the bundle of name "FinalBundle" in resource
+ (CGFloat) floatFromDict: | (NSDictionary *) | dictionary | |
Key: | (NSString *) | key | |
Returns the float value of the object associated with the key. If not exists returns NSNotFound converted to float
dictionary | dictionary created from connect info plist file |
key | key |
+ (UIImage *) generateScreenShotAboveiOS7: | (CGFloat) | offset |
return screen shot on iOS7 above system
+ (NSString *) getApplicationUID |
Get the UID of this application. It's a string of length 40. The UID is created when it's accessed for the first time and saved to key chain. It will be retrieved from key chain when it's accessed again. It's used to replace the iOS UDID since it's deprecated.
+ (NSCalendar*) getAutoupdatingCurrentCalendar |
Get the autoupdatingCurrentCalendar witch concurrent with iPad/iPhone -> Settings->General->Region/Language. By wenzhou, 12/15/2015. US31530. Locale of this calendar is set to the application's locale if it exists.
+ (NSString*) getBaseURL: | (WebServerConfiguration *) | webserverConfig |
Get the base url of a WebServerConfiguration The URL is composed of request type, server name, port and path, example : http://123.43.43.43:8080/MicroStrategyMobile
webserverConfig | WebServerConfiguration |
+ (NSString*) getBaseURL: | (MSIProjectInfo *) | aProject | |
task: | (BOOL) | task | |
Get the base url of a ProjectInfo and task The URL is composed of request type, server name, port, path, servlet. If it's a task URL, it contains the task name. example, http://123.43.43.43:8080/MicroStrategyMobile/servlet/mstrWeb? if it't not a task http://123.43.43.43:8080/MicroStrategyMobile/servlet/mobile?action=executeTask&taskParams= if it's a task
aProject | project info used to get the WebServerConfiguration |
task | whether it's a task URL |
+ (NSString*) getBaseURLByProjectConfig: | (MSIProjectInfo *) | projectInfo |
Get the base url of a ProjectInfo The URL is composed of request type, server name, port and path, example : http://123.43.43.43:8080/MicroStrategyMobile
projectInfo | ProjectInfo to get the WebServerConfiguration |
+ (NSString*) getBaseURLByWebServerConfig: | (WebServerConfiguration *) | webserverConfig |
Get the base url of a WebServerConfiguration The URL is composed of request type, server name, port and path, example : http://123.43.43.43:8080/MicroStrategyMobile
webserverConfig | WebServerConfiguration |
+ (NSCalendar*) getCalendar |
Get Gregorian Calendar. Locale of this calendar is set to the application's locale if it exists.
+ (MSICertificateManager *) getCertificateManager |
Returns the certificate manager
+ (NSURL*) getCompleteURL: | (NSString *) | iURL | |
withBaseURL: | (NSString *) | iBaseURL | |
return completeURL after encoding
iURL | resource URL |
iBaseURL | base URL of the mobile server |
+ (NSURL*) getCompleteURL: | (NSString *) | iURL | |
withBaseURL: | (NSString *) | iBaseURL | |
urlEncodeAbsoluteUrl: | (BOOL) | urlencode | |
return completeURL after encoding
iURL | resource URL |
iBaseURL | base URL of the mobile server |
urlEncodedd |
+ (NSString*) getCurrentDate |
Get string representation of the current date
+ (NSString*) getCurrentTime |
Get string representation of the current time
+ (NSString*) getDeviceID |
return deviceID
+ (DeviceType) getDeviceType |
Check the device type, it can be either iPhone or iPad
+ (NSString*) getEncryptionKey |
+ (NSString*) getLaunchImageName: | (UIInterfaceOrientation) | interfaceOrientation |
return the launch image name for the device
interfaceOrientation | The device orientation |
+ (NSString*) getLockImageName: | (UIInterfaceOrientation) | interfaceOrientation |
return the lock image name for touch id security
interfaceOrientation | The device orientation |
+ (MSIAppContext*) getMSTRAppContext |
Returns the global application context object
+ (NSLocale*) getNumberAndDateLocale |
Get the locale of this application, if it doesn't have locale, get the current locale
+ (DisplayObject*) getRootFolderDisplayObject: | (MSIProjectInfo *) | projInfo |
Get the root folder display object for a project. This information is stored in device preferences. The folder object will be opened when the project is opened.
projInfo | project to be found |
+ (SDKEnvSettings*) getSDKEnvSettings |
Get SDK environment settigs
+ (NSString * _Nonnull) getSecureDocumentErrorMessage: | (int) | errorStatus | |
authenticationMethod: | (int) | authenticationMode | |
+ (NSString*) getServletPath: | (WebServerConfiguration *) | webserverConfig |
Gets the servlet path of a WebServerConfiguration The URL is composed of request type, server name, port, path and server type. example : http://123.43.43.43:8080/MicroStrategyMobile/servlet/ (J2EE) http://123.43.43.43:8080/MicroStrategyMobile/asp/ (ASP)
webserverConfig | WebServerConfiguration |
+ (NSString*) getServletPathByProjectConfig: | (MSIProjectInfo *) | projectInfo |
Gets the servlet path for a project info. The URL is composed of request type, server name, port, path and server type. example : http://123.43.43.43:8080/MicroStrategyMobile/servlet/ (J2EE) http://123.43.43.43:8080/MicroStrategyMobile/asp/ (ASP)
projectInfo | ProjectInfo to get the WebServerConfiguration |
+ (NSLocale*) getSystemNumberLocale |
Get the number locale of system, if it doesn't have locale, get the current locale
+ (NSString*) getURLEscapeCharacters |
Get all the URL escape characters
+ (NSString*) getURLEscapeCharactersForImagePaths |
Get all the URL escape characters for Image Path
+ (NSTimeInterval) gmtToCurrentTimezone: | (NSTimeInterval) | gmtTime |
Convert GMT time to the time in current timezone
gmtTime | GMT time |
+ (void) hideCoverScreen |
+ (UIImage*) imageWithColor: | (UIColor *) | color |
+ (UIImage*) imageWithView: | (UIView *) | view |
+ (NSUInteger) incrementalFetchSize |
Get the incremental fetch size It is used to determine the grid rows to be fetch one time.
+ (NSInteger) intFromDict: | (NSDictionary *) | dictionary | |
Key: | (NSString *) | key | |
Returns the int value of the object associated with the key. If not exists returns NSNotFound
dictionary | dictionary created from connect info plist file |
key | key |
+ (BOOL) iOS4Device |
Check whether the device installs iOS4 and above
+ (BOOL) iOS5OrHigher |
return if current device's iOS version is 5.0 or higher
+ (BOOL) iOS7OrHigher |
return if current device's iOS version is 7.0 or higher
+ (BOOL) iOS8OrHigher |
return if current device's iOS version is 8.0 or higher
+ (BOOL) iOS9OrHigher |
return if current device's iOS version is 9.0 or higher
+ (NSInteger) iOSMainVersion |
Get the iOS Main version number
+ (BOOL) is4inchScreen |
If current device is using 4-inch screen, like iPhone5, iPhone 5s
+ (BOOL) isAbsoluteURL: | (NSString *) | url |
Determine whether a url string contains "HTTP" or "HTTPS"
url | url string |
+ (BOOL) isBackgroundTransferEnabled |
+ (BOOL) isDataURL: | (NSString *) | url |
Determine whether a url string is a data url
url | url string |
+ (BOOL) isDeviceiPadAir2 |
return if the device is ipad air 2
+ (BOOL) isDeviceiPadMini4 |
return if the device is ipad mini 4
+ (BOOL) isDeviceiPadPro |
return if the device is ipad pro
+ (BOOL) isDeviceiPhone5 |
return if the device is iphone 5
+ (BOOL) isDeviceiPhone6PlusSizeFamily |
return if the device is iphone 6 plus
+ (BOOL) isDeviceiPhone6S |
return if the device is iphone 6S
+ (BOOL) isDeviceiPhone6SizeFamily |
return if the device is iphone 6
+ (BOOL) isDeviceiPhoneX |
return if the device is iphoneX
+ (BOOL) isDeviceiPhoneXR |
return if the device is iphone XR
+ (BOOL) isDeviceiPhoneXRSizeFamily |
return if the device is iphone XR
+ (BOOL) isDeviceiPhoneXS |
return if the device is iphone XS
+ (BOOL) isDeviceiPhoneXSizeFamily |
return if the device is iphone X
+ (BOOL) isDeviceiPhoneXSMax |
return if the device is iphone XS Max
+ (BOOL) isDeviceiPhoneXSMaxSizeFamily |
return if the device is iphone XS Max
+ (BOOL) isIPhone5 |
+ (BOOL) isMultitaskingSupported |
Check whether the device and iOS support muti tasking
+ (BOOL) isNewsstandEnabled |
+ (BOOL) isPersistSelection |
+ (BOOL) isPreferenceCarryOverThroughServer |
+ (BOOL) isPreferenceDisableRepromptOnPDF |
+ (BOOL) isPushNotificationEnabled |
+ (BOOL) isRetina |
+ (bool) isSupportFaceID |
+ (bool) isSupportTouchID |
+ (BOOL) isUpgradedFromVersion: | (NSString *) | oldVersion | |
lastVersion: | (NSString *) | lastVersion | |
includingPrevious: | (BOOL) | includingPrevious | |
Check whether this application is upgraded from an old version. It's considered as upgrading from the old version if the lastVersion equals or less than the old version depending on the includePrevious parameter.
oldVersion | old version |
lastVersion | the version before this launch whether version older than the oldVersion is consider, if YES, lastVersion can be lower than the oldVersion, if NO, lastVersion should be the same as oldVersion |
+ (BOOL) locationServicesEnabled: | (CLLocationManager *) | locationManager |
Determine whether location service is enabled in this device
locationManager | location manager |
+ (void) logCookiesWithClassName: | (NSString *) | className | |
methodName: | (NSString *) | methodName | |
+ (NSString*) longestStringInArray: | (NSArray *) | strings |
+ (NSString * _Nonnull) microStrategyBadgeName |
+ (NSString * _Nonnull) microStrategyBadgeShortName |
+ (CGRect) navigationControllerFrame: | (BOOL) | isPortrait |
return the navigation controller / bar frame
+ (BOOL) networkIsReachable |
Check if network is connected
+ (NSString *) pathOfFileNamed: | (NSString *) | fileName | |
inBundleNamed: | (NSString *) | bundleName | |
Get the relativate path of a file in a bundle
fileName | file name |
bundleName | bundle name where the file locates |
+ (NSString *) platform |
Get the hardware platform of this device, http://stackoverflow.com/questions/448162/determine-device-iphone-ipod-touch-with-iphone-sdk
+ (NSString*) platformString |
Get the platform information String(include network type) of the current device such as "iPad 2 wifi"
+ (CGFloat) safeAreaBottomPadding |
+ (CGFloat) safeAreaLeftPadding |
+ (CGFloat) safeAreaRightPadding |
+ (CGFloat) safeAreaTopPadding |
+ (NSBundle *) sdkResourcesBundle |
Get the bundle of name "MicroStrategyMobileSDKResources" from main bundle
+ (void) setEncryptionKey: | (NSString *) | key |
+ (void) setNumberAndDateLocaleId: | (NSString *) | lId |
Set application locale. If application has locale, do nothing.
lId | locale id |
+ (void) setStatusBarHidden: | (BOOL) | hidden |
Updates state of the status bar.
hidden | hide status bar or not |
+ (void) setStatusBarHidden: | (BOOL) | hidden | |
withAnimation: | (BOOL) | animation | |
Updates state of the status bar.
hidden | hide status bar or not |
animation | whether do animation |
+ (void) setStatusBarOrientation: | (UIInterfaceOrientation) | interfaceOrientation | |
animated: | (BOOL) | animated | |
Updates orientation of the status bar.
interfaceOrientation | new orientation of the status bar |
animated | whether do animation |
+ (void) setStatusBarStyle: | (UIStatusBarStyle) | statusBarStyle |
Updates style of the status bar.
statusBarStyle | new style of the status bar |
+ (void) setStatusBarStyle: | (UIStatusBarStyle) | statusBarStyle | |
animated: | (BOOL) | animated | |
Updates style of the status bar.
statusBarStyle | new style of the status bar |
animated | whether do animation |
+ (void) setSystemNumberLocaleId: | (NSString *) | lId |
Set system number locale. If application have system number locale, do nothing. System number locale is return by login task.
lId | locale id |
+ (void) setupConnectInfoFromPlist: | (NSString *) | plistFileName |
Utility method to set up user preferences from a plist file in SDK based custom applications. The username and password for the project are provided statically in the plist itself. If a duplicate project or a duplicate webserver exists it updates the existing settings from the plist file.
plistFileName | the name of the resource file that specifies the user's connection information (for example: "ConnectionInfo.plist") |
+ (void) setupConnectInfoFromPlist: | (NSString *) | plistFileName | |
withProjUsername: | (NSString *) | projUID | |
projPassword: | (NSString *) | projPwd | |
Utility method to set up user preferences from a plist file in SDK based custom applications. The username and password for the project are provided at runtime. If a duplicate project or a duplicate webserver exists it updates the existing settings from the plist file.
plistFileName | the name of the resource file that specifies the user's connection information (for example: "ConnectionInfo.plist") |
projUID | the username for the project |
projPwd | the password for the project |
+ (BOOL) shouldUseSafeArea |
+ (void) showCoverScreen |
+ (void) showDocAuthenticationError: | (NSInteger) | error | |
isLocalAuth: | (BOOL) | localAuth | |
delegate: | (id) | delegate | |
+ (BOOL) softwareEncryptionEnabled |
+ (NSString*) stringFromDict: | (NSDictionary *) | dictionary | |
Key: | (NSString *) | key | |
Returns the string value of the object associated with the key. If not exists returns empty string ""
dictionary | dictionary created from connect info plist file |
key | key |
+ (NSInteger) supportedOrientationForEvent: | (NSInteger) | eventType |
Check the support orientiation for certain type of event.
eventType | enum value of EventTypes |
+ (NSString*) taskURL: | (NSString *) | taskName | |
withObjectInfo: | (MSIReportDisplayInfo *) | objectInfo | |
Gets a url string for the task of specified name The objectInfo is required to determine the web server base url, and the web server type (J2EE / ASP) example : http://123.43.43.43:8080/MicroStrategyMobile/servlet/taskProc?taskId=taskName (J2EE) http://123.43.43.43:8080/MicroStrategyMobile/asp/taskProc.aspx?taskId=taskName (ASP)
taskName | task name |
objectInfo | objectInfo to get the project |
+ (void) UIGraphicsBeginImageContextByDeviceType: | (CGSize) | iSize |
+ (NSInteger) webAuthenticationModeForString: | (NSString *) | _authMode |
Convert the authentication mode text to enum value.
_authMode | web server authentication mode text |
+ (NSInteger) webServerTypeForString: | (NSString *) | appType |
Convert the web server type text to enum value.
appType | web server type text, J2EE or ASP |