@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.
- package/LogdropReactNative.podspec +1 -1
- package/README.md +7 -8
- package/android/build.gradle +1 -1
- package/package.json +1 -1
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,
|
|
161
|
+
setBackgroundMessageHandler(messaging, forward);
|
|
167
162
|
|
|
168
163
|
export async function startLogDropFirebaseMessaging() {
|
|
169
164
|
onTokenRefresh(messaging, LogDrop.onNewFcmPushToken);
|
|
170
|
-
onMessage(messaging,
|
|
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
|
|
package/android/build.gradle
CHANGED
|
@@ -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.
|
|
80
|
+
implementation "io.logdrop:sdk:2.1.3"
|
|
81
81
|
}
|
|
82
82
|
|