@log-drop/react-native 2.1.8 → 2.2.0
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/README.md +76 -4
- package/android/gradle.properties +1 -1
- package/android/src/main/java/com/logdropreactnative/LogDropReactNative.kt +1 -0
- package/android/src/main/java/com/logdropreactnative/LogDropReactNativeConfig.kt +11 -1
- package/android/src/main/java/com/logdropreactnative/LogDropReactNativeModule.kt +6 -0
- package/ios/LogDropReactNative.mm +1 -0
- package/ios/LogDropReactNative.swift +10 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/Info.plist +5 -5
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64/LogDropSDK.framework/Alamofire_Alamofire.bundle/Info.plist +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64/LogDropSDK.framework/DeviceKit_DeviceKit.bundle/Info.plist +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64/LogDropSDK.framework/Firebase_FirebaseCore.bundle/Info.plist +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64/LogDropSDK.framework/Firebase_FirebaseCoreExtension.bundle/Info.plist +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64/LogDropSDK.framework/Firebase_FirebaseCoreInternal.bundle/Info.plist +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64/LogDropSDK.framework/Firebase_FirebaseCrashlytics.bundle/Info.plist +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64/LogDropSDK.framework/Firebase_FirebaseInstallations.bundle/Info.plist +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64/LogDropSDK.framework/Firebase_FirebaseMessaging.bundle/Info.plist +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64/LogDropSDK.framework/GoogleDataTransport_GoogleDataTransport.bundle/Info.plist +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64/LogDropSDK.framework/GoogleUtilities_GoogleUtilities-AppDelegateSwizzler.bundle/Info.plist +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64/LogDropSDK.framework/GoogleUtilities_GoogleUtilities-Environment.bundle/Info.plist +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64/LogDropSDK.framework/GoogleUtilities_GoogleUtilities-Logger.bundle/Info.plist +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64/LogDropSDK.framework/GoogleUtilities_GoogleUtilities-NSData.bundle/Info.plist +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64/LogDropSDK.framework/GoogleUtilities_GoogleUtilities-Network.bundle/Info.plist +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64/LogDropSDK.framework/GoogleUtilities_GoogleUtilities-Reachability.bundle/Info.plist +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64/LogDropSDK.framework/GoogleUtilities_GoogleUtilities-UserDefaults.bundle/Info.plist +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64/LogDropSDK.framework/Headers/LogDropSDK-Swift.h +74 -8
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64/LogDropSDK.framework/Info.plist +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64/LogDropSDK.framework/LogDropSDK +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64/LogDropSDK.framework/Modules/LogDropSDK.swiftmodule/arm64-apple-ios.abi.json +3200 -1483
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64/LogDropSDK.framework/Modules/LogDropSDK.swiftmodule/arm64-apple-ios.private.swiftinterface +253 -293
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64/LogDropSDK.framework/Modules/LogDropSDK.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64/LogDropSDK.framework/Modules/LogDropSDK.swiftmodule/arm64-apple-ios.swiftinterface +253 -293
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64/LogDropSDK.framework/Modules/module.modulemap +0 -1
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64/LogDropSDK.framework/PLCrashReporter_CrashReporter.bundle/Info.plist +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64/LogDropSDK.framework/Promises_FBLPromises.bundle/Info.plist +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64/LogDropSDK.framework/Promises_Promises.bundle/Info.plist +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64/LogDropSDK.framework/SwiftProtobuf_SwiftProtobuf.bundle/Info.plist +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64/LogDropSDK.framework/nanopb_nanopb.bundle/Info.plist +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64_x86_64-simulator/LogDropSDK.framework/Alamofire_Alamofire.bundle/Info.plist +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64_x86_64-simulator/LogDropSDK.framework/Alamofire_Alamofire.bundle/_CodeSignature/CodeDirectory +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64_x86_64-simulator/LogDropSDK.framework/DeviceKit_DeviceKit.bundle/Info.plist +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64_x86_64-simulator/LogDropSDK.framework/DeviceKit_DeviceKit.bundle/_CodeSignature/CodeDirectory +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64_x86_64-simulator/LogDropSDK.framework/Firebase_FirebaseCore.bundle/Info.plist +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64_x86_64-simulator/LogDropSDK.framework/Firebase_FirebaseCore.bundle/_CodeSignature/CodeDirectory +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64_x86_64-simulator/LogDropSDK.framework/Firebase_FirebaseCoreExtension.bundle/Info.plist +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64_x86_64-simulator/LogDropSDK.framework/Firebase_FirebaseCoreExtension.bundle/_CodeSignature/CodeDirectory +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64_x86_64-simulator/LogDropSDK.framework/Firebase_FirebaseCoreInternal.bundle/Info.plist +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64_x86_64-simulator/LogDropSDK.framework/Firebase_FirebaseCoreInternal.bundle/_CodeSignature/CodeDirectory +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64_x86_64-simulator/LogDropSDK.framework/Firebase_FirebaseCrashlytics.bundle/Info.plist +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64_x86_64-simulator/LogDropSDK.framework/Firebase_FirebaseCrashlytics.bundle/_CodeSignature/CodeDirectory +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64_x86_64-simulator/LogDropSDK.framework/Firebase_FirebaseInstallations.bundle/Info.plist +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64_x86_64-simulator/LogDropSDK.framework/Firebase_FirebaseInstallations.bundle/_CodeSignature/CodeDirectory +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64_x86_64-simulator/LogDropSDK.framework/Firebase_FirebaseMessaging.bundle/Info.plist +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64_x86_64-simulator/LogDropSDK.framework/Firebase_FirebaseMessaging.bundle/_CodeSignature/CodeDirectory +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64_x86_64-simulator/LogDropSDK.framework/GoogleDataTransport_GoogleDataTransport.bundle/Info.plist +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64_x86_64-simulator/LogDropSDK.framework/GoogleDataTransport_GoogleDataTransport.bundle/_CodeSignature/CodeDirectory +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64_x86_64-simulator/LogDropSDK.framework/GoogleUtilities_GoogleUtilities-AppDelegateSwizzler.bundle/Info.plist +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64_x86_64-simulator/LogDropSDK.framework/GoogleUtilities_GoogleUtilities-AppDelegateSwizzler.bundle/_CodeSignature/CodeDirectory +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64_x86_64-simulator/LogDropSDK.framework/GoogleUtilities_GoogleUtilities-Environment.bundle/Info.plist +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64_x86_64-simulator/LogDropSDK.framework/GoogleUtilities_GoogleUtilities-Environment.bundle/_CodeSignature/CodeDirectory +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64_x86_64-simulator/LogDropSDK.framework/GoogleUtilities_GoogleUtilities-Logger.bundle/Info.plist +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64_x86_64-simulator/LogDropSDK.framework/GoogleUtilities_GoogleUtilities-Logger.bundle/_CodeSignature/CodeDirectory +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64_x86_64-simulator/LogDropSDK.framework/GoogleUtilities_GoogleUtilities-NSData.bundle/Info.plist +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64_x86_64-simulator/LogDropSDK.framework/GoogleUtilities_GoogleUtilities-NSData.bundle/_CodeSignature/CodeDirectory +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64_x86_64-simulator/LogDropSDK.framework/GoogleUtilities_GoogleUtilities-Network.bundle/Info.plist +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64_x86_64-simulator/LogDropSDK.framework/GoogleUtilities_GoogleUtilities-Network.bundle/_CodeSignature/CodeDirectory +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64_x86_64-simulator/LogDropSDK.framework/GoogleUtilities_GoogleUtilities-Reachability.bundle/Info.plist +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64_x86_64-simulator/LogDropSDK.framework/GoogleUtilities_GoogleUtilities-Reachability.bundle/_CodeSignature/CodeDirectory +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64_x86_64-simulator/LogDropSDK.framework/GoogleUtilities_GoogleUtilities-UserDefaults.bundle/Info.plist +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64_x86_64-simulator/LogDropSDK.framework/GoogleUtilities_GoogleUtilities-UserDefaults.bundle/_CodeSignature/CodeDirectory +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64_x86_64-simulator/LogDropSDK.framework/Headers/LogDropSDK-Swift.h +150 -18
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64_x86_64-simulator/LogDropSDK.framework/Info.plist +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64_x86_64-simulator/LogDropSDK.framework/LogDropSDK +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64_x86_64-simulator/LogDropSDK.framework/Modules/LogDropSDK.swiftmodule/arm64-apple-ios-simulator.abi.json +3200 -1483
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64_x86_64-simulator/LogDropSDK.framework/Modules/LogDropSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +253 -293
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64_x86_64-simulator/LogDropSDK.framework/Modules/LogDropSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64_x86_64-simulator/LogDropSDK.framework/Modules/LogDropSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface +253 -293
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64_x86_64-simulator/LogDropSDK.framework/Modules/LogDropSDK.swiftmodule/x86_64-apple-ios-simulator.abi.json +3200 -1483
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64_x86_64-simulator/LogDropSDK.framework/Modules/LogDropSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +253 -293
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64_x86_64-simulator/LogDropSDK.framework/Modules/LogDropSDK.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64_x86_64-simulator/LogDropSDK.framework/Modules/LogDropSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +253 -293
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64_x86_64-simulator/LogDropSDK.framework/Modules/module.modulemap +0 -1
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64_x86_64-simulator/LogDropSDK.framework/PLCrashReporter_CrashReporter.bundle/Info.plist +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64_x86_64-simulator/LogDropSDK.framework/PLCrashReporter_CrashReporter.bundle/_CodeSignature/CodeDirectory +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64_x86_64-simulator/LogDropSDK.framework/Promises_FBLPromises.bundle/Info.plist +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64_x86_64-simulator/LogDropSDK.framework/Promises_FBLPromises.bundle/_CodeSignature/CodeDirectory +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64_x86_64-simulator/LogDropSDK.framework/Promises_Promises.bundle/Info.plist +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64_x86_64-simulator/LogDropSDK.framework/Promises_Promises.bundle/_CodeSignature/CodeDirectory +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64_x86_64-simulator/LogDropSDK.framework/SwiftProtobuf_SwiftProtobuf.bundle/Info.plist +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64_x86_64-simulator/LogDropSDK.framework/SwiftProtobuf_SwiftProtobuf.bundle/_CodeSignature/CodeDirectory +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64_x86_64-simulator/LogDropSDK.framework/_CodeSignature/CodeResources +25 -25
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64_x86_64-simulator/LogDropSDK.framework/nanopb_nanopb.bundle/Info.plist +0 -0
- package/ios-sdk/Frameworks/LogDropSDK.xcframework/ios-arm64_x86_64-simulator/LogDropSDK.framework/nanopb_nanopb.bundle/_CodeSignature/CodeDirectory +0 -0
- package/ios-sdk/LogDrop.podspec +2 -2
- package/ios-sdk/VERSION +1 -1
- package/lib/module/LogDrop.js +20 -0
- package/lib/module/LogDrop.js.map +1 -1
- package/lib/module/LogDropConfig.js +12 -1
- package/lib/module/LogDropConfig.js.map +1 -1
- package/lib/module/LogDropNavigation.js +58 -0
- package/lib/module/LogDropNavigation.js.map +1 -0
- package/lib/module/index.js +2 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/LogDrop.d.ts +11 -0
- package/lib/typescript/src/LogDrop.d.ts.map +1 -1
- package/lib/typescript/src/LogDropConfig.d.ts +13 -0
- package/lib/typescript/src/LogDropConfig.d.ts.map +1 -1
- package/lib/typescript/src/LogDropNavigation.d.ts +52 -0
- package/lib/typescript/src/LogDropNavigation.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +3 -2
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/LogDrop.ts +22 -0
- package/src/LogDropConfig.ts +18 -0
- package/src/LogDropNavigation.ts +89 -0
- package/src/index.tsx +22 -2
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ yarn add @log-drop/react-native
|
|
|
23
23
|
cd ios && pod install && cd ..
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
The native LogDrop iOS SDK (iOS
|
|
26
|
+
The native LogDrop iOS SDK (iOS 15.0 or later) ships inside this package and is embedded by
|
|
27
27
|
`pod install`. Your `Podfile` needs no `pod 'LogDrop'` line for the app target.
|
|
28
28
|
|
|
29
29
|
### 2. Initialize LogDrop before your app starts
|
|
@@ -43,6 +43,8 @@ LogDrop.init(config);
|
|
|
43
43
|
```
|
|
44
44
|
|
|
45
45
|
> 💡 Make sure to initialize LogDrop **only once** during app startup.
|
|
46
|
+
> 💡 Native automatic screen tracking is off by default; screen names come from JavaScript
|
|
47
|
+
> (see [Screen tracking](#-screen-tracking)).
|
|
46
48
|
> 💡 You can later update the app ID dynamically with `LogDrop.setAppId("YOUR_APP_ID")`.
|
|
47
49
|
|
|
48
50
|
### 3. Upload iOS symbols
|
|
@@ -137,8 +139,8 @@ allprojects {
|
|
|
137
139
|
Then, add the following classpath dependencies to the buildscript section of `android/build.gradle`:
|
|
138
140
|
|
|
139
141
|
```gradle
|
|
140
|
-
classpath("io.logdrop.gradle:plugin:1.
|
|
141
|
-
classpath("io.logdrop.gradle:rnplugin:1.0.
|
|
142
|
+
classpath("io.logdrop.gradle:plugin:1.1.3")
|
|
143
|
+
classpath("io.logdrop.gradle:rnplugin:1.0.4")
|
|
142
144
|
```
|
|
143
145
|
|
|
144
146
|
To enable LogDrop integration, add the following plugins to your `android/app/build.gradle` file:
|
|
@@ -177,6 +179,9 @@ LogDropReactNative.initLogDrop(config)
|
|
|
177
179
|
}
|
|
178
180
|
```
|
|
179
181
|
|
|
182
|
+
Native automatic screen tracking is off by default; screen names come from JavaScript
|
|
183
|
+
(see [Screen tracking](#-screen-tracking)).
|
|
184
|
+
|
|
180
185
|
---
|
|
181
186
|
|
|
182
187
|
## 🔔 Push Notification Setup
|
|
@@ -435,6 +440,24 @@ LogDrop panel.
|
|
|
435
440
|
|
|
436
441
|
---
|
|
437
442
|
|
|
443
|
+
### `LogDrop.trackScreen(name: string): void`
|
|
444
|
+
Sets the screen the user is looking at. A name different from the current screen
|
|
445
|
+
records a `screen_view`. Keep names stable and free of user data (`'ProductDetail'`,
|
|
446
|
+
not the product name); names longer than 100 characters are cut by the native SDK.
|
|
447
|
+
Blank names are ignored. See [Screen tracking](#-screen-tracking).
|
|
448
|
+
|
|
449
|
+
```ts
|
|
450
|
+
LogDrop.trackScreen('ProductDetail');
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
---
|
|
454
|
+
|
|
455
|
+
### `createLogDropNavigationTracker(navigationRef, options?)`
|
|
456
|
+
Sends React Navigation screen changes to `LogDrop.trackScreen`. See
|
|
457
|
+
[Screen tracking](#-screen-tracking).
|
|
458
|
+
|
|
459
|
+
---
|
|
460
|
+
|
|
438
461
|
### `LogDrop.trackDeepLink(url: string): void`
|
|
439
462
|
Tracks a deep link or universal link URL in the native LogDrop SDK.
|
|
440
463
|
|
|
@@ -574,6 +597,55 @@ const subscription = AppState.addEventListener('change', (state) => {
|
|
|
574
597
|
|
|
575
598
|
---
|
|
576
599
|
|
|
600
|
+
## 📱 Screen tracking
|
|
601
|
+
|
|
602
|
+
Requires native LogDrop SDK 2.1.16 or later (bundled with this version).
|
|
603
|
+
|
|
604
|
+
The native SDKs can track screens automatically, but in a React Native app they
|
|
605
|
+
mostly see the one host `Activity` and the root view controller (react-native-screens
|
|
606
|
+
may add a few native ones), and returning to that host after a push popup, browser
|
|
607
|
+
or other Activity records it as a screen again. So this SDK turns native
|
|
608
|
+
automatic tracking off by default and screens are named from JavaScript. To turn it back on:
|
|
609
|
+
|
|
610
|
+
- **iOS:** `new LogDropConfigBuilder().setAutomaticScreenTracking(true)` before `LogDrop.init`.
|
|
611
|
+
- **Android:** `LogDropReactNativeConfig.Builder(this).automaticScreenTracking(true)` in `MainApplication.kt`.
|
|
612
|
+
|
|
613
|
+
### React Navigation
|
|
614
|
+
|
|
615
|
+
`createLogDropNavigationTracker` reads the current route from your navigation
|
|
616
|
+
container ref and calls `LogDrop.trackScreen(route.name)` when it changes. It does not
|
|
617
|
+
depend on `@react-navigation/native`; any ref with `getCurrentRoute()` works, either
|
|
618
|
+
the ref object itself or a `useRef` holder.
|
|
619
|
+
|
|
620
|
+
```tsx
|
|
621
|
+
import {
|
|
622
|
+
NavigationContainer,
|
|
623
|
+
createNavigationContainerRef,
|
|
624
|
+
} from '@react-navigation/native';
|
|
625
|
+
import { createLogDropNavigationTracker } from '@log-drop/react-native';
|
|
626
|
+
|
|
627
|
+
const navigationRef = createNavigationContainerRef();
|
|
628
|
+
const logDropNavigation = createLogDropNavigationTracker(navigationRef);
|
|
629
|
+
|
|
630
|
+
export default function App() {
|
|
631
|
+
return (
|
|
632
|
+
<NavigationContainer
|
|
633
|
+
ref={navigationRef}
|
|
634
|
+
onReady={logDropNavigation.onReady}
|
|
635
|
+
onStateChange={logDropNavigation.onStateChange}
|
|
636
|
+
>
|
|
637
|
+
{/* ... */}
|
|
638
|
+
</NavigationContainer>
|
|
639
|
+
);
|
|
640
|
+
}
|
|
641
|
+
```
|
|
642
|
+
|
|
643
|
+
Pass `{ screenName: (route) => ... }` as the second argument to rename routes, or
|
|
644
|
+
return `undefined` to skip one. Other navigation libraries can call
|
|
645
|
+
`LogDrop.trackScreen` directly.
|
|
646
|
+
|
|
647
|
+
---
|
|
648
|
+
|
|
577
649
|
## 🧭 End-to-end tracing
|
|
578
650
|
|
|
579
651
|
The native LogDrop Android and iOS SDKs trace the HTTP requests your app makes
|
|
@@ -584,7 +656,7 @@ There is nothing to configure in JavaScript and no OpenTelemetry package to add:
|
|
|
584
656
|
the React Native SDK creates, queues and sends no spans of its own.
|
|
585
657
|
|
|
586
658
|
> **Native versions:** tracing needs LogDrop Android and iOS SDK 2.1.11 or later.
|
|
587
|
-
> This version of the React Native SDK uses Android 2.1.
|
|
659
|
+
> This version of the React Native SDK uses Android 2.1.16 and iOS 2.1.16.
|
|
588
660
|
|
|
589
661
|
- **When it runs:** only while HTTP tracking is turned on for your LogDrop
|
|
590
662
|
project and the SDK is enabled. Otherwise no header is added and no span is
|
|
@@ -5,4 +5,4 @@ LogdropReactNative_compileSdkVersion=35
|
|
|
5
5
|
LogdropReactNative_ndkVersion=27.1.12297006
|
|
6
6
|
# Native LogDrop Android SDK; an app can override it with `ext.logdropSdkVersion`. Tracing
|
|
7
7
|
# (traceparent propagation and OTLP export) needs the first native release after 2.1.10.
|
|
8
|
-
LogdropReactNative_logdropSdkVersion=2.1.
|
|
8
|
+
LogdropReactNative_logdropSdkVersion=2.1.16
|
|
@@ -21,6 +21,7 @@ object LogDropReactNative {
|
|
|
21
21
|
config.baseUrl?.let { baseUrl(it) }
|
|
22
22
|
config.isLoggingEnabled?.let { logcatEnabled(it) }
|
|
23
23
|
config.initialIsSDKDisabledValue?.let { initialIsSDKDisabledValue(it) }
|
|
24
|
+
automaticScreenTracking(config.automaticScreenTracking ?: false)
|
|
24
25
|
frameworkType(config.framework)
|
|
25
26
|
}.build())
|
|
26
27
|
}
|
|
@@ -10,7 +10,7 @@ class LogDropReactNativeConfig private constructor(
|
|
|
10
10
|
val initialIsSDKDisabledValue: Boolean?,
|
|
11
11
|
val context: Context,
|
|
12
12
|
val framework: FrameworkType,
|
|
13
|
-
|
|
13
|
+
val automaticScreenTracking: Boolean?,
|
|
14
14
|
) {
|
|
15
15
|
class Builder(private val context: Context) {
|
|
16
16
|
private var appId: String? = null
|
|
@@ -18,6 +18,7 @@ class LogDropReactNativeConfig private constructor(
|
|
|
18
18
|
private var isLoggingEnabled: Boolean? = null
|
|
19
19
|
private var initialIsSDKDisabledValue: Boolean? = null
|
|
20
20
|
private var framework: FrameworkType = FrameworkType.REACT_NATIVE
|
|
21
|
+
private var automaticScreenTracking: Boolean? = null
|
|
21
22
|
|
|
22
23
|
fun appId(appId: String) = apply { this.appId = appId }
|
|
23
24
|
|
|
@@ -35,6 +36,14 @@ class LogDropReactNativeConfig private constructor(
|
|
|
35
36
|
|
|
36
37
|
fun framework(framework: FrameworkType) = apply { this.framework = framework }
|
|
37
38
|
|
|
39
|
+
/**
|
|
40
|
+
* Whether the native SDK tracks Activities and Fragments as screens by itself. Default
|
|
41
|
+
* false: a React Native app mostly has one Activity, so screen names come from JavaScript
|
|
42
|
+
* (`LogDrop.trackScreen` or the navigation tracker).
|
|
43
|
+
*/
|
|
44
|
+
fun automaticScreenTracking(enabled: Boolean) =
|
|
45
|
+
apply { this.automaticScreenTracking = enabled }
|
|
46
|
+
|
|
38
47
|
fun build(): LogDropReactNativeConfig {
|
|
39
48
|
return LogDropReactNativeConfig(
|
|
40
49
|
appId,
|
|
@@ -43,6 +52,7 @@ class LogDropReactNativeConfig private constructor(
|
|
|
43
52
|
initialIsSDKDisabledValue,
|
|
44
53
|
context,
|
|
45
54
|
framework,
|
|
55
|
+
automaticScreenTracking,
|
|
46
56
|
)
|
|
47
57
|
}
|
|
48
58
|
}
|
|
@@ -93,6 +93,12 @@ class LogDropReactNativeModule(reactContext: ReactApplicationContext) :
|
|
|
93
93
|
LogDrop.trackCustomEvent(eventName, restoreWholeNumbers(properties?.toHashMap() ?: emptyMap()))
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
+
/** Native trims, rejects blank names and cuts long ones; any thread. */
|
|
97
|
+
@ReactMethod
|
|
98
|
+
fun trackScreen(name: String) {
|
|
99
|
+
LogDrop.trackScreen(name)
|
|
100
|
+
}
|
|
101
|
+
|
|
96
102
|
@ReactMethod
|
|
97
103
|
fun trackDeepLink(url: String) {
|
|
98
104
|
LogDropReactNative.trackDeepLink(url, reactApplicationContext.currentActivity)
|
|
@@ -23,6 +23,7 @@ RCT_EXTERN_METHOD(flushOtlpTracing:(nonnull NSNumber *)timeoutMs
|
|
|
23
23
|
reject:(RCTPromiseRejectBlock)reject)
|
|
24
24
|
RCT_EXTERN_METHOD(trackCustomEvent:(NSString *)eventName
|
|
25
25
|
properties:(NSDictionary * _Nullable)properties)
|
|
26
|
+
RCT_EXTERN_METHOD(trackScreen:(NSString *)name)
|
|
26
27
|
RCT_EXTERN_METHOD(trackDeepLink:(NSString *)urlString)
|
|
27
28
|
RCT_EXTERN_METHOD(setAppId:(NSString *)appId)
|
|
28
29
|
RCT_EXTERN_METHOD(saveCustomCrashReport:(NSString *)threadName
|
|
@@ -43,6 +43,10 @@ class LogDropReactNative: NSObject {
|
|
|
43
43
|
if let pushAppGroupSuiteName = config["pushAppGroupSuiteName"] as? String {
|
|
44
44
|
builder.setPushAppGroupSuiteName(pushAppGroupSuiteName)
|
|
45
45
|
}
|
|
46
|
+
|
|
47
|
+
// Off unless the app turns it on: in React Native the native tracker mostly sees the root
|
|
48
|
+
// view controller, so screen names come from JavaScript.
|
|
49
|
+
_ = builder.setAutomaticScreenTracking(config["automaticScreenTracking"] as? Bool ?? false)
|
|
46
50
|
|
|
47
51
|
builder.setFrameworkType(.reactNative)
|
|
48
52
|
|
|
@@ -181,6 +185,12 @@ class LogDropReactNative: NSObject {
|
|
|
181
185
|
)
|
|
182
186
|
}
|
|
183
187
|
|
|
188
|
+
/// Native trims, drops blank names and cuts long ones; JavaScript already rejects blanks.
|
|
189
|
+
@objc
|
|
190
|
+
func trackScreen(_ name: String) {
|
|
191
|
+
LogDrop.trackScreen(name)
|
|
192
|
+
}
|
|
193
|
+
|
|
184
194
|
@objc
|
|
185
195
|
func trackDeepLink(_ urlString: String) {
|
|
186
196
|
guard let url = URL(string: urlString.trimmingCharacters(in: .whitespacesAndNewlines)) else {
|
|
@@ -8,32 +8,32 @@
|
|
|
8
8
|
<key>BinaryPath</key>
|
|
9
9
|
<string>LogDropSDK.framework/LogDropSDK</string>
|
|
10
10
|
<key>LibraryIdentifier</key>
|
|
11
|
-
<string>ios-
|
|
11
|
+
<string>ios-arm64</string>
|
|
12
12
|
<key>LibraryPath</key>
|
|
13
13
|
<string>LogDropSDK.framework</string>
|
|
14
14
|
<key>SupportedArchitectures</key>
|
|
15
15
|
<array>
|
|
16
16
|
<string>arm64</string>
|
|
17
|
-
<string>x86_64</string>
|
|
18
17
|
</array>
|
|
19
18
|
<key>SupportedPlatform</key>
|
|
20
19
|
<string>ios</string>
|
|
21
|
-
<key>SupportedPlatformVariant</key>
|
|
22
|
-
<string>simulator</string>
|
|
23
20
|
</dict>
|
|
24
21
|
<dict>
|
|
25
22
|
<key>BinaryPath</key>
|
|
26
23
|
<string>LogDropSDK.framework/LogDropSDK</string>
|
|
27
24
|
<key>LibraryIdentifier</key>
|
|
28
|
-
<string>ios-
|
|
25
|
+
<string>ios-arm64_x86_64-simulator</string>
|
|
29
26
|
<key>LibraryPath</key>
|
|
30
27
|
<string>LogDropSDK.framework</string>
|
|
31
28
|
<key>SupportedArchitectures</key>
|
|
32
29
|
<array>
|
|
33
30
|
<string>arm64</string>
|
|
31
|
+
<string>x86_64</string>
|
|
34
32
|
</array>
|
|
35
33
|
<key>SupportedPlatform</key>
|
|
36
34
|
<string>ios</string>
|
|
35
|
+
<key>SupportedPlatformVariant</key>
|
|
36
|
+
<string>simulator</string>
|
|
37
37
|
</dict>
|
|
38
38
|
</array>
|
|
39
39
|
<key>CFBundlePackageType</key>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#if 0
|
|
2
2
|
#elif defined(__arm64__) && __arm64__
|
|
3
|
-
// Generated by Apple Swift version 6.2 effective-5.10 (swiftlang-6.2.
|
|
3
|
+
// Generated by Apple Swift version 6.4.2 effective-5.10 (swiftlang-6.4.2.1.9 clang-2100.4.1.1)
|
|
4
4
|
#ifndef LOGDROPSDK_SWIFT_H
|
|
5
5
|
#define LOGDROPSDK_SWIFT_H
|
|
6
6
|
#pragma clang diagnostic push
|
|
@@ -26,11 +26,10 @@
|
|
|
26
26
|
#pragma clang diagnostic ignored "-Wauto-import"
|
|
27
27
|
#if defined(__OBJC__)
|
|
28
28
|
#include <Foundation/Foundation.h>
|
|
29
|
-
#endif
|
|
29
|
+
#endif // defined(__OBJC__)
|
|
30
30
|
#if defined(__cplusplus)
|
|
31
31
|
#include <cstdint>
|
|
32
32
|
#include <cstddef>
|
|
33
|
-
#include <cstdbool>
|
|
34
33
|
#include <cstring>
|
|
35
34
|
#include <stdlib.h>
|
|
36
35
|
#include <new>
|
|
@@ -195,13 +194,32 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
|
|
195
194
|
# endif
|
|
196
195
|
#endif
|
|
197
196
|
#if !defined(SWIFT_ENUM)
|
|
198
|
-
#
|
|
199
|
-
#
|
|
200
|
-
#
|
|
197
|
+
# if (defined(__cplusplus) && __cplusplus >= 201103L) || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L) || __has_feature(objc_fixed_enum)
|
|
198
|
+
# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
|
|
199
|
+
# if __has_feature(generalized_swift_name)
|
|
200
|
+
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
|
|
201
|
+
# else
|
|
202
|
+
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility)
|
|
203
|
+
# endif
|
|
201
204
|
# else
|
|
205
|
+
# define SWIFT_ENUM(_type, _name, _extensibility) _type _name; enum
|
|
202
206
|
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility)
|
|
203
207
|
# endif
|
|
204
208
|
#endif
|
|
209
|
+
#if !defined(SWIFT_ENUM_TAG)
|
|
210
|
+
# if (defined(__cplusplus) && __cplusplus >= 201103L) || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L) || __has_feature(objc_fixed_enum)
|
|
211
|
+
# define SWIFT_ENUM_TAG enum
|
|
212
|
+
# else
|
|
213
|
+
# define SWIFT_ENUM_TAG
|
|
214
|
+
# endif
|
|
215
|
+
#endif
|
|
216
|
+
#if !defined(SWIFT_ENUM_FWD_DECL)
|
|
217
|
+
# if (defined(__cplusplus) && __cplusplus >= 201103L) || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L) || __has_feature(objc_fixed_enum)
|
|
218
|
+
# define SWIFT_ENUM_FWD_DECL(_type, _name) enum _name : _type;
|
|
219
|
+
# else
|
|
220
|
+
# define SWIFT_ENUM_FWD_DECL(_type, _name) typedef _type _name;
|
|
221
|
+
# endif
|
|
222
|
+
#endif
|
|
205
223
|
#if !defined(SWIFT_UNAVAILABLE)
|
|
206
224
|
# define SWIFT_UNAVAILABLE __attribute__((unavailable))
|
|
207
225
|
#endif
|
|
@@ -211,6 +229,9 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
|
|
211
229
|
#if !defined(SWIFT_AVAILABILITY)
|
|
212
230
|
# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__)))
|
|
213
231
|
#endif
|
|
232
|
+
#if !defined(SWIFT_AVAILABILITY_DOMAIN)
|
|
233
|
+
# define SWIFT_AVAILABILITY_DOMAIN(dom, ...) __attribute__((availability(domain: dom, __VA_ARGS__)))
|
|
234
|
+
#endif
|
|
214
235
|
#if !defined(SWIFT_WEAK_IMPORT)
|
|
215
236
|
# define SWIFT_WEAK_IMPORT __attribute__((weak_import))
|
|
216
237
|
#endif
|
|
@@ -276,6 +297,50 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
|
|
276
297
|
# define SWIFT_IMPORT_STDLIB_SYMBOL
|
|
277
298
|
#endif
|
|
278
299
|
#endif
|
|
300
|
+
#if !__has_feature(nullability)
|
|
301
|
+
# define _Nonnull
|
|
302
|
+
# define _Nullable
|
|
303
|
+
# define _Null_unspecified
|
|
304
|
+
#elif !defined(__OBJC__)
|
|
305
|
+
# pragma clang diagnostic ignored "-Wnullability-extension"
|
|
306
|
+
#endif
|
|
307
|
+
#if !__has_feature(nullability_nullable_result)
|
|
308
|
+
# define _Nullable_result _Nullable
|
|
309
|
+
#endif
|
|
310
|
+
#if __has_feature(objc_modules)
|
|
311
|
+
#if __has_warning("-Watimport-in-framework-header")
|
|
312
|
+
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
|
|
313
|
+
#endif
|
|
314
|
+
#endif
|
|
315
|
+
|
|
316
|
+
#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch"
|
|
317
|
+
#pragma clang diagnostic ignored "-Wduplicate-method-arg"
|
|
318
|
+
#if __has_warning("-Wpragma-clang-attribute")
|
|
319
|
+
# pragma clang diagnostic ignored "-Wpragma-clang-attribute"
|
|
320
|
+
#endif
|
|
321
|
+
#pragma clang diagnostic ignored "-Wunknown-pragmas"
|
|
322
|
+
#pragma clang diagnostic ignored "-Wnullability"
|
|
323
|
+
#pragma clang diagnostic ignored "-Warc-bridge-casts-disallowed-in-nonarc"
|
|
324
|
+
#pragma clang diagnostic ignored "-Wdollar-in-identifier-extension"
|
|
325
|
+
#pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
|
|
326
|
+
|
|
327
|
+
#if __has_attribute(external_source_symbol)
|
|
328
|
+
# pragma push_macro("any")
|
|
329
|
+
# undef any
|
|
330
|
+
# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="LogDropSDK",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol))
|
|
331
|
+
# pragma pop_macro("any")
|
|
332
|
+
#endif
|
|
333
|
+
|
|
334
|
+
#if defined(__cplusplus)
|
|
335
|
+
extern "C" {
|
|
336
|
+
#endif
|
|
337
|
+
|
|
338
|
+
#if defined(__cplusplus)
|
|
339
|
+
} // extern "C"
|
|
340
|
+
#endif
|
|
341
|
+
#if __has_attribute(external_source_symbol)
|
|
342
|
+
# pragma clang attribute pop
|
|
343
|
+
#endif
|
|
279
344
|
#if defined(__OBJC__)
|
|
280
345
|
#if __has_feature(objc_modules)
|
|
281
346
|
#if __has_warning("-Watimport-in-framework-header")
|
|
@@ -287,7 +352,7 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
|
|
287
352
|
@import WebKit;
|
|
288
353
|
#endif
|
|
289
354
|
|
|
290
|
-
#endif
|
|
355
|
+
#endif // defined(__OBJC__)
|
|
291
356
|
#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch"
|
|
292
357
|
#pragma clang diagnostic ignored "-Wduplicate-method-arg"
|
|
293
358
|
#if __has_warning("-Wpragma-clang-attribute")
|
|
@@ -295,6 +360,7 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
|
|
|
295
360
|
#endif
|
|
296
361
|
#pragma clang diagnostic ignored "-Wunknown-pragmas"
|
|
297
362
|
#pragma clang diagnostic ignored "-Wnullability"
|
|
363
|
+
#pragma clang diagnostic ignored "-Warc-bridge-casts-disallowed-in-nonarc"
|
|
298
364
|
#pragma clang diagnostic ignored "-Wdollar-in-identifier-extension"
|
|
299
365
|
#pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
|
|
300
366
|
|
|
@@ -344,7 +410,7 @@ SWIFT_CLASS_NAMED("LogDropWKWebViewSwizzleHelper")
|
|
|
344
410
|
+ (void)enableLogDropNetworkCaptureSwizzle;
|
|
345
411
|
@end
|
|
346
412
|
|
|
347
|
-
#endif
|
|
413
|
+
#endif // defined(__OBJC__)
|
|
348
414
|
#if __has_attribute(external_source_symbol)
|
|
349
415
|
# pragma clang attribute pop
|
|
350
416
|
#endif
|
|
Binary file
|