Capacitor Test App
Click to button to open Demo Miniapp
flutter pub get):
dependencies:
appboxo\_sdk: ^0.8.0
Add this line to android/gradle.properties
```
android.enableJetifier=true
```
Click to button to open Demo Miniapp
string | your client id from dashboard |
| userId | string | (optional) hostapp userId, will be used for the Consent Management |
| language | string | language value will be passed to the miniapp |
| sandboxMode | boolean | switch to sandbox mode |
| theme | 'light' \| 'dark' \| 'system' | theme for splash screen and other native components used inside miniapp. |
| isDebug | boolean | enables webview debugging |
| showPermissionsPage | boolean | use it to hide "Settings" from Miniapp menu |
| showClearCache | boolean | use it to hide "Clear cache" from Miniapp menu |
| showAboutPage | boolean | use it to hide "About Page" from Miniapp menu |
| miniappSettingsExpirationTime | number | use it to change miniapp settings cache time in sec. Default: 60 sec |
| splashScreenOptions | SplashScreenOptions | (optional) setup splash screen configs |
**SplashScreenOptions**
| Prop | Type |
| ---------------------- | ------------------- |
| lightBackground | string |
| darkBackground | string |
| lightProgressIndicator | string |
| lightProgressTrack | string |
| darkProgressIndicator | string |
| darkProgressTrack | string |
string | miniapp id |
| data | object | (optional) data as Map that is sent to miniapp |
| theme | 'light' \| 'dark' \| 'system' | (optional) miniapp theme "dark" \| "light" (by default is system theme) |
| extraUrlParams | object | (optional) extra query params to append to miniapp URL (like: [http://miniapp-url.com/?param=test](http://miniapp-url.com/?param=test)) |
| urlSuffix | string | (optional) suffix to append to miniapp URL (like: [http://miniapp-url.com/?param=test](http://miniapp-url.com/?param=test)) |
| colors | ColorOptions | (optional) provide colors to miniapp if miniapp supports |
| enableSplash | boolean | (optional) use to skip miniapp splash screen |
| saveState | boolean | (optional) use to save state on close miniapp |
| pageAnimation | 'BOTTOM\_TO\_TOP' \| 'TOP\_TO\_BOTTOM' \| 'LEFT\_TO\_RIGHT' \| 'RIGHT\_TO\_LEFT' \| 'FADE\_IN' | (optional) use to change launch animation for miniapp |
**ColorOptions**
| Prop | Type |
| -------------- | ------------------- |
| primaryColor | string |
| secondaryColor | string |
| tertiaryColor | string |
#### Close
```typescript theme={"system"}
closeMiniapp(options: { appId: string; }) => Promise\[MiniappData] |
| error | string |
**MiniappData**
| Prop | Type |
| ----------- | ------------------- |
| appId | string |
| name | string |
| category | string |
| description | string |
| logo | string |
'custom\_event' |
| listenerFunc | (customEvent: CustomEvent) => void |
```typescript theme={"system"}
sendCustomEvent(customEvent: CustomEvent) => Promisestring |
| requestId | number |
| type | string |
| errorType | string |
| payload | object |
'payment\_event' |
| listenerFunc | (paymentEvent: PaymentEvent) => void |
```typescript theme={"system"}
sendPaymentEvent(paymentEvent: PaymentEvent) => Promisestring |
| orderPaymentId | string |
| miniappOrderId | string |
| amount | number |
| currency | string |
| status | string |
| hostappOrderId | string |
| extraParams | object |
'miniapp\_lifecycle' |
| listenerFunc | (lifecycle: LifecycleEvent) => void |
**LifecycleEvent**
| Prop | Type |
| --------- | ------------------- |
| appId | string |
| lifecycle | string |
| error | string |
onLaunch - Called when the miniapp will launch with Boxo.open(...)
onResume - Called when the miniapp will start interacting with the user
onPause - Called when the miniapp loses foreground state
onClose - Called when clicked close button in miniapp or when destroyed miniapp page
onError - Called when miniapp fails to launch due to internet connection issues
onUserInteraction - Called whenever a touch event is dispatched to the miniapp page
onAuth - Called when the miniapp starts login and user allows it
string | your client id from dashboard |
| userId | string | (optional) hostapp userId, will be used for the Consent Management |
| language | string | language value will be passed to the miniapp |
| sandboxMode | boolean | switch to sandbox mode |
| theme | 'light' \| 'dark' \| 'system' | theme for splash screen and other native components used inside miniapp. |
| isDebug | boolean | enables webview debugging |
| showPermissionsPage | boolean | use it to hide "Settings" from Miniapp menu |
| showClearCache | boolean | use it to hide "Clear cache" from Miniapp menu |
| showAboutPage | boolean | use it to hide "About Page" from Miniapp menu |
| miniappSettingsExpirationTime | number | use it to change miniapp settings cache time in sec. Default: 60 sec |
| splashScreenOptions | SplashScreenOptions | (optional) setup splash screen configs |
**SplashScreenOptions**
| Prop | Type |
| ---------------------- | ------------------- |
| lightBackground | string |
| darkBackground | string |
| lightProgressIndicator | string |
| lightProgressTrack | string |
| darkProgressIndicator | string |
| darkProgressTrack | string |
string | miniapp id |
| data | object | (optional) data as Map that is sent to miniapp |
| theme | 'light' \| 'dark' \| 'system' | (optional) miniapp theme "dark" \| "light" (by default is system theme) |
| extraUrlParams | object | (optional) extra query params to append to miniapp URL (like: [http://miniapp-url.com/?param=test](http://miniapp-url.com/?param=test)) |
| urlSuffix | string | (optional) suffix to append to miniapp URL (like: [http://miniapp-url.com/?param=test](http://miniapp-url.com/?param=test)) |
| colors | ColorOptions | (optional) provide colors to miniapp if miniapp supports |
| enableSplash | boolean | (optional) use to skip miniapp splash screen |
| saveState | boolean | (optional) use to save state on close miniapp |
| pageAnimation | 'BOTTOM\_TO\_TOP' \| 'TOP\_TO\_BOTTOM' \| 'LEFT\_TO\_RIGHT' \| 'RIGHT\_TO\_LEFT' \| 'FADE\_IN' | (optional) use to change launch animation for miniapp |
**ColorOptions**
| Prop | Type |
| -------------- | ------------------- |
| primaryColor | string |
| secondaryColor | string |
| tertiaryColor | string |
#### Close
```typescript theme={"system"}
closeMiniapp(appId: string)
```
close miniapp by appId
#### Hide
```typescript theme={"system"}
hideMiniapps()
```
Miniapp opens on a native screen. To show payment processing page need to hide miniapp screen.
\[MiniappData] |
| error | string |
**MiniappData**
| Prop | Type |
| ----------- | ------------------- |
| appId | string |
| name | string |
| category | string |
| description | string |
| logo | string |
string |
| requestId | number |
| type | string |
| errorType | string |
| payload | object |
string |
| orderPaymentId | string |
| miniappOrderId | string |
| amount | number |
| currency | string |
| status | string |
| hostappOrderId | string |
| extraParams | object |
string |
| lifecycle | string |
| error | string |
onLaunch - Called when the miniapp will launch with Boxo.open(...)
onResume - Called when the miniapp will start interacting with the user
onPause - Called when the miniapp loses foreground state
onClose - Called when clicked close button in miniapp or when destroyed miniapp page
onError - Called when miniapp fails to launch due to internet connection issues
onUserInteraction - Called whenever a touch event is dispatched to the miniapp page
onAuth - Called when the miniapp starts login and user allows it
Status: {isMounted ? "Mounted" : "Mounting..."}
Status: {isMounted ? "Mounted" : "Mounting..."}