MicroStrategy ONE
Set Up a Custom Project in iOS
To create a new project that you configure to use the Mobile SDK frameworks, install the Mobile SDK and follow the steps below.
A detailed explanation of how to perform each step is provided below.
-
You can use an existing Xcode project or create a new one. In Xcode, expand the project to display the folders and files within it.
-
Add the Mobile SDK frameworks required for the project
-
Click <application project name> to view the targets for the project.
-
Click the appropriate <target name> to view the properties for the target.
-
Click the Build Phases tab for the selected target.
-
Expand Link Binary with Libraries.
-
Click + under Link Binary with Libraries .
-
In the Choose frameworks and libraries to add dialog, click the Add Other... button.
-
In the Finder, select MicroStrategyMobileSDK.framework (located by default in the Library folder). Either double-click MicroStrategyMobileSDK.framework or click the Open button. The framework is added to the project.
-
Again, click + under Link Binary with Libraries .
-
In the Choose frameworks and libraries to add dialog, click the Add Other... button.
-
In the Finder, navigate to MstrDMG, then Library, then OpenSSL, then lib. Select both libcrypto.a and libssl.a and click the Open button. The libraries are added to the project.
-
If you want to add other Mobile SDK frameworks (located by default in the Library folder), repeat the steps ii-iv. For example, if you want to use the RSS Reader or the Data Cloud widget, select
MSTRRssReader.framework
orMSTRDataCloud.framework
in the Linking Library.
-
-
Click the General tab for the selected target.
- Expand Embedded Binaries.
- Click + under Embedded Binaries.
- In the Choose frameworks and libraries to add dialog, select MicroStrategyMobileSDK.framework . Either double-click MicroStrategyMobileSDK.framework or click the Add button. The framework is added to the project.
- Repeat steps b - d for each <target name> that will be used for building the project.
-
- Add the search path of the framework and library for the project
- Click <application project name> to view the targets for the project.
- Click the appropriate <target name> to view the properties for the target.
-
Click the Build Settings tab for the selected target. To ensure that classes can be loaded on-the-fly when reflection is used, do the following for each target:
- Search for the text "Search".
- Double-click the Framework Search Paths setting to launch the dialog for editing this setting.
-
Click + and add path “$(SRCROOT)/../../Library”.
If the path has been changed, make sure to add the correct path for the MicroStrategyMobile framework.
- Double-click the Library Search Paths setting to launch the dialog for editing this setting.
-
Click + and add path “$(SRCROOT)/../../Library/openssl/lib”.
If the path has been changed, make sure to add the correct path for the MicroStrategyMobile library.
-
Add the iOS frameworks required for the project
-
Click <application project name> to view the targets for the project.
-
Click the appropriate <target name> to view the properties for the target.
-
Click the Build Phases tab for the selected target.
-
Expand he Link Binary with Libraries panel.
-
Click + in the Link Binary with Libraries panel.
-
In the dialog that opens, click the Add button.
-
In the Finder, select the following frameworks and click Add. The frameworks are added to the project.
-
Accelerate.framework
-
AssetsLibrary.framework
-
AudioToolbox.framework
-
AVFoundation.framework
-
CFNetwork.framework
-
CoreData.framework
-
CoreGraphics.framework
-
CoreImage.framework
-
CoreLocation.framework
-
CoreMedia.framework
-
CoreMotion.framework
-
CoreText.framework
-
CoreVideo.framework
-
Foundation.framework
-
GLKit.framework
-
ImageIO.framework
-
LocalAuthentication.framework
-
MapKit.framework
-
MediaPlayer.framework
-
MessageUI.framework
-
MobileCoreServices.framework
-
NewsstandKit.framework
-
OpenGLES.framework
-
QuartzCore.framework
-
QuickLook.framework
-
Security.framework
-
SystemConfiguration.framework
-
UIKit.framework
- WebKit.framework
-
libiconv.tbd
-
libz.1.2.5.tbd
Some of these frameworks may already exist in the Frameworks folder.
-
-
-
Repeat steps b - c for each <target name> that will be used for building the project.
-
-
Add the required Mobile SDK Resources folder for the project
-
Right-click <application project name> and select New Group. Then, rename the new group as Resource.
- Right-click Resource and select Add Files to "<application project name>". This displays a dialog for setting properties.
-
Navigate to MicroStrategyMobile\Resources, and select FinalBundle.bundle, IconFont, ImageCache.bundle, and MicroStrategyMobileSDKResources.bundle
Tap and hold Command to make multiple selections.
- Do not select the Destination: check box for Copy items into destination group's folder (if needed).
- Select the Added folders: check box for Create folder references.
- Select the appropriate target for your project in the Add To Targets panel and click Add. The dialog closes.
-
- Add the font file that is used to support the vector font used in MicroStrategyMobileSDK
-
Click info.plist.
Expand Fonts provided by application.
If this item does not exist, you need to create it.
- Add a new item called IconFont/font/mobile_analytics_ios.ttf.
-
-
Add target-specific information
-
Click <application project name> to view the targets for the project.
-
Click the <target name> to view the properties for the target.
-
Click the Build Settings tab for the selected target.
To ensure that classes can be loaded on-the-fly when reflection is used, do the following for each target:
-
Search for text Linker.
-
Double-click the Other Linker Flags setting to launch the dialog for editing this setting.
-
Click + and add flags -all_load , -lStdC++, and -lxml2 in the dialog.
The character "l" in the flags is the letter "l", not the numeral "1".
-
-
Click Done to close the dialog.
-
-
Make changes to the application delegate
Prior to MicroStrategy Mobile 9.4.1 Update 1, applications that integrated with MicroStrategy had to extend their application delegate class fromMSTRMobileAppDelegate, but extending MicroStrategy’s Application Delegate class is no longer a requirement. There are now two possible options:
-
Use MicroStrategy's application delegate as the basis for the application delegate of your application
For new projects, extend your application's AppDelegate class from MSIAppDelegateImpl. For existing projects created with earlier releases, rename MSTRMobileAppDelegate to MSIAppDelegateImpl.
-
Use your own application delegate instead of inheriting from MSIAppDelegateImpl
Perform the following steps:
-
Ensure that your application's AppDelegate class conforms to the MSIAppDelegate protocol. A sample declaration is provided below:
Copy...
#import "MicroStrategyMobileSDK/MSIAppDelegate.h"
...
@implementation AppDelegate
@synthesize mstrAppDelegateUtils = _mstrAppDelegateUtils;
... -
Initialize the mstrAppDelegateUtils* _mstrAppDelegateUtils property declared in the MSIAppDelegate protocol in the application delegate’s init method. A sample init method is provided below:
- (id)init {
self = [super init];
if (self) {
// Initialize self
_mstrAppDelegateUtils = [[mstrAppDelegateUtils alloc] init];
}
return self;
}
-
Implement the application delegate’s callback methods and notify theMSIAppDelegateUtilsobject about those events. Listed below are the methods which the MicroStrategy framework needs to be notified about. Note that final implementation of these methods depends of the actual behavior desired in the application. For example, an application might want to add some logic to the way URL handling is performed or the way notifications are handled; these customizations would require the developer to implement the logic for these actions in the implementation of the application:openURL:sourceApplication:annotation or the application:didReceiveRemoteNotification:methods respectively.
- (void)applicationDidBecomeActive:(UIApplication *)application {
[self.mstrAppDelegateUtils applicationDidBecomeActive:application];
}
- (void)applicationWillResignActive:(UIApplication *)application {
[self.mstrAppDelegateUtils applicationWillResignActive:application];
}
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation NS_AVAILABLE_IOS(4_2) {
return [self.mstrAppDelegateUtils application:application openURL:url sourceApplication:sourceApplication annotation:annotation];
}
- (void)applicationWillTerminate:(UIApplication *)application {
[self.mstrAppDelegateUtils applicationWillTerminate:application];
}
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken NS_AVAILABLE_IOS(3_0) {
[self.mstrAppDelegateUtils application:application didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
}
- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error NS_AVAILABLE_IOS(3_0) {
[self.mstrAppDelegateUtils application:application didFailToRegisterForRemoteNotificationsWithError:error];
}
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo NS_AVAILABLE_IOS(3_0) {
[self.mstrAppDelegateUtils application:application didReceiveRemoteNotification:userInfo];
}
- (void)applicationDidEnterBackground:(UIApplication *)application NS_AVAILABLE_IOS(4_0) {
[self.mstrAppDelegateUtils applicationDidEnterBackground:application];
}
- (void)applicationWillEnterForeground:(UIApplication *)application NS_AVAILABLE_IOS(4_0) {
[self.mstrAppDelegateUtils applicationWillEnterForeground:application];
}
-
Update the navigation controller reference
Certain functions of the MicroStrategy Mobile framework are performed by pushing view controllers onto a navigation controller. The MicroStrategy Mobile framework creates a NavigationController that can be used in the custom application. This navigation controller is the default navigation controller where the MicroStrategy framework performs the push actions. You can define your own custom navigation controller as well.
The MSIAppDelegate calls the updateMSTRStartViewController:startViewController method when it is initialized. The parameter passed in this method is the default navigation controller generated by the framework. You can keep a reference to it if it is desired. The following snippet shows how to set this navigation controller as the application’s root view controller.
- (void)updateMSTRStartViewController:(UIViewController *)startViewController {
[self.window setRootViewController:startViewController];
}
If you are using a different navigation controller where MicroStrategy content is presented, you must update the reference to this navigation controller via the following API:
//In this snippet, we create a custom navigation controller where the content will be presented
UINavigationController *customNavigationController = [[UINavigationController alloc]init];
[[Generic getMSTRAppContext] setCustomizedNavigationController:customNavigationController];
Applications developed prior to 9.4.1 must be updated using either of the two approaches described above.
-
-
-
Build the project to confirm that it compiles successfully
From the Product menu, select Build. Confirm that compilation was successful.
The project is now ready for use.