@encorekit/react-native 1.1.18 → 1.1.20

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.
@@ -2,6 +2,9 @@ import groovy.json.JsonSlurper
2
2
 
3
3
  def packageJson = new JsonSlurper().parseText(file("$projectDir/../package.json").text)
4
4
  def encoreAndroidVersion = packageJson.sdkVersions.android["com.encorekit:encore"]
5
+ // Read RN version from devDependencies for standalone CI builds.
6
+ // When consumed by a host app, the host's react-android version takes precedence.
7
+ def rnVersion = packageJson.devDependencies["react-native"]?.replaceAll("[^0-9.]", "") ?: "+"
5
8
 
6
9
  buildscript {
7
10
  ext.safeExtGet = {prop, fallback ->
@@ -84,7 +87,7 @@ if (hostKotlinVersion != null) {
84
87
 
85
88
  dependencies {
86
89
  // Host app provides these
87
- compileOnly "com.facebook.react:react-android:+"
90
+ compileOnly "com.facebook.react:react-android:${rnVersion}"
88
91
  compileOnly "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
89
92
 
90
93
  // Bridge uses coroutines for async calls to native SDK
@@ -75,7 +75,7 @@ class EncoreReactSDKModule(reactContext: ReactApplicationContext) :
75
75
 
76
76
  @ReactMethod
77
77
  fun show(placementId: String, promise: Promise) {
78
- val activity = currentActivity
78
+ val activity = reactApplicationContext.currentActivity
79
79
  if (activity == null) {
80
80
  promise.reject("NO_ACTIVITY", "No current activity available")
81
81
  return
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@encorekit/react-native",
3
- "version": "1.1.18",
3
+ "version": "1.1.20",
4
4
  "sdkVersions": {
5
5
  "ios": {
6
6
  "EncoreKit": "1.4.34"