@coralogix/react-native-plugin 0.1.4 → 0.1.5

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 CHANGED
@@ -1,3 +1,10 @@
1
+ ## 0.1.5 (2025-10-13)
2
+
3
+ ### 🩹 Fixes
4
+ - fixed build issue in iOS
5
+ - fixed beforeSend to actually be optional in iOS
6
+ - handle hot reload appropriately to shutdown our native sdk, the sdk is initialized anew keeping context fresh in the native layer
7
+
1
8
  ## 0.1.4 (2025-10-09)
2
9
 
3
10
  ### 🩹 Fixes
@@ -75,7 +75,7 @@ dependencies {
75
75
  implementation "com.facebook.react:react-android"
76
76
  implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
77
77
 
78
- implementation "com.coralogix:android-sdk:2.4.6"
78
+ implementation "com.coralogix:android-sdk:2.5.2"
79
79
  }
80
80
 
81
81
  react {
@@ -189,6 +189,15 @@ class CxSdkModule(reactContext: ReactApplicationContext) :
189
189
  Log.d("CxSdkModule", "removeListeners: $count")
190
190
  }
191
191
 
192
+ override fun invalidate() {
193
+ super.invalidate()
194
+
195
+ Handler(Looper.getMainLooper()).post {
196
+ Log.d("CxSdkModule", "Bridge destroyed — shutting down CoralogixRum")
197
+ CoralogixRum.shutdown()
198
+ }
199
+ }
200
+
192
201
  private fun ReadableMap.toCoralogixOptions(): CoralogixOptions {
193
202
  val applicationName = getString("application")
194
203
  ?: throw IllegalArgumentException("Missing required parameter: application")
@@ -227,6 +236,8 @@ class CxSdkModule(reactContext: ReactApplicationContext) :
227
236
 
228
237
  private fun beforeSendCallback(data: List<Map<String, Any?>>) {
229
238
  val args = convertAnyListToWritableArray(data)
239
+ if (!reactApplicationContext.hasActiveReactInstance()) return
240
+
230
241
  reactApplicationContext
231
242
  .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java)
232
243
  .emit("onBeforeSend", args)
package/index.cjs.js CHANGED
@@ -219,7 +219,7 @@ function stopJsRefreshRateSampler() {
219
219
  appStateSub = null;
220
220
  }
221
221
 
222
- var version = "0.1.4";
222
+ var version = "0.1.5";
223
223
  var pkg = {
224
224
  version: version};
225
225
 
package/index.esm.js CHANGED
@@ -217,7 +217,7 @@ function stopJsRefreshRateSampler() {
217
217
  appStateSub = null;
218
218
  }
219
219
 
220
- var version = "0.1.4";
220
+ var version = "0.1.5";
221
221
  var pkg = {
222
222
  version: version};
223
223
 
package/ios/CxSdk.mm CHANGED
@@ -51,6 +51,7 @@ RCT_EXTERN_METHOD(reportError:(NSDictionary *)errorDictionary
51
51
  RCT_EXTERN_METHOD(log:(int)severity
52
52
  message:(NSString *)message
53
53
  data:(NSDictionary *)data
54
+ labels:(NSDictionary *)labels
54
55
  withResolver:(RCTPromiseResolveBlock)resolve
55
56
  withRejecter:(RCTPromiseRejectBlock)reject)
56
57
 
package/ios/CxSdk.swift CHANGED
@@ -29,7 +29,7 @@ class CxSdk: RCTEventEmitter {
29
29
  reject:RCTPromiseRejectBlock) -> Void {
30
30
  do {
31
31
  // Create beforeSendCallback only if parameter["beforeSend"] is not null
32
- let beforeSendCallBack: (([[String: Any]]) -> Void)? = parameter["beforeSend"] != nil ? { [weak self] (event: [[String: Any]]) -> Void in
32
+ let beforeSendCallBack: (([[String: Any]]) -> Void)? = { [weak self] (event: [[String: Any]]) -> Void in
33
33
  // Convert the event dictionary to a format that
34
34
  // can be safely passed to JavaScript
35
35
  let jsEvent = event.map { (element) in
@@ -37,7 +37,7 @@ class CxSdk: RCTEventEmitter {
37
37
  }
38
38
 
39
39
  self?.sendEvent(withName: "onBeforeSend", body: jsEvent)
40
- } : nil
40
+ }
41
41
 
42
42
  var options = try self.toCoralogixOptions(parameter: parameter)
43
43
  options.beforeSendCallBack = beforeSendCallBack
@@ -115,7 +115,7 @@ class CxSdk: RCTEventEmitter {
115
115
  resolve("setViewContext success")
116
116
  }
117
117
 
118
- @objc(log:message:data:withResolver:withRejecter:)
118
+ @objc(log:message:data:labels:withResolver:withRejecter:)
119
119
  func log(severity: Int,
120
120
  message: String,
121
121
  data: NSDictionary,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coralogix/react-native-plugin",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Official Coralogix React Native plugin",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Coralogix",