EducationSoftwareStrategy.com
StrategyCommunity

Knowledge Base

Product

Community

Knowledge Base

TopicsBrowse ArticlesDeveloper Zone

Product

Download SoftwareProduct DocumentationSecurity Hub

Education

Tutorial VideosSolution GalleryEducation courses

Community

GuidelinesGrandmastersEvents
x_social-icon_white.svglinkedin_social-icon_white.svg
Strategy logoCommunity

© Strategy Inc. All Rights Reserved.

LegalTerms of UsePrivacy Policy
  1. Home
  2. Topics

KB489554: Add Functionality with a Custom Application Delegate in Strategy Mobile iOS


Mengyuan Guan

Product Owner, Principal • MicroStrategy


Every iOS application has a delegate object conforming to the UIApplicationDelegate protocol, which tracks the application's state transitions. The MicroStrategyMobile Xcode project is preconfigured with its own internal app delegate class (MSIAppDelegateImpl). Developers can configure a custom delegate by extending this class and overriding protocol methods to add extra functionality during application launch and state transitions.

Every iOS application has a delegate object that conforms to the

UIApplicationDelegate
protocol. This app delegate object is mainly responsible for tracking the state transitions the application goes through while it is running. The app delegate of an application is defined in the Xcode project configuration and is instantiated by iOS when the application launches. See the iOS Developer Library for more information about the
UIApplicationDelegate
protocol.

The StrategyMobile Xcode project is preconfigured with its own internal app delegate class (called

MSIAppDelegateImpl
), but it is possible to configure a custom app delegate class that adds functionality when the application launches and when state transitions occur. Do this by extending the StrategyMobile internal app delegate class and overriding the different methods defined in the 
UIApplicationDelegate
protocol.

Create a Custom App Delegate that Extends MSIAppDelegateImpl

  • Set up the environment so you can use the StrategyMobile project as the base for your customizations
  • Create a custom application delegate class that extends
    MISAppDelegateImpl
    :
    • Right-click the StrategyMobile project and select New File from Template.
ka0PY000000KCeXYAW_0EMPY00000QTXjB.jpeg
    • Select Cocoa Touch Class and click Next.
ka0PY000000KCeXYAW_0EMPY00000QTXw5.jpeg
    • Type a name for your app delegate class (such as
      CustomAppDelegate
      ). Enter
      MSIAppDelegateImpl 
      as the parent class. Select Objective-C as the language. Click Next.
ka0PY000000KCeXYAW_0EMPY00000QTNAM.jpeg
    • In the pop-up window, ensure that Group is set to
      StrategyMobile 
      and that both
      StrategyMobileIPhone 
      and
      StrategyMobileIPad 
      are selected as Targets. Click Create.
ka0PY000000KCeXYAW_0EMPY00000QTZmb.jpeg
    • The template code for your custom app delegate class displays. Add the following line of code:
      #import <StrategyMobileSDK/MSIAppDelegateImpl.h>


ka0PY000000KCeXYAW_0EMPY00000QTaPJ.jpeg
    • In the template code for your custom app delegate class, override the appropriate methods to perform actions at specific places in the application workflow, as shown in the code snippet below. 
      For example, you can add custom code that runs before Strategy launches any services that require authentication or after Strategy is initialized but before the user sees any screens. Override the didFinishLaunchingWithOptions method and add the custom code to perform these actions as shown in the code snippet below:
      - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions NS_AVAILABLE_IOS(3_0) {
          return [super application:application didFinishLaunchingWithOptions:launchOptions];
      }


  • Open
    main.m
    . Replace
    MSIAppDelegateIMPl 
    with your app delegate class name (such as
    CustomAppDelegate
    ).
ka0PY000000KCeXYAW_0EMPY00000QTW2M.jpeg

Warning: With the adoption of UIScene:

  • The
    MainWindow.xib
    and
    MainWindow-iPad.xib
    have been deprecated.
  • The methods listed in the table below are now deprecated and unavailable. To implement equivalent features, consider customizing
    MSIDefaultSceneDelegate 
    or registering relevant event listeners as needed.

MethodApple Doc Link

- (void) applicationDidBecomeActive:(UIApplication *) application; 
applicationDidBecomeActive:
- (void) applicationWillResignActive:(UIApplication *) application; 
applicationWillResignActive:
- (void) applicationDidEnterBackground:(UIApplication *) application; 
applicationDidEnterBackground:
- (void) applicationWillEnterForeground:(UIApplication *) application; 
applicationWillEnterForeground:

MethodApple Doc Link

- (void) applicationDidBecomeActive:(UIApplication *) application; 
applicationDidBecomeActive:
- (void) applicationWillResignActive:(UIApplication *) application; 
applicationWillResignActive:
- (void) applicationDidEnterBackground:(UIApplication *) application; 
applicationDidEnterBackground:
- (void) applicationWillEnterForeground:(UIApplication *) application; 
applicationWillEnterForeground:

MethodApple Doc Link

- (void) applicationDidBecomeActive:(UIApplication *) application; 
applicationDidBecomeActive:
- (void) applicationWillResignActive:(UIApplication *) application; 
applicationWillResignActive:
- (void) applicationDidEnterBackground:(UIApplication *) application; 
applicationDidEnterBackground:
- (void) applicationWillEnterForeground:(UIApplication *) application; 
applicationWillEnterForeground:

MethodApple Doc Link

- (void) applicationDidBecomeActive:(UIApplication *) application; 
applicationDidBecomeActive:
- (void) applicationWillResignActive:(UIApplication *) application; 
applicationWillResignActive:
- (void) applicationDidEnterBackground:(UIApplication *) application; 
applicationDidEnterBackground:
- (void) applicationWillEnterForeground:(UIApplication *) application; 
applicationWillEnterForeground:

MethodApple Doc Link

- (void) applicationDidBecomeActive:(UIApplication *) application; 
applicationDidBecomeActive:
- (void) applicationWillResignActive:(UIApplication *) application; 
applicationWillResignActive:
- (void) applicationDidEnterBackground:(UIApplication *) application; 
applicationDidEnterBackground:
- (void) applicationWillEnterForeground:(UIApplication *) application; 
applicationWillEnterForeground:

MethodApple Doc Link

- (void) applicationDidBecomeActive:(UIApplication *) application; 
applicationDidBecomeActive:
- (void) applicationWillResignActive:(UIApplication *) application; 
applicationWillResignActive:
- (void) applicationDidEnterBackground:(UIApplication *) application; 
applicationDidEnterBackground:
- (void) applicationWillEnterForeground:(UIApplication *) application; 
applicationWillEnterForeground:

MethodApple Doc Link

- (void) applicationDidBecomeActive:(UIApplication *) application; 
applicationDidBecomeActive:
- (void) applicationWillResignActive:(UIApplication *) application; 
applicationWillResignActive:
- (void) applicationDidEnterBackground:(UIApplication *) application; 
applicationDidEnterBackground:
- (void) applicationWillEnterForeground:(UIApplication *) application; 
applicationWillEnterForeground:

MethodApple Doc Link

- (void) applicationDidBecomeActive:(UIApplication *) application; 
applicationDidBecomeActive:
- (void) applicationWillResignActive:(UIApplication *) application; 
applicationWillResignActive:
- (void) applicationDidEnterBackground:(UIApplication *) application; 
applicationDidEnterBackground:
- (void) applicationWillEnterForeground:(UIApplication *) application; 
applicationWillEnterForeground:

MethodApple Doc Link

- (void) applicationDidBecomeActive:(UIApplication *) application; 
applicationDidBecomeActive:
- (void) applicationWillResignActive:(UIApplication *) application; 
applicationWillResignActive:
- (void) applicationDidEnterBackground:(UIApplication *) application; 
applicationDidEnterBackground:
- (void) applicationWillEnterForeground:(UIApplication *) application; 
applicationWillEnterForeground:

MethodApple Doc Link

- (void) applicationDidBecomeActive:(UIApplication *) application; 
applicationDidBecomeActive:
- (void) applicationWillResignActive:(UIApplication *) application; 
applicationWillResignActive:
- (void) applicationDidEnterBackground:(UIApplication *) application; 
applicationDidEnterBackground:
- (void) applicationWillEnterForeground:(UIApplication *) application; 
applicationWillEnterForeground:

 


Comment

0 comments

Details

Knowledge Article

Published:

November 11, 2025

Last Updated:

November 14, 2025