Skip to main content

iOS SDK

Your project must target iOS 10 or later. Swift projects should use Swift 4.2 or later, and CocoaPods 1.8.1 or later is required.
Add a package by selecting File → Add Packages… in Xcode’s menu bar.Search for the BoxoSDK using the repo’s URL:
Next, set the Dependency Rule to be Up to Next Major Version.Then, select Add Package.
Import Boxo SDK in your ViewController:
Initialize Boxo in your app by configuring a Boxo shared instance. Remember to replace client_id field with your client_id.
To launch the miniapp, you will need a UIViewController:

UIKit

To open miniapp write this code in your UIViewController:

SwiftUI

If you are using SwiftUI, you need to access the current UIViewController. There are many ways to obtain a UIViewController. Here is one of them:
Configure BoxoSDK with these settings to customize behavior, language, and UI elements.

Language Configuration

Use it to provide language to miniapp. Default: ‘en’

Miniapp Menu Customization

Sandbox Mode Configuration

Control which miniapps are available in your development environment using the sandbox mode flag:
Behavior: Retrieve Miniapp List will return miniapps with the statuses listed below.

Theme Configuration

Configure native component theming to match your app’s design system or respect user preferences. The SDK provides comprehensive theme support for:
  • Splash screens
  • Native UI components
  • System dialogs and alerts
Theme Options:Control theme behavior at both global and per-miniapp levels for maximum flexibility.Global Theme (Affects all miniapps)
Per-Miniapp Theme Override
Handle authentication between your host app and miniapps:
When users log out of your host app, you must completely clear all miniapp session data
To listen for any URL change events:
Append additional query parameters to miniapp’s initial URL for passing contextual data. This enables:
  • User-specific data injection
  • Campaign tracking
  • Contextual deep linking
  • A/B testing configuration
Parameters will be automatically URL-encoded and appended as query parameters:
Establish two-way communication between your hostapp and miniapps using custom events. This system enables:
  • Real-time data exchange
  • User interaction tracking
  • Miniapp to host app callbacks
  • Dynamic content updates
You can extend the miniapp’s native menu by adding your own custom action item by defining .setCustomActionMenuItemImage
Control Visibility:
Fetch the complete catalog of available miniapps with detailed metadata. This operation returns:
  • Basic miniapp information (id, name, description)
  • Logo
  • Category
When a miniapp is launched, Boxo displays a splash screen while the content is loading. You can customize the splash screen background color and the loading progress indicator for both light and dark themes.

Background Colors

Use the splashBackgroundColors property to configure splash background colors:

Progress Bar Colors

Use the progressBarColors property to configure progress bar colors:

Splash Behavior

By default, the splash screen is shown automatically and hides when approximately 50% of the web content has loaded.You can control this behavior using MiniappConfig. For example, to disable the splash screen entirely:
Customize the animation effects to enhance the user experience by setting the appropriate page transition animation when opening a miniapp.You can choose from the following page animations:
  • LEFT_TO_RIGHT - The miniapp slides in from the left side of the screen to the right.
  • RIGHT_TO_LEFT - The miniapp slides in from the right side of the screen to the left.
  • BOTTOM_TO_TOP- The miniapp slides in from the bottom of the screen to the top.
  • TOP_TO_BOTTOM - The miniapp slides in from the top of the screen to the bottom.
  • FADE_IN - The miniapp fades in gradually from completely transparent to opaque.
The BOTTOM_TO_TOP animation is the default page transition effect. You can easily change the animation to any of the other available options based on the user experience you want to provide.
Miniapp lifecycle events allow you to monitor key activities, such as onLaunch, onResume, onPause, onClose, onError, and onUserInteraction. These events help track the miniapp’s behavior throughout its usage lifecycle.