@appboxo/capacitor-boxo-sdk 0.7.0 → 0.8.0

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.
@@ -11,8 +11,8 @@ Pod::Spec.new do |s|
11
11
  s.author = package['author']
12
12
  s.source = { :git => package['repository']['url'], :tag => s.version.to_s }
13
13
  s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}'
14
- s.ios.deployment_target = '13.0'
14
+ s.ios.deployment_target = '14.0'
15
15
  s.dependency 'Capacitor'
16
- s.dependency 'AppBoxoSDK', '1.9.3'
16
+ s.dependency 'BoxoSDK', '1.10.1'
17
17
  s.swift_version = '5.1'
18
18
  end
package/Package.swift CHANGED
@@ -3,14 +3,14 @@ import PackageDescription
3
3
 
4
4
  let package = Package(
5
5
  name: "CapacitorBoxoSdk",
6
- platforms: [.iOS(.v13)],
6
+ platforms: [.iOS(.v14)],
7
7
  products: [
8
8
  .library(
9
9
  name: "CapacitorBoxoSdk",
10
10
  targets: ["AppboxoPlugin"])
11
11
  ],
12
12
  dependencies: [
13
- .package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", branch: "main")
13
+ .package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "7.0.0")
14
14
  ],
15
15
  targets: [
16
16
  .target(
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 Appboxo.setConfigs()
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 | 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 |
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 Appboxo.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 |
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>
@@ -1,20 +1,20 @@
1
1
  ext {
2
2
  junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
3
- androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.6.1'
4
- androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.5'
5
- androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.5.1'
3
+ androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.0'
4
+ androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1'
5
+ androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.1'
6
6
  }
7
7
 
8
8
  buildscript {
9
9
  ext {
10
- kotlin_version = '1.9.22'
10
+ kotlin_version = '1.9.25'
11
11
  }
12
12
  repositories {
13
13
  google()
14
14
  mavenCentral()
15
15
  }
16
16
  dependencies {
17
- classpath 'com.android.tools.build:gradle:8.2.2'
17
+ classpath 'com.android.tools.build:gradle:8.7.2'
18
18
  classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
19
19
  }
20
20
  }
@@ -24,10 +24,10 @@ apply plugin: 'kotlin-android'
24
24
 
25
25
  android {
26
26
  namespace "io.boxo.sdk.capacitor"
27
- compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 34
27
+ compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 35
28
28
  defaultConfig {
29
- minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22
30
- targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 34
29
+ minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 23
30
+ targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 35
31
31
  versionCode 1
32
32
  versionName "1.0"
33
33
  testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@@ -42,11 +42,8 @@ android {
42
42
  abortOnError false
43
43
  }
44
44
  compileOptions {
45
- sourceCompatibility JavaVersion.VERSION_17
46
- targetCompatibility JavaVersion.VERSION_17
47
- }
48
- kotlinOptions {
49
- jvmTarget = '17'
45
+ sourceCompatibility JavaVersion.VERSION_21
46
+ targetCompatibility JavaVersion.VERSION_21
50
47
  }
51
48
  }
52
49
 
@@ -57,9 +54,9 @@ repositories {
57
54
 
58
55
  dependencies {
59
56
  implementation fileTree(dir: 'libs', include: ['*.jar'])
60
- implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
57
+ implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
61
58
  implementation project(':capacitor-android')
62
- implementation('io.boxo.sdk:boxo-android:1.23.0') {
59
+ implementation('io.boxo.sdk:boxo-android:1.26.0') {
63
60
  exclude group: 'com.google.android.gms', module: 'play-services-location'
64
61
  }
65
62
  implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
@@ -3,6 +3,7 @@ package io.boxo.sdk.capacitor
3
3
  import android.os.Handler
4
4
  import android.os.Looper
5
5
  import io.boxo.data.models.MiniappData
6
+ import io.boxo.data.models.PageAnimation
6
7
  import io.boxo.js.params.CustomEvent
7
8
  import io.boxo.js.params.PaymentData
8
9
  import io.boxo.sdk.Boxo
@@ -76,6 +77,9 @@ 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
85
  val miniapp: Miniapp = Boxo.getMiniapp(appId)
@@ -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
  }
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 Appboxo.setConfigs()",
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 Appboxo.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",
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 Appboxo.setConfigs()
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 Appboxo.open(...)
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 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"]}
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"]}
@@ -1,4 +1,6 @@
1
1
  import type { AppboxoPlugin } from './definitions';
2
+ declare const Boxo: AppboxoPlugin;
2
3
  declare const Appboxo: AppboxoPlugin;
3
4
  export * from './definitions';
4
5
  export { Appboxo };
6
+ export { Boxo };
package/dist/esm/index.js CHANGED
@@ -1,5 +1,7 @@
1
1
  import { registerPlugin } from '@capacitor/core';
2
+ const Boxo = registerPlugin('Appboxo');
2
3
  const Appboxo = registerPlugin('Appboxo');
3
4
  export * from './definitions';
4
5
  export { Appboxo };
6
+ export { Boxo };
5
7
  //# sourceMappingURL=index.js.map
@@ -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"]}
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  var core = require('@capacitor/core');
6
4
 
5
+ const Boxo = core.registerPlugin('Appboxo');
7
6
  const Appboxo = core.registerPlugin('Appboxo');
8
7
 
9
8
  exports.Appboxo = Appboxo;
9
+ exports.Boxo = Boxo;
10
10
  //# sourceMappingURL=plugin.cjs.js.map
@@ -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;AAChC,MAAC,OAAO,GAAGA,mBAAc,CAAC,SAAS;;;;;"}
package/dist/plugin.js CHANGED
@@ -1,11 +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;
7
-
8
- Object.defineProperty(exports, '__esModule', { value: true });
8
+ exports.Boxo = Boxo;
9
9
 
10
10
  return exports;
11
11
 
@@ -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;AAChC,OAAC,OAAO,GAAGA,mBAAc,CAAC,SAAS;;;;;;;;;;;"}
@@ -1,6 +1,6 @@
1
1
  import Foundation
2
2
  import Capacitor
3
- import AppBoxoSDK
3
+ import BoxoSDK
4
4
 
5
5
  /**
6
6
  * Please read the Capacitor iOS Plugin Development Guide
@@ -55,7 +55,7 @@ public class AppboxoPlugin: CAPPlugin, CAPBridgedPlugin {
55
55
  config.setUserId(id: userId)
56
56
  config.miniappSettingsExpirationTime = miniappSettingsExpirationTime
57
57
 
58
- Appboxo.shared.setConfig(config: config)
58
+ Boxo.shared.setConfig(config: config)
59
59
  }
60
60
 
61
61
  @objc func openMiniapp(_ call: CAPPluginCall) {
@@ -67,8 +67,9 @@ 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
- let miniApp = Appboxo.shared.getMiniapp(appId: appId)
72
+ let miniApp = Boxo.shared.getMiniapp(appId: appId)
72
73
  miniApp.setData(data: data)
73
74
  miniApp.delegate = self
74
75
 
@@ -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
  }
@@ -115,14 +131,14 @@ public class AppboxoPlugin: CAPPlugin, CAPBridgedPlugin {
115
131
  let authCode = call.getString("authCode") ?? ""
116
132
 
117
133
  DispatchQueue.main.async {
118
- Appboxo.shared.getMiniapp(appId: appId).setAuthCode(authCode: authCode)
134
+ Boxo.shared.getMiniapp(appId: appId).setAuthCode(authCode: authCode)
119
135
  }
120
136
  }
121
137
 
122
138
  @objc func closeMiniapp(_ call: CAPPluginCall) {
123
139
  let appId = call.getString("appId") ?? ""
124
140
 
125
- if let miniapp = Appboxo.shared.getExistingMiniapp(appId: appId) {
141
+ if let miniapp = Boxo.shared.getExistingMiniapp(appId: appId) {
126
142
  DispatchQueue.main.async {
127
143
  miniapp.close()
128
144
  }
@@ -139,7 +155,7 @@ public class AppboxoPlugin: CAPPlugin, CAPBridgedPlugin {
139
155
  customEvent.payload = call.getObject("payload")?.toMap()
140
156
 
141
157
  DispatchQueue.main.async {
142
- Appboxo.shared.getMiniapp(appId: appId).sendCustomEvent(customEvent: customEvent)
158
+ Boxo.shared.getMiniapp(appId: appId).sendCustomEvent(customEvent: customEvent)
143
159
  }
144
160
  }
145
161
 
@@ -156,12 +172,12 @@ public class AppboxoPlugin: CAPPlugin, CAPBridgedPlugin {
156
172
  paymentData.extraParams = call.getObject("extraParams")?.toMap()
157
173
 
158
174
  DispatchQueue.main.async {
159
- Appboxo.shared.getMiniapp(appId: appId).sendPaymentEvent(paymentData: paymentData)
175
+ Boxo.shared.getMiniapp(appId: appId).sendPaymentEvent(paymentData: paymentData)
160
176
  }
161
177
  }
162
178
 
163
179
  @objc func getMiniapps(_ call: CAPPluginCall) {
164
- Appboxo.shared.getMiniapps { miniapps, error in
180
+ Boxo.shared.getMiniapps { miniapps, error in
165
181
  if let error = error {
166
182
  call.reject(error)
167
183
  } else {
@@ -183,13 +199,13 @@ public class AppboxoPlugin: CAPPlugin, CAPBridgedPlugin {
183
199
 
184
200
  @objc func hideMiniapps(_ call: CAPPluginCall) {
185
201
  DispatchQueue.main.async {
186
- Appboxo.shared.hideMiniapps()
202
+ Boxo.shared.hideMiniapps()
187
203
  }
188
204
  }
189
205
 
190
206
  @objc func logout(_ call: CAPPluginCall) {
191
207
  DispatchQueue.main.async {
192
- Appboxo.shared.logout()
208
+ Boxo.shared.logout()
193
209
  }
194
210
  }
195
211
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appboxo/capacitor-boxo-sdk",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
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",
@@ -37,32 +37,32 @@
37
37
  "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint",
38
38
  "fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format",
39
39
  "eslint": "eslint . --ext ts",
40
- "prettier": "prettier \"**/*.{css,html,ts,js,java}\"",
40
+ "prettier": "prettier \"**/*.{css,html,ts,js,java}\" --plugin=prettier-plugin-java",
41
41
  "swiftlint": "node-swiftlint",
42
42
  "docgen": "docgen --api AppboxoPlugin --output-readme README.md --output-json dist/docs.json",
43
- "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js",
43
+ "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs",
44
44
  "clean": "rimraf ./dist",
45
45
  "watch": "tsc --watch",
46
46
  "prepublishOnly": "npm run build"
47
47
  },
48
48
  "devDependencies": {
49
- "@capacitor/android": "^6.0.0",
50
- "@capacitor/core": "^6.0.0",
51
- "@capacitor/docgen": "^0.2.2",
52
- "@capacitor/ios": "^6.0.0",
49
+ "@capacitor/android": "^7.0.0",
50
+ "@capacitor/core": "^7.0.0",
51
+ "@capacitor/docgen": "^0.3.0",
52
+ "@capacitor/ios": "^7.0.0",
53
53
  "@ionic/eslint-config": "^0.4.0",
54
- "@ionic/prettier-config": "^1.0.1",
55
- "@ionic/swiftlint-config": "^1.1.2",
54
+ "@ionic/prettier-config": "^4.0.0",
55
+ "@ionic/swiftlint-config": "^2.0.0",
56
56
  "eslint": "^8.57.0",
57
- "prettier": "~2.3.0",
58
- "prettier-plugin-java": "~1.0.2",
59
- "rimraf": "^3.0.2",
60
- "rollup": "^2.32.0",
61
- "swiftlint": "^1.0.1",
57
+ "prettier": "^3.4.2",
58
+ "prettier-plugin-java": "^2.6.6",
59
+ "rimraf": "^6.0.1",
60
+ "rollup": "^4.30.1",
61
+ "swiftlint": "^2.0.0",
62
62
  "typescript": "~4.1.5"
63
63
  },
64
64
  "peerDependencies": {
65
- "@capacitor/core": "^6.0.0"
65
+ "@capacitor/core": ">=7.0.0"
66
66
  },
67
67
  "prettier": "@ionic/prettier-config",
68
68
  "swiftlint": "@ionic/swiftlint-config",