-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(analytics): extend_session parameter #5973
Conversation
Firebase requires a long value in Android for the extend_session parameter. See https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics.Param#public-static-final-string-extend_session
Firebase in iOS expects an extend_session value of @yES. See https://firebase.google.com/docs/reference/ios/firebaseanalytics/api/reference/Constants#/c:FIRParameterNames.h@kFIRParameterExtendSession
This pull request is being automatically deployed with Vercel (learn more). react-native-firebase-next – ./website_modular🔍 Inspect: https://vercel.com/invertase/react-native-firebase-next/6uffq1LtEfaenCzyy9iaiBDB6xgs react-native-firebase – ./🔍 Inspect: https://vercel.com/invertase/react-native-firebase/5bvPJna8zSsc6DbKxVkn4iYa5Gaw |
Codecov Report
@@ Coverage Diff @@
## main #5973 +/- ##
============================================
- Coverage 53.04% 53.02% -0.01%
Complexity 622 622
============================================
Files 208 208
Lines 10171 10174 +3
Branches 1618 1619 +1
============================================
Hits 5394 5394
- Misses 4523 4526 +3
Partials 254 254 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting! This LGTM - subtle problem, nice fix
Description
This PR modifies the event parameters so that the
extend_session
parameter is cast to the correct value.Motivation
From Firebase documentation (under the heading "Adjust app session timeout"):
We found in development that the
extend_session
parameter wasn't being respected through react-native-firebase because they were set to the incorrect values. Android docs specify a long value of 1. iOS docs specify a value of@YES
.Checklist
Android
iOS
e2e
tests added or updated inpackages/\*\*/e2e
jest
tests added or updated inpackages/\*\*/__tests__
Test Plan
We've used this same code in production, applied via patch-package.
On Android, LogCat shows a helpful message once the value is correctly set:
iOS doesn't show the same confirmation message, but I can confirm through our own app analytics session data that it works.
🔥