@log-drop/react-native 2.0.5 → 2.0.7

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.
@@ -22,5 +22,5 @@ if respond_to?(:install_modules_dependencies, true)
22
22
  else
23
23
  s.dependency "React-Core"
24
24
  end
25
- s.dependency 'LogDrop', '2.1.3'
25
+ s.dependency 'LogDrop', '2.1.7'
26
26
  end
package/README.md CHANGED
@@ -150,24 +150,19 @@ const pushData = (
150
150
  );
151
151
 
152
152
  async function forward(
153
- message: FirebaseMessagingTypes.RemoteMessage,
154
- skipNotificationPayload: boolean
153
+ message: FirebaseMessagingTypes.RemoteMessage
155
154
  ) {
156
- // Android displays background notification payloads itself. Forwarding them
157
- // again would make LogDrop display a duplicate notification.
158
- if (skipNotificationPayload && message.notification) return;
159
-
160
155
  const data = pushData(message.data);
161
156
  if (await LogDrop.isLogDropPush(data)) {
162
157
  LogDrop.onRemoteMessageReceived(data);
163
158
  }
164
159
  }
165
160
 
166
- setBackgroundMessageHandler(messaging, (message) => forward(message, true));
161
+ setBackgroundMessageHandler(messaging, forward);
167
162
 
168
163
  export async function startLogDropFirebaseMessaging() {
169
164
  onTokenRefresh(messaging, LogDrop.onNewFcmPushToken);
170
- onMessage(messaging, (message) => forward(message, false));
165
+ onMessage(messaging, forward);
171
166
 
172
167
  if (Platform.OS === 'android' && Number(Platform.Version) >= 33) {
173
168
  await PermissionsAndroid.request(
@@ -183,6 +178,10 @@ Import this module during startup and call `startLogDropFirebaseMessaging()`
183
178
  after LogDrop initialization. The background handler remains at module scope so
184
179
  React Native Firebase can invoke it while the app is backgrounded or terminated.
185
180
 
181
+ > **Android:** LogDrop pushes use data-only FCM payloads. Always forward the
182
+ > message `data` to LogDrop so the SDK can display notifications and track
183
+ > `push_received` and `push_clicked` without duplicates.
184
+
186
185
  If the application intentionally handles FCM natively instead, the public
187
186
  Android wrapper offers the same provider forwarding points:
188
187
 
@@ -251,7 +250,7 @@ Add LogDrop to the extension target and run `pod install`:
251
250
 
252
251
  ```ruby
253
252
  target 'LogDropNotificationServiceExtension' do
254
- pod 'LogDrop', '2.1.3'
253
+ pod 'LogDrop', '2.1.7'
255
254
  end
256
255
  ```
257
256
 
@@ -316,6 +315,31 @@ LogDrop.userUpdate("user_123");
316
315
 
317
316
  ---
318
317
 
318
+ ### `LogDrop.setCustomAttributes(attributes: Record<string, string>): void`
319
+ Adds or updates custom user attributes used for push notification segmentation.
320
+ The call is an additive upsert, so attributes not included in the call remain
321
+ unchanged.
322
+
323
+ ```ts
324
+ LogDrop.setCustomAttributes({
325
+ plan: 'premium',
326
+ country: 'TR',
327
+ });
328
+ ```
329
+
330
+ ### `LogDrop.removeCustomAttribute(key: string): void`
331
+ Removes one custom user attribute and syncs the deletion with LogDrop.
332
+
333
+ ```ts
334
+ LogDrop.removeCustomAttribute('plan');
335
+ ```
336
+
337
+ Attribute keys must match `[A-Za-z0-9_-]+` and be at most 64 characters.
338
+ Values must be non-blank and at most 256 characters. A user can have at most 30
339
+ attributes. Invalid mutations are rejected as a whole by the native SDK.
340
+
341
+ ---
342
+
319
343
  ### Logging Methods
320
344
 
321
345
  These correspond to standard log levels.
@@ -77,6 +77,5 @@ def kotlin_version = getExtOrDefault("kotlinVersion")
77
77
  dependencies {
78
78
  implementation "com.facebook.react:react-android"
79
79
  implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
80
- implementation "io.logdrop:sdk:2.1.2"
80
+ implementation "io.logdrop:sdk:2.1.6"
81
81
  }
82
-
@@ -66,6 +66,20 @@ class LogDropReactNativeModule(reactContext: ReactApplicationContext) :
66
66
  LogDrop.userUpdate(userId)
67
67
  }
68
68
 
69
+ @ReactMethod
70
+ fun setCustomAttributes(readableMap: ReadableMap) {
71
+ val rawAttributes = readableMap.toHashMap()
72
+ if (rawAttributes.values.any { it !is String }) return
73
+
74
+ val attributes = rawAttributes.mapValues { it.value as String }
75
+ LogDrop.setCustomAttributes(attributes)
76
+ }
77
+
78
+ @ReactMethod
79
+ fun removeCustomAttribute(key: String) {
80
+ LogDrop.removeCustomAttribute(key)
81
+ }
82
+
69
83
  @ReactMethod
70
84
  fun e(tag: String, message: String, logFlow: ReadableMap?) {
71
85
  val logFlowObject = readableMapToLogFlow(logFlow)
@@ -15,6 +15,8 @@ RCT_EXTERN_METHOD(i:(NSString *)tag message:(NSString *)message logFlow:(NSDicti
15
15
  RCT_EXTERN_METHOD(d:(NSString *)tag message:(NSString *)message logFlow:(NSDictionary * _Nullable)logFlow)
16
16
  RCT_EXTERN_METHOD(w:(NSString *)tag message:(NSString *)message logFlow:(NSDictionary * _Nullable)logFlow)
17
17
  RCT_EXTERN_METHOD(userUpdate:(NSString *)userUuid)
18
+ RCT_EXTERN_METHOD(setCustomAttributes:(NSDictionary *)attributes)
19
+ RCT_EXTERN_METHOD(removeCustomAttribute:(NSString *)key)
18
20
  RCT_EXTERN_METHOD(sendLogs)
19
21
  RCT_EXTERN_METHOD(trackDeepLink:(NSString *)urlString)
20
22
  RCT_EXTERN_METHOD(saveCustomCrashReport:(NSString *)threadName
@@ -116,6 +116,17 @@ class LogDropReactNative: NSObject {
116
116
  func userUpdate(_ userUuid: String) {
117
117
  LogDrop.updateUser(userUuid: userUuid)
118
118
  }
119
+
120
+ @objc
121
+ func setCustomAttributes(_ attributes: NSDictionary) {
122
+ guard let customAttributes = attributes as? [String: String] else { return }
123
+ LogDrop.setCustomAttributes(customAttributes)
124
+ }
125
+
126
+ @objc
127
+ func removeCustomAttribute(_ key: String) {
128
+ LogDrop.removeCustomAttribute(key: key)
129
+ }
119
130
 
120
131
  @objc
121
132
  func sendLogs() {
@@ -76,6 +76,16 @@ export default class LogDrop {
76
76
  static userUpdate = userId => {
77
77
  LogDropReactNative.userUpdate(userId);
78
78
  };
79
+
80
+ /** Adds or updates custom user attributes used for push segmentation. */
81
+ static setCustomAttributes = attributes => {
82
+ LogDropReactNative.setCustomAttributes(attributes);
83
+ };
84
+
85
+ /** Removes a custom user attribute used for push segmentation. */
86
+ static removeCustomAttribute = key => {
87
+ LogDropReactNative.removeCustomAttribute(key);
88
+ };
79
89
  static e = (tag, message, logFlow) => {
80
90
  LogDropReactNative.e(tag, message, logFlow);
81
91
  };
@@ -1 +1 @@
1
- {"version":3,"names":["Platform","LogDropErrorTracking","LogDropReactNative","LogDropPopupShowResult","LogDrop","init","config","OS","initLogDrop","start","onRemoteMessageReceived","message","onNewFcmPushToken","token","onNewHmsPushToken","onNewApnsToken","isLogDropPush","showPendingPushPopup","NotInitialized","result","Shown","NothingToShow","sendLogs","trackDeepLink","url","setAppId","appId","userUpdate","userId","e","tag","logFlow","d","i","w"],"sourceRoot":"../../src","sources":["LogDrop.ts"],"mappings":";;AAAA;AACA;AACA;;AAEA,SAASA,QAAQ,QAAQ,cAAc;AACvC,SAASC,oBAAoB,QAAQ,iCAA8B;AAGnE,SAASC,kBAAkB,QAAQ,yBAAsB;AAEzD,WAAYC,sBAAsB,0BAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAA,OAAtBA,sBAAsB;AAAA;AAMlC,eAAe,MAAMC,OAAO,CAAC;EAC3B,OAAOC,IAAI,GAAIC,MAAqB,IAAW;IAC7C,IAAIN,QAAQ,CAACO,EAAE,KAAK,KAAK,IAAIP,QAAQ,CAACO,EAAE,KAAK,SAAS,EAAE;MACtDL,kBAAkB,CAACM,WAAW,GAAGF,MAAM,CAAC;MACxCL,oBAAoB,CAACQ,KAAK,CAAC,CAAC;IAC9B;EACF,CAAC;EAED,OAAOC,uBAAuB,GAAIC,OAEjC,IAAW;IACV,IAAIX,QAAQ,CAACO,EAAE,KAAK,KAAK,IAAIP,QAAQ,CAACO,EAAE,KAAK,SAAS,EAAE;MACtDL,kBAAkB,CAACQ,uBAAuB,CAACC,OAAO,CAAC;IACrD;EACF,CAAC;EAED,OAAOC,iBAAiB,GAAIC,KAAa,IAAW;IAClD,IAAIb,QAAQ,CAACO,EAAE,KAAK,SAAS,EAA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W;IAC5CtB,kBAAkB,CAACqB,aAAa,GAAGC,GAAG,CAAC;EACzC,CAAC;EAED,OAAOC,QAAQ,GAAIC,KAAa,IAAW;IACzCxB,kBAAkB,CAACuB,QAAQ,GAAGC,KAAK,CAAC;EACtC,CAAC;EAED,OAAOC,UAAU,GAAIC,MAAc,IAAW;IAC5C1B,kBAAkB,CAACyB,UAAU,CAACC,MAAM,CAAC;EACvC,CAAC;EAED,OAAOC,CAAC,GAAGA,CAACC,GAAW,EAAEnB,OAAe,EAAEoB,OAAiB,KAAW;IACpE7B,kBAAkB,CAAC2B,CAAC,CAACC,GAAG,EAAEnB,OAAO,EAAEoB,OAAO,CAAC;EAC7C,CAAC;EAED,OAAOC,CAAC,GAAGA,CAACF,GAAW,EAAEnB,OAAe,EAAEoB,OAAiB,KAAW;IACpE7B,kBAAkB,CAAC8B,CAAC,CAACF,GAAG,EAAEnB,OAAO,EAAEoB,OAAO,CAAC;EAC7C,CAAC;EAED,OAAOE,CAAC,GAAGA,CAACH,GAAW,EAAEnB,OAAe,EAAEoB,OAAiB,KAAW;IACpE7B,kBAAkB,CAAC+B,CAAC,CAACH,GAAG,EAAEnB,OAAO,EAAEoB,OAAO,CAAC;EAC7C,CAAC;EAED,OAAOG,CAAC,GAAGA,CAACJ,GAAW,EAAEnB,OAAe,EAAEoB,OAAiB,KAAW;IACpE7B,kBAAkB,CAACgC,CAAC,CAACJ,GAAG,EAAEnB,OAAO,EAAEoB,OAAO,CAAC;EAC7C,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"names":["Platform","LogDropErrorTracking","LogDropReactNative","LogDropPopupShowResult","LogDrop","init","config","OS","initLogDrop","start","onRemoteMessageReceived","message","onNewFcmPushToken","token","onNewHmsPushToken","onNewApnsToken","isLogDropPush","showPendingPushPopup","NotInitialized","result","Shown","NothingToShow","sendLogs","trackDeepLink","url","setAppId","appId","userUpdate","userId","setCustomAttributes","attributes","removeCustomAttribute","key","e","tag","logFlow","d","i","w"],"sourceRoot":"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C,GAAW,IAAW;IACpD9B,kBAAkB,CAAC6B,qBAAqB,CAACC,GAAG,CAAC;EAC/C,CAAC;EAED,OAAOC,CAAC,GAAGA,CAACC,GAAW,EAAEvB,OAAe,EAAEwB,OAAiB,KAAW;IACpEjC,kBAAkB,CAAC+B,CAAC,CAACC,GAAG,EAAEvB,OAAO,EAAEwB,OAAO,CAAC;EAC7C,CAAC;EAED,OAAOC,CAAC,GAAGA,CAACF,GAAW,EAAEvB,OAAe,EAAEwB,OAAiB,KAAW;IACpEjC,kBAAkB,CAACkC,CAAC,CAACF,GAAG,EAAEvB,OAAO,EAAEwB,OAAO,CAAC;EAC7C,CAAC;EAED,OAAOE,CAAC,GAAGA,CAACH,GAAW,EAAEvB,OAAe,EAAEwB,OAAiB,KAAW;IACpEjC,kBAAkB,CAACmC,CAAC,CAACH,GAAG,EAAEvB,OAAO,EAAEwB,OAAO,CAAC;EAC7C,CAAC;EAED,OAAOG,CAAC,GAAGA,CAACJ,GAAW,EAAEvB,OAAe,EAAEwB,OAAiB,KAAW;IACpEjC,kBAAkB,CAACoC,CAAC,CAACJ,GAAG,EAAEvB,OAAO,EAAEwB,OAAO,CAAC;EAC7C,CAAC;AACH","ignoreList":[]}
@@ -22,6 +22,10 @@ export default class LogDrop {
22
22
  static trackDeepLink: (url: string) => void;
23
23
  static setAppId: (appId: string) => void;
24
24
  static userUpdate: (userId: string) => void;
25
+ /** Adds or updates custom user attributes used for push segmentation. */
26
+ static setCustomAttributes: (attributes: Record<string, string>) => void;
27
+ /** Removes a custom user attribute used for push segmentation. */
28
+ static removeCustomAttribute: (key: string) => void;
25
29
  static e: (tag: string, message: string, logFlow?: LogFlow) => void;
26
30
  static d: (tag: string, message: string, logFlow?: LogFlow) => void;
27
31
  static i: (tag: string, message: string, logFlow?: LogFlow) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"LogDrop.d.ts","sourceRoot":"","sources":["../../../src/LogDrop.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK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AG,IAAI,CAExC;IAEF,yEAAyE;IACzE,MAAM,CAAC,mBAAmB,GAAI,YAAY,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAG,IAAI,CAErE;IAEF,kEAAkE;IAClE,MAAM,CAAC,qBAAqB,GAAI,KAAK,MAAM,KAAG,IAAI,CAEhD;IAEF,MAAM,CAAC,CAAC,GAAI,KAAK,MAAM,EAAE,SAAS,MAAM,EAAE,UAAU,OAAO,KAAG,IAAI,CAEhE;IAEF,MAAM,CAAC,CAAC,GAAI,KAAK,MAAM,EAAE,SAAS,MAAM,EAAE,UAAU,OAAO,KAAG,IAAI,CAEhE;IAEF,MAAM,CAAC,CAAC,GAAI,KAAK,MAAM,EAAE,SAAS,MAAM,EAAE,UAAU,OAAO,KAAG,IAAI,CAEhE;IAEF,MAAM,CAAC,CAAC,GAAI,KAAK,MAAM,EAAE,SAAS,MAAM,EAAE,UAAU,OAAO,KAAG,IAAI,CAEhE;CACH"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@log-drop/react-native",
3
- "version": "2.0.5",
3
+ "version": "2.0.7",
4
4
  "description": "LogDrop React Native SDK",
5
5
  "source": "./src/index.tsx",
6
6
  "main": "./lib/module/index.js",
package/src/LogDrop.ts CHANGED
@@ -93,6 +93,16 @@ export default class LogDrop {
93
93
  LogDropReactNative.userUpdate(userId);
94
94
  };
95
95
 
96
+ /** Adds or updates custom user attributes used for push segmentation. */
97
+ static setCustomAttributes = (attributes: Record<string, string>): void => {
98
+ LogDropReactNative.setCustomAttributes(attributes);
99
+ };
100
+
101
+ /** Removes a custom user attribute used for push segmentation. */
102
+ static removeCustomAttribute = (key: string): void => {
103
+ LogDropReactNative.removeCustomAttribute(key);
104
+ };
105
+
96
106
  static e = (tag: string, message: string, logFlow?: LogFlow): void => {
97
107
  LogDropReactNative.e(tag, message, logFlow);
98
108
  };