MicroStrategy ONE

Custom AppDelegate Sample in iOS

Sample name: CustomAppDelegate

iPad                                                                                           iPhone

      

Functionality showcased: This sample illustrates how to add a custom app delegate in the MicroStrategyMobile project. In this sample, an alert is displayed saying "Good morning", "Good afternoon" or "Good evening", depending on the time when the application is launched. Between 6 am and 12 noon, the alert displays "Good morning". Between 12 noon and 6 pm, the alert displays "Good afternoon". Otherwise, the alert displays "Good evening".

Using the sample: The following instructions will help you deploy this sample to your mobile device or simulator.

  1. Install the Mobile SDK on your development machine. 
    1. On a Mac® computer, go to the MicroStrategy Download site and download the iOS Client file for the latest Mobile SDK.

      The latest Mobile SDK may or may not be the same version as the version of Intelligence Server you are using.

    2. Double-click the downloaded MicroStrategy Mobile SDK.dmg file. 

    3. Click Agree to accept the terms of the license agreement. This opens the disk image. 

    4. Copy all the folders to your local drive. 

    5. Eject the disk image. 

  2. Build and deploy the sample. 

    1. Download the .zip file containing the custom files for the sample and unzip it to a location on your machine. 

    2. Launch the MicroStrategy Mobile project in Xcode®. Double-click MicroStrategyMobile.xcodeproj

    3. Add the custom files for the sample to the project.

      1. Expand MicroStrategyMobile, right-click the Custom folder, and choose "Add Files to "MicroStrategy Mobile.
      2. Navigate to the location where you unzipped the custom files for the sample and select them.
      3. Make sure the check box for Destination: Copy items if needed is not selected.
      4. Select the radio button for Added folders: Create folder references.
      5. Select the appropriate check boxes for Add to targets.
      6. Click Add. The files are added to the Custom folder.


    4. Specify that the project should use the custom application delegate.

      1. Under MicroStrategyMobile in the left pane, select either MainWindow-iPad.xib for an iPad application or MainWindow.xib for an iPhone application. If you are building this project for both kinds of applications, perform the steps below for each.
      2. In the center pane, select the MstrMobile App Delegate icon.
      3. Under Custom Class in the right pane, type "CustomAppDelegate" for Class.
    5. Click the Run button to compile and deploy the application to a simulator. Confirm that it compiles and deploys successfully.

      To upload the application to a device, set the destination in the scheme to the mobile device and then build and run. For other requirements on deploying to a device, refer to documentation from Apple. You can access useful links to the Apple documentation from the Distributing iPhone or iPad Applications topic.
         

  3. Use the sample. 

    Launch the CustomAppDelegate application from the mobile device or simulator.

See also