@appboxo/capacitor-boxo-sdk 0.6.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CapacitorBoxoSdk.podspec +1 -1
- package/README.md +17 -16
- package/android/build.gradle +1 -15
- package/android/src/main/java/io/boxo/sdk/capacitor/AppboxoPlugin.kt +27 -22
- package/dist/docs.json +9 -2
- package/dist/esm/definitions.d.ts +6 -2
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/plugin.cjs.js +2 -0
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +2 -0
- package/dist/plugin.js.map +1 -1
- package/ios/Sources/AppboxoPlugin/AppboxoPlugin.swift +16 -0
- package/package.json +1 -1
package/CapacitorBoxoSdk.podspec
CHANGED
package/README.md
CHANGED
|
@@ -142,7 +142,7 @@ hideMiniapps() => Promise<void>
|
|
|
142
142
|
```
|
|
143
143
|
|
|
144
144
|
Miniapp opens on a native screen. To show payment processing page need to hide miniapp screen.
|
|
145
|
-
To use this function need to enable 'enableMultitaskMode: true' in
|
|
145
|
+
To use this function need to enable 'enableMultitaskMode: true' in Boxo.setConfig()
|
|
146
146
|
|
|
147
147
|
--------------------
|
|
148
148
|
|
|
@@ -228,16 +228,17 @@ logout() => Promise<void>
|
|
|
228
228
|
|
|
229
229
|
#### OpenMiniappOptions
|
|
230
230
|
|
|
231
|
-
| Prop | Type
|
|
232
|
-
| -------------------- |
|
|
233
|
-
| **`appId`** | <code>string</code>
|
|
234
|
-
| **`data`** | <code>object</code>
|
|
235
|
-
| **`theme`** | <code>'light' \| 'dark' \| 'system'</code>
|
|
236
|
-
| **`extraUrlParams`** | <code>object</code>
|
|
237
|
-
| **`urlSuffix`** | <code>string</code>
|
|
238
|
-
| **`colors`** | <code><a href="#coloroptions">ColorOptions</a></code>
|
|
239
|
-
| **`enableSplash`** | <code>boolean</code>
|
|
240
|
-
| **`saveState`** | <code>boolean</code>
|
|
231
|
+
| Prop | Type | Description |
|
|
232
|
+
| -------------------- | -------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
|
|
233
|
+
| **`appId`** | <code>string</code> | miniapp id |
|
|
234
|
+
| **`data`** | <code>object</code> | (optional) data as Map that is sent to miniapp |
|
|
235
|
+
| **`theme`** | <code>'light' \| 'dark' \| 'system'</code> | (optional) miniapp theme "dark" \| "light" (by default is system theme) |
|
|
236
|
+
| **`extraUrlParams`** | <code>object</code> | (optional) extra query params to append to miniapp URL (like: http://miniapp-url.com/?param=test) |
|
|
237
|
+
| **`urlSuffix`** | <code>string</code> | (optional) suffix to append to miniapp URL (like: http://miniapp-url.com/?param=test) |
|
|
238
|
+
| **`colors`** | <code><a href="#coloroptions">ColorOptions</a></code> | (optional) provide colors to miniapp if miniapp supports |
|
|
239
|
+
| **`enableSplash`** | <code>boolean</code> | (optional) use to skip miniapp splash screen |
|
|
240
|
+
| **`saveState`** | <code>boolean</code> | (optional) use to save state on close miniapp |
|
|
241
|
+
| **`pageAnimation`** | <code>'BOTTOM_TO_TOP' \| 'TOP_TO_BOTTOM' \| 'LEFT_TO_RIGHT' \| 'RIGHT_TO_LEFT' \| 'FADE_IN'</code> | (optional) use to change launch animation for miniapp. |
|
|
241
242
|
|
|
242
243
|
|
|
243
244
|
#### ColorOptions
|
|
@@ -302,10 +303,10 @@ logout() => Promise<void>
|
|
|
302
303
|
|
|
303
304
|
#### LifecycleEvent
|
|
304
305
|
|
|
305
|
-
| Prop | Type | Description
|
|
306
|
-
| --------------- | ------------------- |
|
|
307
|
-
| **`appId`** | <code>string</code> |
|
|
308
|
-
| **`lifecycle`** | <code>string</code> | onLaunch - Called when the miniapp will launch with
|
|
309
|
-
| **`error`** | <code>string</code> |
|
|
306
|
+
| Prop | Type | Description |
|
|
307
|
+
| --------------- | ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
308
|
+
| **`appId`** | <code>string</code> | |
|
|
309
|
+
| **`lifecycle`** | <code>string</code> | 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 touch event is dispatched to the miniapp page. onAuth - Called when the miniapp starts login and user allows it |
|
|
310
|
+
| **`error`** | <code>string</code> | |
|
|
310
311
|
|
|
311
312
|
</docgen-api>
|
package/android/build.gradle
CHANGED
|
@@ -55,25 +55,11 @@ repositories {
|
|
|
55
55
|
mavenCentral()
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
rootProject.allprojects {
|
|
59
|
-
repositories {
|
|
60
|
-
maven { url "https://jitpack.io" }
|
|
61
|
-
jcenter()
|
|
62
|
-
maven {
|
|
63
|
-
url "https://maven.pkg.github.com/Appboxo/android-sdk-packages"
|
|
64
|
-
credentials {
|
|
65
|
-
username = "appboxoandroidsdk"
|
|
66
|
-
password = "\u0037\u0039\u0064\u0031\u0065\u0064\u0061\u0036\u0030\u0034\u0063\u0061\u0031\u0066\u0030\u0032\u0066\u0031\u0037\u0066\u0032\u0061\u0039\u0033\u0064\u0035\u0039\u0039\u0061\u0035\u0035\u0062\u0066\u0065\u0031\u0064\u0066\u0064\u0038\u0038"
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
58
|
dependencies {
|
|
73
59
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
|
74
60
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
|
75
61
|
implementation project(':capacitor-android')
|
|
76
|
-
implementation('
|
|
62
|
+
implementation('io.boxo.sdk:boxo-android:1.23.0') {
|
|
77
63
|
exclude group: 'com.google.android.gms', module: 'play-services-location'
|
|
78
64
|
}
|
|
79
65
|
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
|
|
@@ -2,15 +2,16 @@ package io.boxo.sdk.capacitor
|
|
|
2
2
|
|
|
3
3
|
import android.os.Handler
|
|
4
4
|
import android.os.Looper
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
5
|
+
import io.boxo.data.models.MiniappData
|
|
6
|
+
import io.boxo.data.models.PageAnimation
|
|
7
|
+
import io.boxo.js.params.CustomEvent
|
|
8
|
+
import io.boxo.js.params.PaymentData
|
|
9
|
+
import io.boxo.sdk.Boxo
|
|
10
|
+
import io.boxo.sdk.Config
|
|
11
|
+
import io.boxo.sdk.Miniapp
|
|
12
|
+
import io.boxo.sdk.MiniappConfig
|
|
13
|
+
import io.boxo.sdk.MiniappListCallback
|
|
14
|
+
import io.boxo.ui.main.BoxoActivity
|
|
14
15
|
import com.getcapacitor.JSArray
|
|
15
16
|
import com.getcapacitor.JSObject
|
|
16
17
|
import com.getcapacitor.Plugin
|
|
@@ -27,7 +28,7 @@ class AppboxoPlugin : Plugin(), Miniapp.LifecycleListener,
|
|
|
27
28
|
|
|
28
29
|
override fun load() {
|
|
29
30
|
super.load()
|
|
30
|
-
|
|
31
|
+
Boxo.init(bridge.activity.application)
|
|
31
32
|
handler = Handler(Looper.getMainLooper())
|
|
32
33
|
}
|
|
33
34
|
|
|
@@ -49,7 +50,7 @@ class AppboxoPlugin : Plugin(), Miniapp.LifecycleListener,
|
|
|
49
50
|
"dark" -> Config.Theme.DARK
|
|
50
51
|
else -> Config.Theme.SYSTEM
|
|
51
52
|
}
|
|
52
|
-
|
|
53
|
+
Boxo
|
|
53
54
|
.setConfig(
|
|
54
55
|
Config.Builder()
|
|
55
56
|
.setClientId(clientId)
|
|
@@ -76,9 +77,12 @@ class AppboxoPlugin : Plugin(), Miniapp.LifecycleListener,
|
|
|
76
77
|
val urlSuffix = call.getString("urlSuffix")
|
|
77
78
|
val colors = call.getObject("colors")
|
|
78
79
|
val enableSplash = call.getBoolean("enableSplash")
|
|
80
|
+
val pageAnimation =
|
|
81
|
+
runCatching { PageAnimation.valueOf(call.getString("pageAnimation") ?: "") }
|
|
82
|
+
.getOrDefault(PageAnimation.BOTTOM_TO_TOP)
|
|
79
83
|
val saveState = call.getBoolean("saveState") ?: true
|
|
80
84
|
handler?.post {
|
|
81
|
-
val miniapp: Miniapp =
|
|
85
|
+
val miniapp: Miniapp = Boxo.getMiniapp(appId)
|
|
82
86
|
.setCustomEventListener(this)
|
|
83
87
|
.setPaymentEventListener(this)
|
|
84
88
|
.setAuthListener(this)
|
|
@@ -113,6 +117,7 @@ class AppboxoPlugin : Plugin(), Miniapp.LifecycleListener,
|
|
|
113
117
|
if (enableSplash != null)
|
|
114
118
|
configBuilder.enableSplash(enableSplash)
|
|
115
119
|
configBuilder.saveState(saveState)
|
|
120
|
+
configBuilder.pageAnimation(pageAnimation)
|
|
116
121
|
miniapp.setConfig(configBuilder.build())
|
|
117
122
|
miniapp.open(bridge.activity)
|
|
118
123
|
}
|
|
@@ -122,18 +127,18 @@ class AppboxoPlugin : Plugin(), Miniapp.LifecycleListener,
|
|
|
122
127
|
fun setAuthCode(call: PluginCall) {
|
|
123
128
|
val appId = call.getString("appId")!!
|
|
124
129
|
val authCode = call.getString("authCode")!!
|
|
125
|
-
|
|
130
|
+
Boxo.getMiniapp(appId)
|
|
126
131
|
.setAuthCode(authCode)
|
|
127
132
|
}
|
|
128
133
|
|
|
129
134
|
@PluginMethod
|
|
130
135
|
fun closeMiniapp(call: PluginCall) {
|
|
131
136
|
val appId = call.getString("appId")!!
|
|
132
|
-
handler?.post {
|
|
137
|
+
handler?.post { Boxo.getExistingMiniapp(appId)?.close() }
|
|
133
138
|
}
|
|
134
139
|
|
|
135
140
|
override fun handle(
|
|
136
|
-
miniAppActivity:
|
|
141
|
+
miniAppActivity: BoxoActivity,
|
|
137
142
|
miniapp: Miniapp,
|
|
138
143
|
customEvent: CustomEvent
|
|
139
144
|
) {
|
|
@@ -193,7 +198,7 @@ class AppboxoPlugin : Plugin(), Miniapp.LifecycleListener,
|
|
|
193
198
|
sendEvent(MINIAPP_LIFECYCLE_EVENT_NAME, params)
|
|
194
199
|
}
|
|
195
200
|
|
|
196
|
-
override fun onAuth(
|
|
201
|
+
override fun onAuth(boxoActivity: BoxoActivity, miniapp: Miniapp) {
|
|
197
202
|
val params = JSObject()
|
|
198
203
|
params.put("appId", miniapp.appId)
|
|
199
204
|
params.put("lifecycle", "onAuth")
|
|
@@ -210,7 +215,7 @@ class AppboxoPlugin : Plugin(), Miniapp.LifecycleListener,
|
|
|
210
215
|
call.getString("errorType"),
|
|
211
216
|
call.getObject("payload")?.toMap() ?: emptyMap()
|
|
212
217
|
)
|
|
213
|
-
handler?.post {
|
|
218
|
+
handler?.post { Boxo.getExistingMiniapp(appId)?.sendEvent(event) }
|
|
214
219
|
} catch (e: Exception) {
|
|
215
220
|
e.printStackTrace()
|
|
216
221
|
}
|
|
@@ -229,7 +234,7 @@ class AppboxoPlugin : Plugin(), Miniapp.LifecycleListener,
|
|
|
229
234
|
call.getString("hostappOrderId") ?: "",
|
|
230
235
|
call.getObject("extraParams")?.toMap()
|
|
231
236
|
)
|
|
232
|
-
handler?.post {
|
|
237
|
+
handler?.post { Boxo.getExistingMiniapp(appId)?.sendPaymentResult(data) }
|
|
233
238
|
} catch (e: Exception) {
|
|
234
239
|
e.printStackTrace()
|
|
235
240
|
}
|
|
@@ -237,7 +242,7 @@ class AppboxoPlugin : Plugin(), Miniapp.LifecycleListener,
|
|
|
237
242
|
|
|
238
243
|
@PluginMethod
|
|
239
244
|
fun getMiniapps(call: PluginCall) {
|
|
240
|
-
|
|
245
|
+
Boxo.getMiniapps(object : MiniappListCallback {
|
|
241
246
|
override fun onSuccess(miniapps: List<MiniappData>) {
|
|
242
247
|
try {
|
|
243
248
|
val list = JSArray()
|
|
@@ -269,12 +274,12 @@ class AppboxoPlugin : Plugin(), Miniapp.LifecycleListener,
|
|
|
269
274
|
|
|
270
275
|
@PluginMethod
|
|
271
276
|
fun hideMiniapps(call: PluginCall) {
|
|
272
|
-
|
|
277
|
+
Boxo.hideMiniapps()
|
|
273
278
|
}
|
|
274
279
|
|
|
275
280
|
@PluginMethod
|
|
276
281
|
fun logout(call: PluginCall) {
|
|
277
|
-
|
|
282
|
+
Boxo.logout()
|
|
278
283
|
}
|
|
279
284
|
|
|
280
285
|
private fun sendEvent(name: String, data: JSObject) {
|
|
@@ -282,7 +287,7 @@ class AppboxoPlugin : Plugin(), Miniapp.LifecycleListener,
|
|
|
282
287
|
}
|
|
283
288
|
|
|
284
289
|
override fun handle(
|
|
285
|
-
|
|
290
|
+
boxoActivity: BoxoActivity,
|
|
286
291
|
miniapp: Miniapp,
|
|
287
292
|
paymentData: PaymentData
|
|
288
293
|
) {
|
package/dist/docs.json
CHANGED
|
@@ -127,7 +127,7 @@
|
|
|
127
127
|
"parameters": [],
|
|
128
128
|
"returns": "Promise<void>",
|
|
129
129
|
"tags": [],
|
|
130
|
-
"docs": "Miniapp opens on a native screen. To show payment processing page need to hide miniapp screen.\nTo use this function need to enable 'enableMultitaskMode: true' in
|
|
130
|
+
"docs": "Miniapp opens on a native screen. To show payment processing page need to hide miniapp screen.\nTo use this function need to enable 'enableMultitaskMode: true' in Boxo.setConfig()",
|
|
131
131
|
"complexTypes": [],
|
|
132
132
|
"slug": "hideminiapps"
|
|
133
133
|
},
|
|
@@ -367,6 +367,13 @@
|
|
|
367
367
|
"docs": "(optional) use to save state on close miniapp",
|
|
368
368
|
"complexTypes": [],
|
|
369
369
|
"type": "boolean | undefined"
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
"name": "pageAnimation",
|
|
373
|
+
"tags": [],
|
|
374
|
+
"docs": "(optional) use to change launch animation for miniapp.",
|
|
375
|
+
"complexTypes": [],
|
|
376
|
+
"type": "'BOTTOM_TO_TOP' | 'TOP_TO_BOTTOM' | 'LEFT_TO_RIGHT' | 'RIGHT_TO_LEFT' | 'FADE_IN' | undefined"
|
|
370
377
|
}
|
|
371
378
|
]
|
|
372
379
|
},
|
|
@@ -611,7 +618,7 @@
|
|
|
611
618
|
{
|
|
612
619
|
"name": "lifecycle",
|
|
613
620
|
"tags": [],
|
|
614
|
-
"docs": "onLaunch - Called when the miniapp will launch with
|
|
621
|
+
"docs": "onLaunch - Called when the miniapp will launch with Boxo.open(...)\nonResume - Called when the miniapp will start interacting with the user\nonPause - Called when the miniapp loses foreground state\nonClose - Called when clicked close button in miniapp or when destroyed miniapp page\nonError - Called when miniapp fails to launch due to internet connection issues\nonUserInteraction - Called whenever touch event is dispatched to the miniapp page.\nonAuth - Called when the miniapp starts login and user allows it",
|
|
615
622
|
"complexTypes": [],
|
|
616
623
|
"type": "string"
|
|
617
624
|
},
|
|
@@ -35,7 +35,7 @@ export interface AppboxoPlugin {
|
|
|
35
35
|
getMiniapps(): Promise<MiniappListResult>;
|
|
36
36
|
/**
|
|
37
37
|
* Miniapp opens on a native screen. To show payment processing page need to hide miniapp screen.
|
|
38
|
-
* To use this function need to enable 'enableMultitaskMode: true' in
|
|
38
|
+
* To use this function need to enable 'enableMultitaskMode: true' in Boxo.setConfig()
|
|
39
39
|
*/
|
|
40
40
|
hideMiniapps(): Promise<void>;
|
|
41
41
|
/**
|
|
@@ -126,6 +126,10 @@ export interface OpenMiniappOptions {
|
|
|
126
126
|
* (optional) use to save state on close miniapp
|
|
127
127
|
*/
|
|
128
128
|
saveState?: boolean;
|
|
129
|
+
/**
|
|
130
|
+
* (optional) use to change launch animation for miniapp.
|
|
131
|
+
*/
|
|
132
|
+
pageAnimation?: 'BOTTOM_TO_TOP' | 'TOP_TO_BOTTOM' | 'LEFT_TO_RIGHT' | 'RIGHT_TO_LEFT' | 'FADE_IN';
|
|
129
133
|
}
|
|
130
134
|
export interface ColorOptions {
|
|
131
135
|
primaryColor?: string;
|
|
@@ -152,7 +156,7 @@ export interface PaymentEvent {
|
|
|
152
156
|
export interface LifecycleEvent {
|
|
153
157
|
appId: string;
|
|
154
158
|
/**
|
|
155
|
-
* onLaunch - Called when the miniapp will launch with
|
|
159
|
+
* onLaunch - Called when the miniapp will launch with Boxo.open(...)
|
|
156
160
|
* onResume - Called when the miniapp will start interacting with the user
|
|
157
161
|
* onPause - Called when the miniapp loses foreground state
|
|
158
162
|
* onClose - Called when clicked close button in miniapp or when destroyed miniapp page
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["import type { PluginListenerHandle } from '@capacitor/core';\n\nexport interface AppboxoPlugin {\n /**\n * Set global configs\n */\n setConfig(options: ConfigOptions): Promise<void>;\n /**\n * Open miniapp with options\n */\n openMiniapp(options: OpenMiniappOptions): Promise<void>;\n /**\n * get AuthCode from hostapp backend and send it to miniapp\n */\n setAuthCode(options: { appId: string; authCode: string }): Promise<void>;\n /**\n * close miniapp by appId\n */\n closeMiniapp(options: { appId: string }): Promise<void>;\n /**\n * send custom event to miniapp\n */\n sendCustomEvent(customEvent: CustomEvent): Promise<void>;\n /**\n * send payment event to miniapp\n */\n sendPaymentEvent(paymentEvent: PaymentEvent): Promise<void>;\n /**\n * Get list of miniapps\n */\n getMiniapps(): Promise<MiniappListResult>;\n /**\n * Miniapp opens on a native screen. To show payment processing page need to hide miniapp screen.\n * To use this function need to enable 'enableMultitaskMode: true' in
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["import type { PluginListenerHandle } from '@capacitor/core';\n\nexport interface AppboxoPlugin {\n /**\n * Set global configs\n */\n setConfig(options: ConfigOptions): Promise<void>;\n /**\n * Open miniapp with options\n */\n openMiniapp(options: OpenMiniappOptions): Promise<void>;\n /**\n * get AuthCode from hostapp backend and send it to miniapp\n */\n setAuthCode(options: { appId: string; authCode: string }): Promise<void>;\n /**\n * close miniapp by appId\n */\n closeMiniapp(options: { appId: string }): Promise<void>;\n /**\n * send custom event to miniapp\n */\n sendCustomEvent(customEvent: CustomEvent): Promise<void>;\n /**\n * send payment event to miniapp\n */\n sendPaymentEvent(paymentEvent: PaymentEvent): Promise<void>;\n /**\n * Get list of miniapps\n */\n getMiniapps(): Promise<MiniappListResult>;\n /**\n * Miniapp opens on a native screen. To show payment processing page need to hide miniapp screen.\n * To use this function need to enable 'enableMultitaskMode: true' in Boxo.setConfig()\n */\n hideMiniapps(): Promise<void>;\n /**\n * When host app user logs out, it is highly important to clear all miniapp storage data.\n */\n addListener(\n eventName: 'custom_event',\n listenerFunc: (customEvent: CustomEvent) => void,\n ): Promise<PluginListenerHandle>;\n\n addListener(\n eventName: 'payment_event',\n listenerFunc: (paymentEvent: PaymentEvent) => void,\n ): Promise<PluginListenerHandle>;\n\n addListener(\n eventName: 'miniapp_lifecycle',\n listenerFunc: (lifecycle: LifecycleEvent) => void,\n ): Promise<PluginListenerHandle>;\n\n logout(): Promise<void>;\n}\n\nexport interface ConfigOptions {\n /**\n * your client id from dashboard\n */\n clientId: string;\n /**\n * hostapp userId, will be used for the Consent Management\n */\n userId?: string;\n /**\n * language value will be passed to the miniapp\n */\n language?: string;\n /**\n * switch to sandbox mode\n */\n sandboxMode?: boolean;\n /**\n * Each miniapp appears as a task in the Recents screen.\n * !It works only on android devices.\n */\n enableMultitaskMode?: boolean;\n /**\n * theme for splash screen and other native components used inside miniapp.\n */\n theme?: 'light' | 'dark' | 'system';\n /**\n * enables webview debugging\n */\n isDebug?: boolean;\n /**\n * use it to hide \"Settings\" from Miniapp menu\n */\n showPermissionsPage?: boolean;\n /**\n * use it to hide \"Clear cache\" from Miniapp menu\n */\n showClearCache?: boolean;\n /**\n * use it to hide \"About Page\" from Miniapp menu\n */\n showAboutPage?: boolean;\n /**\n * use it to change miniapp settings cache time in sec. By default is 60 sec\n */\n miniappSettingsExpirationTime?: number;\n}\n\nexport interface OpenMiniappOptions {\n /**\n * miniapp id\n */\n appId: string;\n /**\n * (optional) data as Map that is sent to miniapp\n */\n data?: object;\n /**\n * (optional) miniapp theme \"dark\" | \"light\" (by default is system theme)\n */\n theme?: 'light' | 'dark' | 'system';\n /**\n * (optional) extra query params to append to miniapp URL (like: http://miniapp-url.com/?param=test)\n */\n extraUrlParams?: object;\n /**\n * (optional) suffix to append to miniapp URL (like: http://miniapp-url.com/?param=test)\n */\n urlSuffix?: string;\n /**\n * (optional) provide colors to miniapp if miniapp supports\n */\n colors?: ColorOptions;\n /**\n * (optional) use to skip miniapp splash screen\n */\n enableSplash?: boolean;\n /**\n * (optional) use to save state on close miniapp\n */\n saveState?: boolean;\n /**\n * (optional) use to change launch animation for miniapp.\n */\n pageAnimation?: 'BOTTOM_TO_TOP' | 'TOP_TO_BOTTOM' | 'LEFT_TO_RIGHT' | 'RIGHT_TO_LEFT' | 'FADE_IN';\n}\n\nexport interface ColorOptions {\n primaryColor?: string;\n secondaryColor?: string;\n tertiaryColor?: string;\n}\n\nexport interface CustomEvent {\n appId: string;\n requestId: number;\n type: string;\n errorType?: string;\n payload?: object;\n}\n\nexport interface PaymentEvent {\n appId: string;\n transactionToken?: string;\n miniappOrderId?: string;\n amount: number;\n currency?: string;\n status?: string;\n hostappOrderId?: string;\n extraParams?: object;\n}\n\nexport interface LifecycleEvent {\n appId: string;\n /**\n * onLaunch - Called when the miniapp will launch with Boxo.open(...)\n * onResume - Called when the miniapp will start interacting with the user\n * onPause - Called when the miniapp loses foreground state\n * onClose - Called when clicked close button in miniapp or when destroyed miniapp page\n * onError - Called when miniapp fails to launch due to internet connection issues\n * onUserInteraction - Called whenever touch event is dispatched to the miniapp page.\n * onAuth - Called when the miniapp starts login and user allows it\n */\n lifecycle: string;\n error?: string;\n}\n\nexport interface MiniappListResult {\n miniapps?: [MiniappData];\n error?: string;\n}\n\nexport interface MiniappData {\n appId: string;\n name: string;\n category: string;\n description: string;\n logo: string;\n}\n"]}
|
package/dist/esm/index.d.ts
CHANGED
package/dist/esm/index.js
CHANGED
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,OAAO,GAAG,cAAc,CAAgB,SAAS,CAAC,CAAC;AAEzD,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,CAAC","sourcesContent":["import { registerPlugin } from '@capacitor/core';\n\nimport type { AppboxoPlugin } from './definitions';\n\nconst Appboxo = registerPlugin<AppboxoPlugin>('Appboxo');\n\nexport * from './definitions';\nexport { Appboxo };\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,IAAI,GAAG,cAAc,CAAgB,SAAS,CAAC,CAAC;AACtD,MAAM,OAAO,GAAG,cAAc,CAAgB,SAAS,CAAC,CAAC;AAEzD,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,CAAC;AACnB,OAAO,EAAE,IAAI,EAAE,CAAC","sourcesContent":["import { registerPlugin } from '@capacitor/core';\n\nimport type { AppboxoPlugin } from './definitions';\n\nconst Boxo = registerPlugin<AppboxoPlugin>('Appboxo');\nconst Appboxo = registerPlugin<AppboxoPlugin>('Appboxo');\n\nexport * from './definitions';\nexport { Appboxo };\nexport { Boxo };\n"]}
|
package/dist/plugin.cjs.js
CHANGED
|
@@ -4,7 +4,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var core = require('@capacitor/core');
|
|
6
6
|
|
|
7
|
+
const Boxo = core.registerPlugin('Appboxo');
|
|
7
8
|
const Appboxo = core.registerPlugin('Appboxo');
|
|
8
9
|
|
|
9
10
|
exports.Appboxo = Appboxo;
|
|
11
|
+
exports.Boxo = Boxo;
|
|
10
12
|
//# sourceMappingURL=plugin.cjs.js.map
|
package/dist/plugin.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.cjs.js","sources":["esm/index.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst Appboxo = registerPlugin('Appboxo');\nexport * from './definitions';\nexport { Appboxo };\n//# sourceMappingURL=index.js.map"],"names":["registerPlugin"],"mappings":";;;;;;AACK,MAAC,OAAO,GAAGA,mBAAc,CAAC,SAAS
|
|
1
|
+
{"version":3,"file":"plugin.cjs.js","sources":["esm/index.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst Boxo = registerPlugin('Appboxo');\nconst Appboxo = registerPlugin('Appboxo');\nexport * from './definitions';\nexport { Appboxo };\nexport { Boxo };\n//# sourceMappingURL=index.js.map"],"names":["registerPlugin"],"mappings":";;;;;;AACK,MAAC,IAAI,GAAGA,mBAAc,CAAC,SAAS,EAAE;AAClC,MAAC,OAAO,GAAGA,mBAAc,CAAC,SAAS;;;;;"}
|
package/dist/plugin.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
var capacitorAppboxo = (function (exports, core) {
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
+
const Boxo = core.registerPlugin('Appboxo');
|
|
4
5
|
const Appboxo = core.registerPlugin('Appboxo');
|
|
5
6
|
|
|
6
7
|
exports.Appboxo = Appboxo;
|
|
8
|
+
exports.Boxo = Boxo;
|
|
7
9
|
|
|
8
10
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
9
11
|
|
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sources":["esm/index.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst Appboxo = registerPlugin('Appboxo');\nexport * from './definitions';\nexport { Appboxo };\n//# sourceMappingURL=index.js.map"],"names":["registerPlugin"],"mappings":";;;AACK,OAAC,OAAO,GAAGA,mBAAc,CAAC,SAAS
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["esm/index.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst Boxo = registerPlugin('Appboxo');\nconst Appboxo = registerPlugin('Appboxo');\nexport * from './definitions';\nexport { Appboxo };\nexport { Boxo };\n//# sourceMappingURL=index.js.map"],"names":["registerPlugin"],"mappings":";;;AACK,OAAC,IAAI,GAAGA,mBAAc,CAAC,SAAS,EAAE;AAClC,OAAC,OAAO,GAAGA,mBAAc,CAAC,SAAS;;;;;;;;;;;;;"}
|
|
@@ -67,6 +67,7 @@ public class AppboxoPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
|
67
67
|
let enableSplash = call.getBool("enableSplash")
|
|
68
68
|
let saveState = call.getBool("saveState", true)
|
|
69
69
|
let urlSuffix = call.getString("urlSuffix", "")
|
|
70
|
+
let pageAnimation = call.getString("pageAnimation", "")
|
|
70
71
|
|
|
71
72
|
let miniApp = Appboxo.shared.getMiniapp(appId: appId)
|
|
72
73
|
miniApp.setData(data: data)
|
|
@@ -76,6 +77,21 @@ public class AppboxoPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
|
76
77
|
miniappConfig.saveState = saveState
|
|
77
78
|
miniappConfig.urlSuffix = urlSuffix
|
|
78
79
|
|
|
80
|
+
switch pageAnimation {
|
|
81
|
+
case "BOTTOM_TO_TOP":
|
|
82
|
+
miniappConfig.pageAnimation = .BOTTOM_TO_TOP
|
|
83
|
+
case "TOP_TO_BOTTOM":
|
|
84
|
+
miniappConfig.pageAnimation = .TOP_TO_BOTTOM
|
|
85
|
+
case "LEFT_TO_RIGHT":
|
|
86
|
+
miniappConfig.pageAnimation = .LEFT_TO_RIGHT
|
|
87
|
+
case "RIGHT_TO_LEFT":
|
|
88
|
+
miniappConfig.pageAnimation = .RIGHT_TO_LEFT
|
|
89
|
+
case "FADE_IN":
|
|
90
|
+
miniappConfig.pageAnimation = .FADE_IN
|
|
91
|
+
default:
|
|
92
|
+
miniappConfig.pageAnimation = .BOTTOM_TO_TOP
|
|
93
|
+
}
|
|
94
|
+
|
|
79
95
|
if let enableSplash = enableSplash {
|
|
80
96
|
miniappConfig.enableSplash(isSplashEnabled: enableSplash)
|
|
81
97
|
}
|