airbridge-react-native-sdk-restricted 4.1.4 → 4.1.6

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.
@@ -1,4 +1,5 @@
1
1
  import groovy.json.JsonSlurper
2
+ import com.android.Version
2
3
 
3
4
  apply plugin: 'com.android.library'
4
5
  apply plugin: 'kotlin-android'
@@ -15,10 +16,14 @@ buildscript {
15
16
  ext.safeExtGet("kotlinVersion", "1.5.31")
16
17
  }
17
18
  }
18
-
19
19
  }
20
20
 
21
21
  android {
22
+ def agpVersion = Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')[0].toInteger()
23
+ if (agpVersion >= 7) {
24
+ namespace "co.ab180.airbridge.reactnative"
25
+ }
26
+
22
27
  compileSdkVersion safeExtGet("compileSdkVersion", 34)
23
28
 
24
29
  defaultConfig {
@@ -20,7 +20,7 @@ internal fun JSONObject.toMap(): Map<String, Any> {
20
20
 
21
21
  internal fun JSONArray.toList(): List<Any> {
22
22
  val list = LinkedList<Any>()
23
- for (index in 0..<length()) {
23
+ for (index in 0 until length()) {
24
24
  opt(index)?.also {
25
25
  when (it) {
26
26
  is JSONObject -> { list.add(it.toMap()) }
@@ -6,6 +6,7 @@ import com.facebook.react.bridge.ReactContextBaseJavaModule
6
6
  import com.facebook.react.bridge.ReactMethod
7
7
  import com.facebook.react.bridge.ReadableMap
8
8
  import com.facebook.react.bridge.WritableNativeMap
9
+ import com.facebook.react.modules.core.DeviceEventManagerModule
9
10
  import java.lang.ref.WeakReference
10
11
 
11
12
  internal class AttributionInteractor(
@@ -26,14 +27,14 @@ internal class AttributionInteractor(
26
27
 
27
28
  if (initialAttribution != null) {
28
29
  weakThis.get()?.reactApplicationContext
29
- ?.getJSModule(ReactContext.RCTDeviceEventEmitter::class.java)
30
+ ?.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java)
30
31
  ?.emit("airbridge.attribution", initialAttribution?.toReadableMap())
31
32
  initialAttribution = null
32
33
  }
33
34
 
34
35
  onAttributionReceived = { attribution ->
35
36
  weakThis.get()?.reactApplicationContext
36
- ?.getJSModule(ReactContext.RCTDeviceEventEmitter::class.java)
37
+ ?.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java)
37
38
  ?.emit("airbridge.attribution", attribution.toReadableMap())
38
39
  }
39
40
  }
@@ -5,6 +5,7 @@ import com.facebook.react.bridge.ReactApplicationContext
5
5
  import com.facebook.react.bridge.ReactContext
6
6
  import com.facebook.react.bridge.ReactContextBaseJavaModule
7
7
  import com.facebook.react.bridge.ReactMethod
8
+ import com.facebook.react.modules.core.DeviceEventManagerModule
8
9
  import java.lang.ref.WeakReference
9
10
 
10
11
  internal class DeeplinkInteractor(
@@ -25,14 +26,14 @@ internal class DeeplinkInteractor(
25
26
 
26
27
  if (initialDeeplink != null) {
27
28
  weakThis.get()?.reactApplicationContext
28
- ?.getJSModule(ReactContext.RCTDeviceEventEmitter::class.java)
29
+ ?.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java)
29
30
  ?.emit("airbridge.deeplink", initialDeeplink.toString())
30
31
  initialDeeplink = null
31
32
  }
32
33
 
33
34
  onDeeplinkReceived = { deeplink ->
34
35
  weakThis.get()?.reactApplicationContext
35
- ?.getJSModule(ReactContext.RCTDeviceEventEmitter::class.java)
36
+ ?.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java)
36
37
  ?.emit("airbridge.deeplink", deeplink.toString())
37
38
  }
38
39
  }
@@ -7,6 +7,7 @@ import com.facebook.react.bridge.ReactContext
7
7
  import com.facebook.react.bridge.ReactContextBaseJavaModule
8
8
  import com.facebook.react.bridge.ReactMethod
9
9
  import com.facebook.react.bridge.WritableNativeMap
10
+ import com.facebook.react.modules.core.DeviceEventManagerModule
10
11
 
11
12
  internal class FetchInteractor(
12
13
  reactContext: ReactApplicationContext?
@@ -20,7 +21,7 @@ internal class FetchInteractor(
20
21
  onFailure = { onFailure(it.message ?: "Unexplained failure") }
21
22
  )
22
23
  reactApplicationContext
23
- ?.getJSModule(ReactContext.RCTDeviceEventEmitter::class.java)
24
+ ?.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java)
24
25
  ?.emit("airbridge.fetch", WritableNativeMap().apply {
25
26
  putString("id", promiseID)
26
27
  putString("type", "onResolve")
@@ -35,7 +36,7 @@ internal class FetchInteractor(
35
36
  onFailure = { onFailure(it.message ?: "Unexplained failure") }
36
37
  )
37
38
  reactApplicationContext
38
- ?.getJSModule(ReactContext.RCTDeviceEventEmitter::class.java)
39
+ ?.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java)
39
40
  ?.emit("airbridge.fetch", WritableNativeMap().apply {
40
41
  putString("id", promiseID)
41
42
  putString("type", "onResolve")
@@ -9,6 +9,7 @@ import com.facebook.react.bridge.ReactContext
9
9
  import com.facebook.react.bridge.ReactContextBaseJavaModule
10
10
  import com.facebook.react.bridge.ReactMethod
11
11
  import com.facebook.react.bridge.WritableNativeMap
12
+ import com.facebook.react.modules.core.DeviceEventManagerModule
12
13
 
13
14
  internal class PlacementInteractor(
14
15
  reactContext: ReactApplicationContext?
@@ -23,7 +24,7 @@ internal class PlacementInteractor(
23
24
  onFailure = { onFailure(it.message ?: "Unexplained failure") }
24
25
  )
25
26
  reactApplicationContext
26
- ?.getJSModule(ReactContext.RCTDeviceEventEmitter::class.java)
27
+ ?.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java)
27
28
  ?.emit("airbridge.placement", WritableNativeMap().apply {
28
29
  putString("id", promiseID)
29
30
  putString("type", "onResolve")
@@ -40,7 +41,7 @@ internal class PlacementInteractor(
40
41
  onFailure = { onFailure(it.message ?: "Unexplained failure") }
41
42
  )
42
43
  reactApplicationContext
43
- ?.getJSModule(ReactContext.RCTDeviceEventEmitter::class.java)
44
+ ?.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java)
44
45
  ?.emit("airbridge.placement", WritableNativeMap().apply {
45
46
  putString("id", promiseID)
46
47
  putString("type", "onResolve")
package/changelog.md CHANGED
@@ -1,3 +1,14 @@
1
+ ## 4.1.6
2
+
3
+ **FIXED**
4
+ * Added SDK namespace on Android
5
+ * Fixed JsonCovnert logic for support lower kotlin version
6
+
7
+ ## 4.1.5
8
+
9
+ **FIXED**
10
+ * Fix logic to get `RCTDeviceEventEmitter` JSModule on Android
11
+
1
12
  ## 4.1.4
2
13
 
3
14
  **CHANGED**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "airbridge-react-native-sdk-restricted",
3
- "version": "4.1.4",
3
+ "version": "4.1.6",
4
4
  "description": "Airbridge SDK for React Native",
5
5
  "main": "build/source/module.js",
6
6
  "types": "build/source/module.d.ts",
@@ -1,7 +1,7 @@
1
1
  PODS:
2
2
  - airbridge-ios-sdk (4.1.3)
3
3
  - airbridge-ios-sdk-qa-library (4.1.3)
4
- - airbridge-react-native-sdk (4.1.4):
4
+ - airbridge-react-native-sdk (4.1.6):
5
5
  - airbridge-ios-sdk (= 4.1.3)
6
6
  - React
7
7
  - boost (1.84.0)