@appboxo/react-native-sdk 1.0.40 → 1.1.1
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/CHANGELOG.md +15 -0
- package/android/build.gradle +17 -10
- package/android/gradle/wrapper/gradle-wrapper.properties +3 -2
- package/android/src/main/AndroidManifest.xml +1 -2
- package/android/src/main/java/com/appboxo/{RnappboxosdkModule.kt → react/RnappboxosdkModule.kt} +10 -4
- package/android/src/main/java/com/appboxo/{RnappboxosdkPackage.kt → react/RnappboxosdkPackage.kt} +1 -1
- package/android/src/main/java/com/appboxo/{utils → react/utils}/ArrayUtil.java +1 -1
- package/android/src/main/java/com/appboxo/{utils → react/utils}/MapUtil.java +1 -1
- package/index.d.ts +6 -2
- package/ios/Rnappboxosdk.m +6 -3
- package/js/mOpenMiniapp.js +2 -1
- package/js/mSetConfig.js +3 -1
- package/package.json +1 -1
- package/react-native-appboxosdk.podspec +1 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
## [1.1.1]
|
|
3
|
+
- add enableSplash param to openMiniapp
|
|
4
|
+
|
|
5
|
+
## [1.1.0]
|
|
6
|
+
- native android sdk ver. 1.5.16
|
|
7
|
+
- native ios sdk ver. 1.5.11
|
|
8
|
+
- add Consent Management
|
|
9
|
+
- add language support
|
|
10
|
+
- add sandbox mode
|
|
11
|
+
- save state when user close the miniapp
|
|
12
|
+
|
|
13
|
+
## [1.0.40] - 2023-11-24
|
|
14
|
+
- native ios sdk ver. 1.4.13
|
|
15
|
+
- native android sdk ver. 1.4.21
|
package/android/build.gradle
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
def DEFAULT_COMPILE_SDK_VERSION =
|
|
1
|
+
def DEFAULT_COMPILE_SDK_VERSION = 34
|
|
2
2
|
def DEFAULT_MIN_SDK_VERSION = 21
|
|
3
|
-
def DEFAULT_TARGET_SDK_VERSION =
|
|
3
|
+
def DEFAULT_TARGET_SDK_VERSION = 34
|
|
4
|
+
|
|
4
5
|
def safeExtGet(prop, fallback) {
|
|
5
6
|
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
|
|
6
7
|
}
|
|
7
8
|
|
|
8
9
|
buildscript {
|
|
9
|
-
ext{
|
|
10
|
-
kotlin_version = '1.
|
|
10
|
+
ext {
|
|
11
|
+
kotlin_version = '1.9.22'
|
|
11
12
|
}
|
|
12
13
|
repositories {
|
|
13
14
|
google()
|
|
14
|
-
|
|
15
|
+
mavenCentral()
|
|
15
16
|
}
|
|
16
17
|
dependencies {
|
|
17
|
-
classpath
|
|
18
|
+
classpath 'com.android.tools.build:gradle:8.5.2'
|
|
18
19
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
|
19
20
|
}
|
|
20
21
|
}
|
|
@@ -40,14 +41,17 @@ android {
|
|
|
40
41
|
disable 'GradleCompatible'
|
|
41
42
|
}
|
|
42
43
|
compileOptions {
|
|
43
|
-
sourceCompatibility JavaVersion.
|
|
44
|
-
targetCompatibility JavaVersion.
|
|
44
|
+
sourceCompatibility JavaVersion.VERSION_17
|
|
45
|
+
targetCompatibility JavaVersion.VERSION_17
|
|
46
|
+
}
|
|
47
|
+
kotlinOptions {
|
|
48
|
+
jvmTarget = '17'
|
|
45
49
|
}
|
|
50
|
+
namespace "com.appboxo.react"
|
|
46
51
|
}
|
|
47
52
|
|
|
48
53
|
repositories {
|
|
49
54
|
mavenCentral()
|
|
50
|
-
jcenter()
|
|
51
55
|
google()
|
|
52
56
|
|
|
53
57
|
def found = false
|
|
@@ -117,6 +121,7 @@ repositories {
|
|
|
117
121
|
|
|
118
122
|
rootProject.allprojects {
|
|
119
123
|
repositories {
|
|
124
|
+
mavenCentral()
|
|
120
125
|
maven { url "https://jitpack.io" }
|
|
121
126
|
maven {
|
|
122
127
|
url "https://maven.pkg.github.com/Appboxo/android-sdk-packages"
|
|
@@ -132,5 +137,7 @@ dependencies {
|
|
|
132
137
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
|
133
138
|
//noinspection GradleDynamicVersion
|
|
134
139
|
implementation 'com.facebook.react:react-native:+' // From node_modules
|
|
135
|
-
implementation
|
|
140
|
+
implementation('com.appboxo:sdk:1.5.16') {
|
|
141
|
+
exclude group: 'com.google.android.gms', module: 'play-services-location'
|
|
142
|
+
}
|
|
136
143
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
#Wed Jul 22 09:37:51 KGT 2020
|
|
2
1
|
distributionBase=GRADLE_USER_HOME
|
|
3
2
|
distributionPath=wrapper/dists
|
|
3
|
+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip
|
|
4
|
+
networkTimeout=10000
|
|
5
|
+
validateDistributionUrl=true
|
|
4
6
|
zipStoreBase=GRADLE_USER_HOME
|
|
5
7
|
zipStorePath=wrapper/dists
|
|
6
|
-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
|
package/android/src/main/java/com/appboxo/{RnappboxosdkModule.kt → react/RnappboxosdkModule.kt}
RENAMED
|
@@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
package com.appboxo
|
|
16
|
+
package com.appboxo.react
|
|
17
17
|
|
|
18
18
|
import android.app.Application
|
|
19
19
|
import android.os.Handler
|
|
@@ -27,7 +27,7 @@ import com.appboxo.sdk.Miniapp
|
|
|
27
27
|
import com.appboxo.sdk.MiniappConfig
|
|
28
28
|
import com.appboxo.sdk.MiniappListCallback
|
|
29
29
|
import com.appboxo.ui.main.AppboxoActivity
|
|
30
|
-
import com.appboxo.utils.MapUtil
|
|
30
|
+
import com.appboxo.react.utils.MapUtil
|
|
31
31
|
import com.facebook.react.bridge.Arguments
|
|
32
32
|
import com.facebook.react.bridge.ReactApplicationContext
|
|
33
33
|
import com.facebook.react.bridge.ReactContextBaseJavaModule
|
|
@@ -54,6 +54,8 @@ class RnappboxosdkModule(reactContext: ReactApplicationContext) :
|
|
|
54
54
|
@ReactMethod
|
|
55
55
|
fun setConfig(
|
|
56
56
|
clientId: String,
|
|
57
|
+
userId: String,
|
|
58
|
+
language: String,
|
|
57
59
|
sandboxMode: Boolean,
|
|
58
60
|
enableMultitaskMode: Boolean,
|
|
59
61
|
theme: String?,
|
|
@@ -70,9 +72,11 @@ class RnappboxosdkModule(reactContext: ReactApplicationContext) :
|
|
|
70
72
|
.setConfig(
|
|
71
73
|
Config.Builder()
|
|
72
74
|
.setClientId(clientId)
|
|
75
|
+
.setUserId(userId)
|
|
73
76
|
.sandboxMode(sandboxMode)
|
|
74
77
|
.multitaskMode(enableMultitaskMode)
|
|
75
78
|
.setTheme(globalTheme)
|
|
79
|
+
.setLanguage(language)
|
|
76
80
|
.permissionsPage(showPermissionsPage)
|
|
77
81
|
.showClearCache(showClearCache)
|
|
78
82
|
.debug(isDebug)
|
|
@@ -87,7 +91,8 @@ class RnappboxosdkModule(reactContext: ReactApplicationContext) :
|
|
|
87
91
|
theme: String?,
|
|
88
92
|
extraUrlParams: ReadableMap?,
|
|
89
93
|
urlSuffix: String?,
|
|
90
|
-
colors: ReadableMap
|
|
94
|
+
colors: ReadableMap?,
|
|
95
|
+
enableSplash: Boolean
|
|
91
96
|
) {
|
|
92
97
|
val miniapp: Miniapp = Appboxo.getMiniapp(appId)
|
|
93
98
|
.setCustomEventListener(this)
|
|
@@ -121,6 +126,7 @@ class RnappboxosdkModule(reactContext: ReactApplicationContext) :
|
|
|
121
126
|
colors.getString("tertiaryColor") ?: "",
|
|
122
127
|
)
|
|
123
128
|
}
|
|
129
|
+
configBuilder.enableSplash(enableSplash)
|
|
124
130
|
miniapp.setConfig(configBuilder.build())
|
|
125
131
|
miniapp.open(reactContext)
|
|
126
132
|
}
|
|
@@ -133,7 +139,7 @@ class RnappboxosdkModule(reactContext: ReactApplicationContext) :
|
|
|
133
139
|
|
|
134
140
|
@ReactMethod
|
|
135
141
|
fun closeMiniapp(appId: String) {
|
|
136
|
-
|
|
142
|
+
handler.post { Appboxo.getExistingMiniapp(appId)?.close() }
|
|
137
143
|
}
|
|
138
144
|
|
|
139
145
|
override fun handle(
|
package/android/src/main/java/com/appboxo/{RnappboxosdkPackage.kt → react/RnappboxosdkPackage.kt}
RENAMED
|
@@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
package com.appboxo
|
|
16
|
+
package com.appboxo.react
|
|
17
17
|
|
|
18
18
|
import android.view.View
|
|
19
19
|
import com.facebook.react.ReactPackage
|
package/index.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ declare module '@appboxo/react-native-sdk' {
|
|
|
22
22
|
* Set Appboxo clientId
|
|
23
23
|
* @param {string} clientId Appboxo clientId
|
|
24
24
|
* @param {object} options - Appboxo global config
|
|
25
|
+
* userId - hostapp userId for consent management
|
|
25
26
|
* sandboxMode (by default false)
|
|
26
27
|
* enableMultitaskMode Enable multiscreen mode (by default true)
|
|
27
28
|
* theme {'dark' | 'light'} theme Miniapp theme (by default 'system')
|
|
@@ -29,6 +30,8 @@ declare module '@appboxo/react-native-sdk' {
|
|
|
29
30
|
export function setConfig(
|
|
30
31
|
clientId: string,
|
|
31
32
|
options?: {
|
|
33
|
+
userId?: string,
|
|
34
|
+
language?: string,
|
|
32
35
|
sandboxMode?: boolean,
|
|
33
36
|
enableMultitaskMode?: boolean,
|
|
34
37
|
theme?: 'dark' | 'light',
|
|
@@ -51,8 +54,9 @@ declare module '@appboxo/react-native-sdk' {
|
|
|
51
54
|
data?: object,
|
|
52
55
|
theme?: 'dark' | 'light' | 'system',
|
|
53
56
|
extraUrlParams?: { [key: string]: string },
|
|
54
|
-
urlSuffix?: string
|
|
55
|
-
colors?: { primaryColor: string, secondaryColor: string, tertiaryColor: string }
|
|
57
|
+
urlSuffix?: string,
|
|
58
|
+
colors?: { primaryColor: string, secondaryColor: string, tertiaryColor: string },
|
|
59
|
+
enableSplash?: boolean
|
|
56
60
|
},
|
|
57
61
|
): void
|
|
58
62
|
|
package/ios/Rnappboxosdk.m
CHANGED
|
@@ -32,17 +32,19 @@ limitations under the License.
|
|
|
32
32
|
RCT_EXPORT_MODULE()
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
RCT_EXPORT_METHOD(setConfig:(NSString *)clientId sandboxMode:(BOOL)sandboxMode
|
|
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)
|
|
36
36
|
{
|
|
37
37
|
NSArray *themes = @[@"dark", @"light", @"system"];
|
|
38
38
|
|
|
39
39
|
Theme globalTheme = ThemeSystem;
|
|
40
|
-
|
|
40
|
+
|
|
41
41
|
if ([themes containsObject:theme]) {
|
|
42
42
|
globalTheme = (Theme) [themes indexOfObject:theme];
|
|
43
43
|
};
|
|
44
44
|
|
|
45
45
|
Config *config = [[Config alloc] initWithClientId: clientId theme: globalTheme];
|
|
46
|
+
[config setUserId: userId];
|
|
47
|
+
config.language = language;
|
|
46
48
|
config.sandboxMode = sandboxMode;
|
|
47
49
|
config.permissionsPage = showPermissionsPage;
|
|
48
50
|
config.showClearCache = showClearCache;
|
|
@@ -50,7 +52,7 @@ RCT_EXPORT_METHOD(setConfig:(NSString *)clientId sandboxMode:(BOOL)sandboxMode m
|
|
|
50
52
|
[[Appboxo shared] setConfig: config];
|
|
51
53
|
}
|
|
52
54
|
|
|
53
|
-
RCT_EXPORT_METHOD(openMiniapp:(NSString *)appId data:(nullable NSDictionary<NSString *,id> *)data theme:(nullable NSString *)theme extraUrlParams:(nullable NSDictionary<NSString *,id> *)extraUrlParams urlSuffix:(nullable NSString *)urlSuffix colors:(nullable NSDictionary<NSString *,id> *)colors)
|
|
55
|
+
RCT_EXPORT_METHOD(openMiniapp:(NSString *)appId data:(nullable NSDictionary<NSString *,id> *)data theme:(nullable NSString *)theme extraUrlParams:(nullable NSDictionary<NSString *,id> *)extraUrlParams urlSuffix:(nullable NSString *)urlSuffix colors:(nullable NSDictionary<NSString *,id> *)colors enableSplash:(BOOL)enableSplash)
|
|
54
56
|
{
|
|
55
57
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
56
58
|
Miniapp *miniapp = [[Appboxo shared] getMiniappWithAppId: appId];
|
|
@@ -58,6 +60,7 @@ RCT_EXPORT_METHOD(openMiniapp:(NSString *)appId data:(nullable NSDictionary<NSSt
|
|
|
58
60
|
[miniapp setDelegate:self];
|
|
59
61
|
|
|
60
62
|
MiniappConfig *miniappConfig = [[MiniappConfig alloc] init];
|
|
63
|
+
[miniappConfig enableSplash: enableSplash];
|
|
61
64
|
[miniappConfig setExtraParams:extraUrlParams];
|
|
62
65
|
|
|
63
66
|
if (theme != NULL) {
|
package/js/mOpenMiniapp.js
CHANGED
|
@@ -10,7 +10,8 @@ const mOpenMiniapp = (miniAppId, options) => {
|
|
|
10
10
|
options?.theme === 'dark' || options?.theme === 'light' || options?.theme === 'system' ? options.theme : null,
|
|
11
11
|
options?.extraUrlParams,
|
|
12
12
|
options?.urlSuffix,
|
|
13
|
-
options?.colors
|
|
13
|
+
options?.colors,
|
|
14
|
+
options?.enableSplash ?? true
|
|
14
15
|
)
|
|
15
16
|
}
|
|
16
17
|
|
package/js/mSetConfig.js
CHANGED
|
@@ -5,7 +5,9 @@ import { NativeModules } from 'react-native'
|
|
|
5
5
|
* */
|
|
6
6
|
const mSetConfig = (clientId, options) => {
|
|
7
7
|
NativeModules.Rnappboxosdk.setConfig(
|
|
8
|
-
clientId,
|
|
8
|
+
clientId,
|
|
9
|
+
options?.userId ?? '',
|
|
10
|
+
options?.language ?? 'en',
|
|
9
11
|
options?.sandboxMode ?? false,
|
|
10
12
|
options?.enableMultitaskMode ?? false,
|
|
11
13
|
options?.theme === 'dark' || options?.theme === 'light' ? options?.theme : 'system',
|
package/package.json
CHANGED