invertase / invertase/react-native-firebase
🔥 [🐛] missing ga_session_id on part of iOS Analytics events since upgrading to v23.8.3
- Dominant language
- TypeScript
- Stars
- 12.3k
- Forks
- 2.3k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 79
Description
## Issue
Hello team,
Since upgrading @react-native-firebase to v23.8.3 (Firebase iOS SDK 12.8.0), on iOS, we are seeing a significant number (~4%) of Analytics events with a missing ga_session_id in production. This was present on the previous version but on a much smaller scale (~0.3%), and the upgrade is the only change correlated with the regression.
After inspecting GA4 events grouped by device, it appears that whenever this issue occurs, all events for the affected session are missing ga_session_id. We also noticed that the session_start event, which would normally precede the rest of the session's events, is also missing. Events from the same device begin reporting a valid ga_session_id again only after the session is recreated (e.g., the app is restarted after 30min).
This behaviour is consistent across all iOS versions we've analyzed (iOS 16 through iOS 26).
We suspect the cause may be related to background launches (e.g. triggered by silent push notifications). However, we were not able to reproduce this issue at all in development.
Thank you very much for the support
---
## Project Files
### Javascript
Click To Expand
#### `package.json`:
package.json:
```
{
"@react-native-firebase/analytics": "23.8.8",
"@react-native-firebase/app": "23.8.8",
"@react-native-firebase/crashlytics": "23.8.8",
"@react-native-firebase/installations": "23.8.8",
"@react-native-firebase/remote-config": "23.8.8",
"react-native": "0.81.6"
}
```
### iOS
Click To Expand
#### `ios/Podfile`:
- [ ] I'm not using Pods
- [x] I'm using Pods and my Podfile looks like:
```
use_frameworks! :linkage => :static
$RNFirebaseAsStaticFramework = true
target 'XXXX' do
pod 'FirebaseMessaging', '12.10.0'
end
```
#### `AppDelegate.m`:
```objc
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{
...
[FIRApp configure];
....
}
```
---
### Android
Not investigated; issue observed on iOS only.
---
## Environment
Click To Expand
**`react-native info` output:**
```
System:
OS: macOS 26.5.2
CPU: (12) arm64 Apple M3 Pro
Binaries:
Node: 20.19.4
CocoaPods: 1.16.2
npmPackages:
react: 19.1.4
react-native: 0.81.6
iOS:
hermesEnabled: true
newArchEnabled: true
```
- **Platform that you're experiencing the issue on**:
- [x] iOS
- [ ] Android
- [ ] **iOS** but have not tested behavior on Android
- [ ] **Android** but have not tested behavior on iOS
- [ ] Both
- **`react-native-firebase` version you're using that has this issue:**
- initially seen in 23.8.3, now on 23.8.8 with same issue
- **`Firebase` module(s) you're using that has the issue:**
- @react-native-firebase/analytics, @react-native-firebase/crashlytics
- **Are you using `TypeScript`?**
- Y & 5.8
Contributor guide
Research direction
Start with the Analytics version details in package.json and the Firebase versions in ios/Podfile, then inspect initialization in AppDelegate.m. Compare events from normal launches with events associated with background launches, especially session_start and ga_session_id. Done means identifying a reproducible cause or confirmed regression and verifying that affected iOS sessions report both values consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ios, react-native, typescript
- Domain
- analytics, mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100