@log-drop/react-native 2.0.5 → 2.0.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.
@@ -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.4'
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
 
@@ -77,6 +77,6 @@ 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.3"
81
81
  }
82
82
 
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.6",
4
4
  "description": "LogDrop React Native SDK",
5
5
  "source": "./src/index.tsx",
6
6
  "main": "./lib/module/index.js",