@appboxo/capacitor-boxo-sdk 0.2.7 → 0.2.8

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.
@@ -13,6 +13,6 @@ Pod::Spec.new do |s|
13
13
  s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}'
14
14
  s.ios.deployment_target = '13.0'
15
15
  s.dependency 'Capacitor'
16
- s.dependency 'AppBoxoSDK', '1.7.1'
16
+ s.dependency 'AppBoxoSDK', '1.7.2'
17
17
  s.swift_version = '5.1'
18
18
  end
package/README.md CHANGED
@@ -211,18 +211,19 @@ logout() => Promise<void>
211
211
 
212
212
  #### ConfigOptions
213
213
 
214
- | Prop | Type | Description |
215
- | ------------------------- | ------------------------------------------ | ---------------------------------------------------------------------------------------- |
216
- | **`clientId`** | <code>string</code> | your client id from dashboard |
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 |
219
- | **`sandboxMode`** | <code>boolean</code> | switch to sandbox mode |
220
- | **`enableMultitaskMode`** | <code>boolean</code> | Each miniapp appears as a task in the Recents screen. !It works only on android devices. |
221
- | **`theme`** | <code>'light' \| 'dark' \| 'system'</code> | theme for splash screen and other native components used inside miniapp. |
222
- | **`isDebug`** | <code>boolean</code> | enables webview debugging |
223
- | **`showPermissionsPage`** | <code>boolean</code> | use it to hide "Settings" from Miniapp menu |
224
- | **`showClearCache`** | <code>boolean</code> | use it to hide "Clear cache" from Miniapp menu |
225
- | **`showAboutPage`** | <code>boolean</code> | use it to hide "About Page" from Miniapp menu |
214
+ | Prop | Type | Description |
215
+ | ----------------------------------- | ------------------------------------------ | ---------------------------------------------------------------------------------------- |
216
+ | **`clientId`** | <code>string</code> | your client id from dashboard |
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 |
219
+ | **`sandboxMode`** | <code>boolean</code> | switch to sandbox mode |
220
+ | **`enableMultitaskMode`** | <code>boolean</code> | Each miniapp appears as a task in the Recents screen. !It works only on android devices. |
221
+ | **`theme`** | <code>'light' \| 'dark' \| 'system'</code> | theme for splash screen and other native components used inside miniapp. |
222
+ | **`isDebug`** | <code>boolean</code> | enables webview debugging |
223
+ | **`showPermissionsPage`** | <code>boolean</code> | use it to hide "Settings" from Miniapp menu |
224
+ | **`showClearCache`** | <code>boolean</code> | use it to hide "Clear cache" from Miniapp menu |
225
+ | **`showAboutPage`** | <code>boolean</code> | use it to hide "About Page" from Miniapp menu |
226
+ | **`miniappSettingsExpirationTime`** | <code>number</code> | use it to change miniapp settings cache time in sec. By default is 60 sec |
226
227
 
227
228
 
228
229
  #### OpenMiniappOptions
@@ -43,6 +43,7 @@ class AppboxoPlugin : Plugin(), Miniapp.LifecycleListener,
43
43
  val showPermissionsPage = call.getBoolean("showPermissionsPage", true)!!
44
44
  val showClearCache = call.getBoolean("showClearCache", true)!!
45
45
  val showAboutPage = call.getBoolean("showAboutPage", true)!!
46
+ val miniappSettingsExpirationTime = call.getInt("miniappSettingsExpirationTime", 60)!!
46
47
  val globalTheme: Config.Theme = when (theme) {
47
48
  "light" -> Config.Theme.LIGHT
48
49
  "dark" -> Config.Theme.DARK
@@ -60,6 +61,7 @@ class AppboxoPlugin : Plugin(), Miniapp.LifecycleListener,
60
61
  .permissionsPage(showPermissionsPage)
61
62
  .showClearCache(showClearCache)
62
63
  .showAboutPage(showAboutPage)
64
+ .setMiniappSettingsExpirationTime(miniappSettingsExpirationTime)
63
65
  .debug(isDebug)
64
66
  .build()
65
67
  )
package/dist/docs.json CHANGED
@@ -293,6 +293,13 @@
293
293
  "docs": "use it to hide \"About Page\" from Miniapp menu",
294
294
  "complexTypes": [],
295
295
  "type": "boolean | undefined"
296
+ },
297
+ {
298
+ "name": "miniappSettingsExpirationTime",
299
+ "tags": [],
300
+ "docs": "use it to change miniapp settings cache time in sec. By default is 60 sec",
301
+ "complexTypes": [],
302
+ "type": "number | undefined"
296
303
  }
297
304
  ]
298
305
  },
@@ -88,6 +88,10 @@ export interface ConfigOptions {
88
88
  * use it to hide "About Page" from Miniapp menu
89
89
  */
90
90
  showAboutPage?: boolean;
91
+ /**
92
+ * use it to change miniapp settings cache time in sec. By default is 60 sec
93
+ */
94
+ miniappSettingsExpirationTime?: number;
91
95
  }
92
96
  export interface OpenMiniappOptions {
93
97
  /**
@@ -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 * 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\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\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 * 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\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"]}
@@ -35,6 +35,7 @@ public class AppboxoPlugin: CAPPlugin, CAPBridgedPlugin {
35
35
  let showPermissionsPage = call.getBool("showPermissionsPage", true)
36
36
  let showClearCache = call.getBool("showClearCache", true)
37
37
  let showAboutPage = call.getBool("showAboutPage", true)
38
+ let miniappSettingsExpirationTime = call.getInt("miniappSettingsExpirationTime", 60)
38
39
  var globalTheme : Theme = .System
39
40
  switch (theme) {
40
41
  case "dark":
@@ -52,6 +53,7 @@ public class AppboxoPlugin: CAPPlugin, CAPBridgedPlugin {
52
53
  config.showClearCache = showClearCache
53
54
  config.showAboutPage = showAboutPage
54
55
  config.setUserId(id: userId)
56
+ config.miniappSettingsExpirationTime = miniappSettingsExpirationTime
55
57
 
56
58
  Appboxo.shared.setConfig(config: config)
57
59
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appboxo/capacitor-boxo-sdk",
3
- "version": "0.2.7",
3
+ "version": "0.2.8",
4
4
  "description": "A capacitor wrapper over Appboxo SDK for IOS and Android.",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",