- iOS SDK
- Android SDK
- Flutter SDK
- React Native SDK
- Capacitor
- Expo
iOS SDK
Compatibility
Compatibility
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.
Installation
Installation
- Swift Package Manager installation
- CocoaPods installation
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.
Launch miniapp
Launch miniapp
Import Boxo SDK in your ViewController:Initialize Boxo in your app by configuring a Boxo shared instance. Remember to replace To launch the miniapp, you will need a UIViewController:
client_id
field with your client_id
.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:Miniapp lifecycle events
Miniapp lifecycle events
Miniapp lifecycle events allow you to monitor key activities, such as
onLaunch
, onResume
, onPause
, onClose
, and onError
. These events help track the miniapp’s behavior throughout its usage lifecycle.Dark mode
Dark mode
Dark mode support for splash screen and other native components used inside miniapp.Use MiniappConfig to override theme of miniapp.
Auth flow
Auth flow
Setup onAuth listener for login event from Miniapp
Logout to clear mininapp data
Logout to clear mininapp data
When host app user logs out, it is highly important to clear all miniapp storage data. To clear call
.logout()
:Miniapp URL listener
Miniapp URL listener
To listen for any URL change events, use .setUrlChangeListener:
Append custom params to miniapp URL
Append custom params to miniapp URL
To append custom data params to miniapp URL use .params:
Custom action menu item
Custom action menu item
Retrieve Miniapp List
Retrieve Miniapp List
Fetch the complete catalog of available miniapps with detailed metadata. This operation returns:
- Basic miniapp information (id, name, description)
- Logo
- Category
Consent Management
Consent Management
To skip miniapp splash screen
To skip miniapp splash screen
Sandbox mode
Sandbox mode
sandboxMode: it should open miniapps in “Approved” and “InTesting” statuses List of miniapps returns:
- when true, miniapps in “Approved” and “InTesting” statuses
- when false, miniapps only in “Approved” status
Page Animation Configuration
Page Animation Configuration
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.
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.