@appboxo/capacitor-boxo-sdk 0.1.1 → 0.1.3
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 +1 -0
- package/android/build.gradle +1 -1
- package/android/src/main/java/io/boxo/sdk/capacitor/AppboxoPlugin.kt +2 -0
- package/dist/docs.json +7 -0
- package/dist/esm/definitions.d.ts +4 -0
- package/dist/esm/definitions.js.map +1 -1
- package/ios/Sources/AppboxoPlugin/AppboxoPlugin.swift +2 -0
- package/package.json +1 -1
package/CapacitorBoxoSdk.podspec
CHANGED
package/README.md
CHANGED
|
@@ -215,6 +215,7 @@ logout() => Promise<void>
|
|
|
215
215
|
| ------------------------- | ------------------------------------------ | ---------------------------------------------------------------------------------------- |
|
|
216
216
|
| **`clientId`** | <code>string</code> | your client id from dashboard |
|
|
217
217
|
| **`userId`** | <code>string</code> | hostapp userId, will be used for the Consent Management |
|
|
218
|
+
| **`language`** | <code>string</code> | language value will be passed to the miniapp |
|
|
218
219
|
| **`sandboxMode`** | <code>boolean</code> | switch to sandbox mode |
|
|
219
220
|
| **`enableMultitaskMode`** | <code>boolean</code> | Each miniapp appears as a task in the Recents screen. !It works only on android devices. |
|
|
220
221
|
| **`theme`** | <code>'light' \| 'dark' \| 'system'</code> | theme for splash screen and other native components used inside miniapp. |
|
package/android/build.gradle
CHANGED
|
@@ -73,7 +73,7 @@ dependencies {
|
|
|
73
73
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
|
74
74
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
|
75
75
|
implementation project(':capacitor-android')
|
|
76
|
-
implementation('com.appboxo:sdk:1.5.
|
|
76
|
+
implementation('com.appboxo:sdk:1.5.16') {
|
|
77
77
|
exclude group: 'com.google.android.gms', module: 'play-services-location'
|
|
78
78
|
}
|
|
79
79
|
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
|
|
@@ -35,6 +35,7 @@ class AppboxoPlugin : Plugin(), Miniapp.LifecycleListener,
|
|
|
35
35
|
fun setConfig(call: PluginCall) {
|
|
36
36
|
val clientId = call.getString("clientId")!!
|
|
37
37
|
val userId = call.getString("userId") ?: ""
|
|
38
|
+
val language = call.getString("language") ?: "en"
|
|
38
39
|
val sandboxMode = call.getBoolean("sandboxMde", false)!!
|
|
39
40
|
val enableMultitaskMode = call.getBoolean("enableMultitaskMode", false)!!
|
|
40
41
|
val theme = call.getString("theme", "system")!!
|
|
@@ -54,6 +55,7 @@ class AppboxoPlugin : Plugin(), Miniapp.LifecycleListener,
|
|
|
54
55
|
.sandboxMode(sandboxMode)
|
|
55
56
|
.multitaskMode(enableMultitaskMode)
|
|
56
57
|
.setTheme(globalTheme)
|
|
58
|
+
.setLanguage(language)
|
|
57
59
|
.permissionsPage(showPermissionsPage)
|
|
58
60
|
.showClearCache(showClearCache)
|
|
59
61
|
.debug(isDebug)
|
package/dist/docs.json
CHANGED
|
@@ -238,6 +238,13 @@
|
|
|
238
238
|
"complexTypes": [],
|
|
239
239
|
"type": "string | undefined"
|
|
240
240
|
},
|
|
241
|
+
{
|
|
242
|
+
"name": "language",
|
|
243
|
+
"tags": [],
|
|
244
|
+
"docs": "language value will be passed to the miniapp",
|
|
245
|
+
"complexTypes": [],
|
|
246
|
+
"type": "string | undefined"
|
|
247
|
+
},
|
|
241
248
|
{
|
|
242
249
|
"name": "sandboxMode",
|
|
243
250
|
"tags": [],
|
|
@@ -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 Appboxo.setConfigs()\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 * 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\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\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 Appboxo.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"]}
|
|
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 Appboxo.setConfigs()\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\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\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 Appboxo.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"]}
|
|
@@ -29,6 +29,7 @@ public class AppboxoPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
|
29
29
|
@objc func setConfig(_ call: CAPPluginCall) {
|
|
30
30
|
let clientId = call.getString("clientId") ?? ""
|
|
31
31
|
let userId = call.getString("userId") ?? ""
|
|
32
|
+
let language = call.getString("language") ?? "en"
|
|
32
33
|
let sandboxMode = call.getBool("sandboxMde", false)
|
|
33
34
|
let theme = call.getString("theme", "system")
|
|
34
35
|
let showPermissionsPage = call.getBool("showPermissionsPage", true)
|
|
@@ -44,6 +45,7 @@ public class AppboxoPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
|
44
45
|
}
|
|
45
46
|
|
|
46
47
|
let config = Config(clientId: clientId, theme: globalTheme)
|
|
48
|
+
config.language = language
|
|
47
49
|
config.sandboxMode = sandboxMode
|
|
48
50
|
config.permissionsPage = showPermissionsPage
|
|
49
51
|
config.showClearCache = showClearCache
|