@appboxo/react-native-sdk 1.11.1 → 1.12.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.
package/README.md CHANGED
@@ -26,7 +26,7 @@ import { StyleSheet, View, Button } from 'react-native';
26
26
  export default function App() {
27
27
 
28
28
  React.useEffect(() => {
29
- Boxo.setConfig('[client_id]', false, false); //set your Boxo client_id, sandbox mode (by default is "false") and specify multitask mode (by default is "true")
29
+ Boxo.setConfig('[client_id]', false); //set your Boxo client_id, sandbox mode (by default is "false")
30
30
  }, [])
31
31
 
32
32
  const handleOpenMiniapp = () => {
@@ -69,7 +69,7 @@ import { StyleSheet, View, Button } from 'react-native';
69
69
  export default function App() {
70
70
 
71
71
  React.useEffect(() => {
72
- Boxo.setConfig('[client_id]', false, false); //set your Boxo client_id, sandbox mode and specify multitask mode (by default is "true")
72
+ Boxo.setConfig('[client_id]', false); //set your Boxo client_id, sandbox mode
73
73
 
74
74
  const subscription = Boxo.lifecycleHooksListener({
75
75
  onLaunch: (appId: string) => console.log('onLaunch', appId), // called when the miniapp will launch with openMiniapp(...)
@@ -123,5 +123,5 @@ dependencies {
123
123
  implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
124
124
  //noinspection GradleDynamicVersion
125
125
  implementation 'com.facebook.react:react-native:+' // From node_modules
126
- implementation('io.boxo.sdk:boxo-android:1.39.1')
126
+ implementation('io.boxo.sdk:boxo-android:1.40.2')
127
127
  }
@@ -19,6 +19,7 @@ import android.app.Application
19
19
  import android.os.Handler
20
20
  import android.os.Looper
21
21
  import android.graphics.Color
22
+ import androidx.fragment.app.FragmentActivity
22
23
  import io.boxo.data.models.MiniappData
23
24
  import io.boxo.data.models.PageAnimation
24
25
  import io.boxo.js.params.CustomEvent
@@ -28,7 +29,7 @@ import io.boxo.sdk.Config
28
29
  import io.boxo.sdk.Miniapp
29
30
  import io.boxo.sdk.MiniappConfig
30
31
  import io.boxo.sdk.MiniappListCallback
31
- import io.boxo.ui.main.BoxoActivity
32
+ import io.boxo.ui.main.BoxoFragment
32
33
  import com.appboxo.react.utils.MapUtil
33
34
  import com.facebook.react.bridge.Arguments
34
35
  import com.facebook.react.bridge.ReactApplicationContext
@@ -59,7 +60,6 @@ class RnappboxosdkModule(reactContext: ReactApplicationContext) :
59
60
  userId: String,
60
61
  language: String,
61
62
  sandboxMode: Boolean,
62
- enableMultitaskMode: Boolean,
63
63
  theme: String?,
64
64
  isDebug: Boolean,
65
65
  showPermissionsPage: Boolean,
@@ -78,7 +78,6 @@ class RnappboxosdkModule(reactContext: ReactApplicationContext) :
78
78
  .setClientId(clientId)
79
79
  .setUserId(userId)
80
80
  .sandboxMode(sandboxMode)
81
- .multitaskMode(enableMultitaskMode)
82
81
  .setTheme(globalTheme)
83
82
  .setLanguage(language)
84
83
  .permissionsPage(showPermissionsPage)
@@ -86,7 +85,7 @@ class RnappboxosdkModule(reactContext: ReactApplicationContext) :
86
85
  .showAboutPage(showAboutPage)
87
86
  .debug(isDebug)
88
87
  .apply {
89
- splashScreenOptions?.also { options->
88
+ splashScreenOptions?.also { options ->
90
89
  setProgressBarColors(
91
90
  lightIndicator =
92
91
  Color.parseColor(options.getString("lightProgressIndicator")),
@@ -159,7 +158,7 @@ class RnappboxosdkModule(reactContext: ReactApplicationContext) :
159
158
  configBuilder.enableSplash(enableSplash)
160
159
  configBuilder.saveState(saveState)
161
160
  miniapp.setConfig(configBuilder.build())
162
- miniapp.open(reactContext)
161
+ miniapp.open(reactContext.currentActivity as FragmentActivity)
163
162
  }
164
163
  }
165
164
 
@@ -181,7 +180,7 @@ class RnappboxosdkModule(reactContext: ReactApplicationContext) :
181
180
  }
182
181
 
183
182
  override fun handle(
184
- boxoActivity: BoxoActivity,
183
+ fragment: BoxoFragment,
185
184
  miniapp: Miniapp,
186
185
  customEvent: CustomEvent
187
186
  ) {
@@ -246,7 +245,7 @@ class RnappboxosdkModule(reactContext: ReactApplicationContext) :
246
245
  sendEvent(MINIAPP_LIFECYCLE_EVENT_NAME, params)
247
246
  }
248
247
 
249
- override fun onAuth(boxoActivity: BoxoActivity, miniapp: Miniapp) {
248
+ override fun onAuth(fragment: BoxoFragment, miniapp: Miniapp) {
250
249
  val params: WritableMap = Arguments.createMap()
251
250
  params.putString("app_id", miniapp.appId)
252
251
  params.putString("lifecycle", "onAuth")
@@ -352,7 +351,7 @@ class RnappboxosdkModule(reactContext: ReactApplicationContext) :
352
351
  }
353
352
 
354
353
  override fun handle(
355
- boxoActivity: BoxoActivity,
354
+ fragment: BoxoFragment,
356
355
  miniapp: Miniapp,
357
356
  paymentData: PaymentData
358
357
  ) {
package/index.d.ts CHANGED
@@ -24,7 +24,6 @@ declare module '@appboxo/react-native-sdk' {
24
24
  * @param {object} options - Boxo global config
25
25
  * userId - hostapp userId for consent management
26
26
  * sandboxMode (by default false)
27
- * enableMultitaskMode Enable multiscreen mode (by default true)
28
27
  * theme {'dark' | 'light'} theme Miniapp theme (by default 'system')
29
28
  * */
30
29
  export function setConfig(
@@ -33,7 +32,6 @@ declare module '@appboxo/react-native-sdk' {
33
32
  userId?: string,
34
33
  language?: string,
35
34
  sandboxMode?: boolean,
36
- enableMultitaskMode?: boolean,
37
35
  theme?: 'dark' | 'light',
38
36
  isDebug?: boolean,
39
37
  showPermissionsPage? : boolean,
@@ -32,7 +32,7 @@ limitations under the License.
32
32
  RCT_EXPORT_MODULE()
33
33
 
34
34
 
35
- RCT_EXPORT_METHOD(setConfig:(NSString *)clientId userId:(NSString *)userId language:(NSString *)language sandboxMode:(BOOL)sandboxMode enableMultitaskMode:(BOOL)enableMultitaskMode theme:(NSString *)theme isDebug:(BOOL)isDebug showPermissionsPage:(BOOL)showPermissionsPage showClearCache:(BOOL)showClearCache showAboutPage:(BOOL)showAboutPage splashScreenOptions:(nullable NSDictionary<NSString *, id> *)splashScreenOptions)
35
+ RCT_EXPORT_METHOD(setConfig:(NSString *)clientId userId:(NSString *)userId language:(NSString *)language sandboxMode:(BOOL)sandboxMode theme:(NSString *)theme isDebug:(BOOL)isDebug showPermissionsPage:(BOOL)showPermissionsPage showClearCache:(BOOL)showClearCache showAboutPage:(BOOL)showAboutPage splashScreenOptions:(nullable NSDictionary<NSString *, id> *)splashScreenOptions)
36
36
  {
37
37
  NSArray *themes = @[@"dark", @"light", @"system"];
38
38
 
@@ -27,9 +27,7 @@ const lifecycleHooksListener = (callbacks) => {
27
27
  const appboxoCustomEventEmitter = new NativeEventEmitter(NativeModules.Rnappboxosdk)
28
28
  const appboxoEventListener =
29
29
  appboxoCustomEventEmitter.addListener('appboxo_miniapp_lifecycle', (event) =>
30
- callbacks[event.lifecycle] ?
31
- callbacks[event.lifecycle](event.app_id, event.error) :
32
- callbacks['onError'](event.app_id, 'Incorrect lifecycle')
30
+ callbacks[event.lifecycle]?.(event.app_id, event.error)
33
31
  )
34
32
  return () => appboxoEventListener.remove()
35
33
  }
package/js/mSetConfig.js CHANGED
@@ -9,7 +9,6 @@ const mSetConfig = (clientId, options) => {
9
9
  options?.userId ?? '',
10
10
  options?.language ?? 'en',
11
11
  options?.sandboxMode ?? false,
12
- options?.enableMultitaskMode ?? true,
13
12
  options?.theme === 'dark' || options?.theme === 'light' ? options?.theme : 'system',
14
13
  options?.isDebug ?? false,
15
14
  options?.showPermissionsPage ?? true,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@appboxo/react-native-sdk",
3
3
  "title": "BoxoSDK for React Native",
4
- "version": "1.11.1",
4
+ "version": "1.12.0",
5
5
  "description": "BoxoSDK plugin for react native",
6
6
  "main": "index.js",
7
7
  "files": [