@grabjs/superapp-sdk
    Preparing search index...

    Class SplashScreenModule

    JSBridge module for controlling the native splash / Lottie loading screen.

    Dismisses the splash overlay once the MiniApp is ready. Requires the Grab SuperApp WebView.

    ES Module:

    import { SplashScreenModule } from '@grabjs/superapp-sdk';
    const splash = new SplashScreenModule();

    CDN (UMD):

    <script src="https://cdn.jsdelivr.net/npm/@grabjs/superapp-sdk/dist/index.js"></script>
    <script>
    const splash = new SuperAppSDK.SplashScreenModule();
    </script>

    Hierarchy (View Summary)

    Index

    Constructors

    Methods

    Constructors

    Methods

    • Dismisses the native splash (Lottie) loading view if it is presented.

      Returns Promise<
          | { status_code: 204 }
          | { error: string; status_code: 400 }
          | { error: string; status_code: 403 }
          | { error: string; status_code: 500 }
          | { error: string; status_code: 501 },
      >

      204 when there is no splash or it was dismissed; 400 / 403 for client or scope errors.

      import { SplashScreenModule, isSuccess, isErrorResponse } from '@grabjs/superapp-sdk';

      const splashScreen = new SplashScreenModule();
      const response = await splashScreen.dismiss();

      if (isSuccess(response)) {
      console.log('dismissed splash screen successfully');
      } else if (isErrorResponse(response)) {
      console.error(`Error ${response.status_code}: ${response.error}`);
      } else {
      console.error('Unhandled response');
      }