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.
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:
The framework starts and creates a bootloader to manage the app's main window.
When the launch screen appears, the framework automatically switches to the launch screen window.
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:
Started the Smart Delivery component. For details, see Starting the component
Add launch screen code
In DTFrameworkInterface+MPCDPDemo_plugin.m — the framework category file generated by mPaaS — add the following configurations:

-
Declare a static variable to hold the launch screen window object.
static UIWindow *splashScreenWindow; -
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; } -
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]; } -
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(); // ... } -
When the home page
ViewControllerappears, post a notification to close the launch screen. This is typically therootViewControllerof the Launcher micro-application. If it is aTabBarController, use theViewControllerof 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.