@rownd/react-native 2.8.1 → 2.8.3
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 +17 -0
- package/android/build.gradle +2 -1
- package/android/src/main/java/com/reactnativerowndplugin/RowndPluginModule.kt +12 -8
- package/android/src/main/java/com/reactnativerowndplugin/RowndPluginPackage.kt +11 -0
- package/lib/commonjs/utils/config.js.map +1 -1
- package/lib/module/utils/config.js.map +1 -1
- package/lib/typescript/utils/config.d.ts +2 -0
- package/package.json +1 -1
- package/src/utils/config.ts +2 -0
package/README.md
CHANGED
|
@@ -30,6 +30,23 @@ ext {
|
|
|
30
30
|
cd android && ./gradlew build
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
+
3. Check and update your ProGuard config using [the rules from our Android SDK](https://github.com/rownd/android/blob/main/README.md#proguard-config).
|
|
34
|
+
|
|
35
|
+
4. Only required for Google Sign-in: Add a Rownd plugin initializer to your MainActivity file. File: *android/app/src/main/java/.../MainActivity.java
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
import android.os.Bundle;
|
|
39
|
+
import com.reactnativerowndplugin.RowndPluginPackage;
|
|
40
|
+
|
|
41
|
+
public class MainActivity extends ReactActivity {
|
|
42
|
+
@Override
|
|
43
|
+
protected void onCreate(Bundle savedInstanceState) {
|
|
44
|
+
super.onCreate(savedInstanceState);
|
|
45
|
+
RowndPluginPackage.preInit(this);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
33
50
|
### iOS
|
|
34
51
|
|
|
35
52
|
1. Ensure iOS version is at least 14. File: *ios/Podfile*
|
package/android/build.gradle
CHANGED
|
@@ -61,6 +61,7 @@ android {
|
|
|
61
61
|
|
|
62
62
|
repositories {
|
|
63
63
|
mavenCentral()
|
|
64
|
+
mavenLocal()
|
|
64
65
|
google()
|
|
65
66
|
|
|
66
67
|
def found = false
|
|
@@ -135,7 +136,7 @@ dependencies {
|
|
|
135
136
|
//noinspection GradleDynamicVersion
|
|
136
137
|
implementation "com.facebook.react:react-native:+"
|
|
137
138
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
138
|
-
implementation 'io.rownd:android:2.
|
|
139
|
+
implementation 'io.rownd:android:2.3.2'
|
|
139
140
|
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2"
|
|
140
141
|
implementation 'androidx.compose.ui:ui-unit:1.3.0'
|
|
141
142
|
implementation 'androidx.compose.ui:ui-graphics:1.3.0'
|
|
@@ -74,16 +74,9 @@ class RowndPluginModule(reactContext: ReactApplicationContext) : ReactContextBas
|
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
// Example method
|
|
78
|
-
// See https://reactnative.dev/docs/native-modules-android
|
|
79
|
-
@ReactMethod
|
|
80
|
-
fun multiply(a: Int, b: Int, promise: Promise) {
|
|
81
|
-
promise.resolve(a * b * 10)
|
|
82
|
-
}
|
|
83
|
-
|
|
84
77
|
@ReactMethod
|
|
85
78
|
fun customizations(config: ReadableMap) {
|
|
86
|
-
|
|
79
|
+
val appCustomizations = AppCustomizations(reactApplicationContext.currentActivity as FragmentActivity)
|
|
87
80
|
|
|
88
81
|
val sheetBackgroundHexColor: String? = config.getString("sheetBackgroundHexColor")
|
|
89
82
|
if (sheetBackgroundHexColor != null) {
|
|
@@ -106,6 +99,17 @@ class RowndPluginModule(reactContext: ReactApplicationContext) : ReactContextBas
|
|
|
106
99
|
@ReactMethod
|
|
107
100
|
fun configure(config: ReadableMap) {
|
|
108
101
|
val appKey = config.getString("appKey")
|
|
102
|
+
val apiUrl = config.getString("apiUrl")
|
|
103
|
+
val baseUrl = config.getString("baseUrl")
|
|
104
|
+
|
|
105
|
+
if (apiUrl != null) {
|
|
106
|
+
Rownd.config.apiUrl = apiUrl
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if (baseUrl != null) {
|
|
110
|
+
Rownd.config.baseUrl = baseUrl
|
|
111
|
+
}
|
|
112
|
+
|
|
109
113
|
if (appKey != null) {
|
|
110
114
|
Rownd.configure(reactApplicationContext.currentActivity as FragmentActivity, appKey)
|
|
111
115
|
isRowndJSInitialized = true
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
package com.reactnativerowndplugin
|
|
2
|
+
import android.app.Application
|
|
3
|
+
import androidx.fragment.app.Fragment
|
|
4
|
+
import androidx.fragment.app.FragmentActivity
|
|
2
5
|
import com.facebook.react.ReactPackage
|
|
3
6
|
import com.facebook.react.bridge.NativeModule
|
|
4
7
|
import com.facebook.react.bridge.ReactApplicationContext
|
|
5
8
|
import com.facebook.react.uimanager.ViewManager
|
|
9
|
+
import io.rownd.android.Rownd
|
|
6
10
|
|
|
7
11
|
|
|
8
12
|
class RowndPluginPackage : ReactPackage {
|
|
@@ -13,4 +17,11 @@ class RowndPluginPackage : ReactPackage {
|
|
|
13
17
|
override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> {
|
|
14
18
|
return emptyList()
|
|
15
19
|
}
|
|
20
|
+
|
|
21
|
+
companion object {
|
|
22
|
+
@JvmStatic
|
|
23
|
+
fun preInit(activity: FragmentActivity) {
|
|
24
|
+
Rownd._registerActivityLifecycle(activity)
|
|
25
|
+
}
|
|
26
|
+
}
|
|
16
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["config.ts"],"sourcesContent":["export interface IConfig {\n appKey: string;\n}\n\nexport interface Customizations {\n sheetBackgroundHexColor?: string;\n sheetCornerBorderRadius?: string;\n loadingAnimation?: string;\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"names":[],"sources":["config.ts"],"sourcesContent":["export interface IConfig {\n appKey: string;\n apiUrl?: string;\n baseUrl?: string;\n}\n\nexport interface Customizations {\n sheetBackgroundHexColor?: string;\n sheetCornerBorderRadius?: string;\n loadingAnimation?: string;\n}\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["config.ts"],"sourcesContent":["export interface IConfig {\n appKey: string;\n}\n\nexport interface Customizations {\n sheetBackgroundHexColor?: string;\n sheetCornerBorderRadius?: string;\n loadingAnimation?: string;\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"names":[],"sources":["config.ts"],"sourcesContent":["export interface IConfig {\n appKey: string;\n apiUrl?: string;\n baseUrl?: string;\n}\n\nexport interface Customizations {\n sheetBackgroundHexColor?: string;\n sheetCornerBorderRadius?: string;\n loadingAnimation?: string;\n}\n"],"mappings":""}
|
package/package.json
CHANGED