@appboxo/react-native-sdk 1.1.3 → 1.2.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.
@@ -137,7 +137,7 @@ dependencies {
137
137
  implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
138
138
  //noinspection GradleDynamicVersion
139
139
  implementation 'com.facebook.react:react-native:+' // From node_modules
140
- implementation('com.appboxo:sdk:1.5.21') {
140
+ implementation('com.appboxo:sdk:1.6.0') {
141
141
  exclude group: 'com.google.android.gms', module: 'play-services-location'
142
142
  }
143
143
  }
@@ -61,7 +61,8 @@ class RnappboxosdkModule(reactContext: ReactApplicationContext) :
61
61
  theme: String?,
62
62
  isDebug: Boolean,
63
63
  showPermissionsPage: Boolean,
64
- showClearCache: Boolean
64
+ showClearCache: Boolean,
65
+ showAboutPage: Boolean
65
66
  ) {
66
67
  val globalTheme: Config.Theme = when (theme) {
67
68
  "light" -> Config.Theme.LIGHT
@@ -79,6 +80,7 @@ class RnappboxosdkModule(reactContext: ReactApplicationContext) :
79
80
  .setLanguage(language)
80
81
  .permissionsPage(showPermissionsPage)
81
82
  .showClearCache(showClearCache)
83
+ .showAboutPage(showAboutPage)
82
84
  .debug(isDebug)
83
85
  .build()
84
86
  )
@@ -95,42 +97,44 @@ class RnappboxosdkModule(reactContext: ReactApplicationContext) :
95
97
  enableSplash: Boolean,
96
98
  saveState:Boolean
97
99
  ) {
98
- val miniapp: Miniapp = Appboxo.getMiniapp(appId)
99
- .setCustomEventListener(this)
100
- .setPaymentEventListener(this)
101
- .setAuthListener(this)
102
- .setLifecycleListener(this)
103
- if (data != null) miniapp.setData(MapUtil.toMap(data))
104
- val configBuilder = MiniappConfig.Builder()
105
- if (theme != null) {
106
- val miniappTheme: Config.Theme? = when (theme) {
107
- "light" -> Config.Theme.LIGHT
108
- "dark" -> Config.Theme.DARK
109
- "system" -> Config.Theme.SYSTEM
110
- else -> null
100
+ handler.post {
101
+ val miniapp: Miniapp = Appboxo.getMiniapp(appId)
102
+ .setCustomEventListener(this)
103
+ .setPaymentEventListener(this)
104
+ .setAuthListener(this)
105
+ .setLifecycleListener(this)
106
+ if (data != null) miniapp.setData(MapUtil.toMap(data))
107
+ val configBuilder = MiniappConfig.Builder()
108
+ if (theme != null) {
109
+ val miniappTheme: Config.Theme? = when (theme) {
110
+ "light" -> Config.Theme.LIGHT
111
+ "dark" -> Config.Theme.DARK
112
+ "system" -> Config.Theme.SYSTEM
113
+ else -> null
114
+ }
115
+ if (miniappTheme != null) {
116
+ configBuilder.setTheme(miniappTheme)
117
+ }
111
118
  }
112
- if (miniappTheme != null) {
113
- configBuilder.setTheme(miniappTheme)
119
+ if (extraUrlParams != null) {
120
+ val map: Map<String, Any> = MapUtil.toMap(extraUrlParams)
121
+ val stringMap: MutableMap<String, String> = HashMap()
122
+ for ((key, value) in map) stringMap[key] = value.toString()
123
+ configBuilder.setExtraUrlParams(stringMap)
114
124
  }
125
+ urlSuffix?.also { suffix -> configBuilder.setUrlSuffix(suffix) }
126
+ if (colors != null) {
127
+ configBuilder.setColors(
128
+ colors.getString("primaryColor") ?: "",
129
+ colors.getString("secondaryColor") ?: "",
130
+ colors.getString("tertiaryColor") ?: "",
131
+ )
132
+ }
133
+ configBuilder.enableSplash(enableSplash)
134
+ configBuilder.saveState(saveState)
135
+ miniapp.setConfig(configBuilder.build())
136
+ miniapp.open(reactContext)
115
137
  }
116
- if (extraUrlParams != null) {
117
- val map: Map<String, Any> = MapUtil.toMap(extraUrlParams)
118
- val stringMap: MutableMap<String, String> = HashMap()
119
- for ((key, value) in map) stringMap[key] = value.toString()
120
- configBuilder.setExtraUrlParams(stringMap)
121
- }
122
- urlSuffix?.also { suffix -> configBuilder.setUrlSuffix(suffix) }
123
- if (colors != null) {
124
- configBuilder.setColors(
125
- colors.getString("primaryColor") ?: "",
126
- colors.getString("secondaryColor") ?: "",
127
- colors.getString("tertiaryColor") ?: "",
128
- )
129
- }
130
- configBuilder.enableSplash(enableSplash)
131
- configBuilder.saveState(saveState)
132
- miniapp.setConfig(configBuilder.build())
133
- miniapp.open(reactContext)
134
138
  }
135
139
 
136
140
  @ReactMethod
package/index.d.ts CHANGED
@@ -37,7 +37,8 @@ declare module '@appboxo/react-native-sdk' {
37
37
  theme?: 'dark' | 'light',
38
38
  isDebug?: boolean,
39
39
  showPermissionsPage? : boolean,
40
- showClearCache?: boolean
40
+ showClearCache?: boolean,
41
+ showAboutPage?: boolean
41
42
  }
42
43
  ): void
43
44
 
@@ -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)
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)
36
36
  {
37
37
  NSArray *themes = @[@"dark", @"light", @"system"];
38
38
 
@@ -48,6 +48,7 @@ RCT_EXPORT_METHOD(setConfig:(NSString *)clientId userId:(NSString *)userId langu
48
48
  config.sandboxMode = sandboxMode;
49
49
  config.permissionsPage = showPermissionsPage;
50
50
  config.showClearCache = showClearCache;
51
+ config.showAboutPage = showAboutPage;
51
52
 
52
53
  [[Appboxo shared] setConfig: config];
53
54
  }
@@ -63,6 +64,10 @@ RCT_EXPORT_METHOD(openMiniapp:(NSString *)appId data:(nullable NSDictionary<NSSt
63
64
  [miniappConfig enableSplash: enableSplash];
64
65
  [miniappConfig setExtraParams:extraUrlParams];
65
66
  miniappConfig.saveState = saveState;
67
+
68
+ if (urlSuffix != NULL) {
69
+ miniappConfig.urlSuffix = urlSuffix;
70
+ }
66
71
 
67
72
  if (theme != NULL) {
68
73
  NSArray *themes = @[@"dark", @"light", @"system"];
package/js/mSetConfig.js CHANGED
@@ -13,7 +13,8 @@ const mSetConfig = (clientId, options) => {
13
13
  options?.theme === 'dark' || options?.theme === 'light' ? options?.theme : 'system',
14
14
  options?.isDebug ?? false,
15
15
  options?.showPermissionsPage ?? true,
16
- options?.showClearCache ?? true
16
+ options?.showClearCache ?? true,
17
+ options?.showAboutPage ?? true
17
18
  )
18
19
  }
19
20
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@appboxo/react-native-sdk",
3
3
  "title": "Appboxo react native sdk",
4
- "version": "1.1.3",
4
+ "version": "1.2.0",
5
5
  "description": "Appboxo react native sdk",
6
6
  "main": "index.js",
7
7
  "files": [
@@ -22,7 +22,7 @@ Pod::Spec.new do |s|
22
22
  s.requires_arc = true
23
23
 
24
24
  s.dependency "React"
25
- s.dependency 'AppBoxoSDK', '1.5.15'
25
+ s.dependency 'AppBoxoSDK', '1.5.16'
26
26
  # ...
27
27
  # s.dependency "..."
28
28
  end