All Products
Search
Document Center

Mobile Platform as a Service:Configure the launch screen

Last Updated:Jun 10, 2026

A launch screen (also called a splash screen) appears after the app starts and the system LaunchScreen closes, and disappears when the home page loads. This topic describes how to configure the launch screen ad on the iOS client so that it fetches and displays ad content from the mPaaS console.

After you configure the launch screen on the client, set up ad slot information and content in the console. See Create an ad slot and Create a campaign. The app then fetches and displays ad delivery data based on this configuration, enabling dynamic ad delivery.

Note

Ad delivery data is downloaded asynchronously. On the first launch after setup, the app only downloads and caches the ad image locally — it does not display it. The cached image appears on the next launch.

The launch screen is built on the mPaaS framework. For details, see mPaaS framework overview. The launch screen lifecycle works as follows:

  1. The framework starts and creates a bootloader to manage the app's main window.

  2. When the launch screen appears, the framework automatically switches to the launch screen window.

  3. When the bootloader finishes loading and the Launcher micro-application is displayed, the launch screen closes and the framework switches back to the main window.

Prerequisites

Before you begin, ensure that you have:

Add launch screen code

In DTFrameworkInterface+MPCDPDemo_plugin.m — the framework category file generated by mPaaS — add the following configurations:

  1. Declare a static variable to hold the launch screen window object.

    static UIWindow *splashScreenWindow;
  2. In the application:handleDidFinishLaunchingWithOptions: method, implement the launch screen ad logic and open the launch screen.

    - (DTFrameworkCallbackResult)application:(UIApplication *)application handleDidFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
        // Check if the launch screen exists
        BOOL showSplashWindow = YES;
        showSplashWindow = splashScreenExist(showSplashWindow);
        if (showSplashWindow) {
            __weak typeof(self) weakSelf = self;
            // Open the launch screen
            splashScreenWindow = APSplashScreenStart(^{
                // Callback for when the launch screen closes
                [weakSelf splashScreenDidDismiss];
            });
        }
    
        return DTFrameworkCallbackResultContinue;
    }
  3. Implement the dismiss logic: restore the main window as the key window, release the launch screen window, and optionally post a notification.

    - (void)splashScreenDidDismiss {
        // Revert the application's main window to the key window
        [DTContextGet().window makeKeyAndVisible];
        [self performSelector:@selector(doDismiss) withObject:nil afterDelay:0.0];
    }
    
    - (void)doDismiss {
        // Release the launch screen object
        splashScreenWindow.rootViewController = nil;
        splashScreenWindow = nil;
        [self notifySplashScreenDismiss];
    }
    
    - (void)notifySplashScreenDismiss {
        // Post a notification when the splash screen closes. Handle other logic here (optional).
        [[NSNotificationCenter defaultCenter] postNotificationName:@"kSplashScreenDidDismiss" object:nil];
    }
  4. After the framework finishes loading, signal that the launch screen is about to close. Call this in the application:afterDidFinishLaunchingWithOptions: method.

    - (void)application:(UIApplication *)application afterDidFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
        APWillKillSplashScreen();
        // ...
    }
  5. When the home page ViewController appears, post a notification to close the launch screen. This is typically the rootViewController of the Launcher micro-application. If it is a TabBarController, use the ViewController of the first tab.

    @implementation HomeViewController
    
    - (void)viewDidLoad {
        [super viewDidLoad];
    }
    
    - (void)viewDidAppear:(BOOL)animated {
        [super viewDidAppear:animated];
        // Notify that the Launcher has been displayed
        [[NSNotificationCenter defaultCenter] postNotificationName:@"kNotificationLauncherDidAppear" object:nil];
    }
    @end

Related topics

For launch screen API details, see API reference.