@react-native-firebase/analytics 24.1.0 → 25.0.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/CHANGELOG.md CHANGED
@@ -3,6 +3,33 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [25.0.0](https://github.com/invertase/react-native-firebase/compare/v24.0.0...v25.0.0) (2026-06-23)
7
+
8
+ ### ⚠ BREAKING CHANGES
9
+
10
+ - **auth:** migrate to TypeScript and bring auth closer in alignment with firebase-js-sdk API (#8991)
11
+ - **analytics:** as anyone that relied on this param previously is hopefully happy
12
+ to have it actually work now versus silently fail
13
+
14
+ ### Features
15
+
16
+ - **analytics:** add Expo config plugin for withoutAdIdSupport ([#8969](https://github.com/invertase/react-native-firebase/issues/8969)) ([483c143](https://github.com/invertase/react-native-firebase/commit/483c14343e7595bc539b03040ff760cfdae4421d))
17
+ - **analytics:** add support for googleAppMeasurementOnDeviceConversion in iOS Expo plugin ([#9014](https://github.com/invertase/react-native-firebase/issues/9014)) ([6edab6f](https://github.com/invertase/react-native-firebase/commit/6edab6f14547c3d41ffdfd8ab43e7ff7979647c7))
18
+
19
+ ### Bug Fixes
20
+
21
+ - **analytics:** cast item INDEX param to integer ([16efa30](https://github.com/invertase/react-native-firebase/commit/16efa30e4d58af4a9cb44ecc8dd47c7c50c60f1c))
22
+ - **analytics:** coerce all number params from js double to native integral ([f913b77](https://github.com/invertase/react-native-firebase/commit/f913b779174427c3f00bb187b305a035b6c9bae5))
23
+ - **analytics:** success param type now boolean - never worked before, now works ([ff53e9e](https://github.com/invertase/react-native-firebase/commit/ff53e9ea41c5c9268094928d4e4516a9d9700fbf))
24
+
25
+ ### Code Refactoring
26
+
27
+ - **auth:** migrate to TypeScript and bring auth closer in alignment with firebase-js-sdk API ([#8991](https://github.com/invertase/react-native-firebase/issues/8991)) ([7cf7c1a](https://github.com/invertase/react-native-firebase/commit/7cf7c1ac0d31d09ade581deb027d4ed8126bb7cf))
28
+
29
+ ## [24.1.1](https://github.com/invertase/react-native-firebase/compare/v24.1.0...v24.1.1) (2026-06-10)
30
+
31
+ **Note:** Version bump only for package @react-native-firebase/analytics
32
+
6
33
  ## [24.1.0](https://github.com/invertase/react-native-firebase/compare/v24.0.0...v24.1.0) (2026-06-05)
7
34
 
8
35
  ### Features
@@ -18,6 +18,8 @@ package io.invertase.firebase.analytics;
18
18
  */
19
19
 
20
20
  import android.os.Bundle;
21
+ import android.os.Handler;
22
+ import android.os.Looper;
21
23
  import com.facebook.react.bridge.Arguments;
22
24
  import com.facebook.react.bridge.Promise;
23
25
  import com.facebook.react.bridge.ReactApplicationContext;
@@ -27,10 +29,12 @@ import com.google.firebase.analytics.FirebaseAnalytics;
27
29
  import io.invertase.firebase.common.ReactNativeFirebaseModule;
28
30
  import java.util.ArrayList;
29
31
  import java.util.Locale;
32
+ import java.util.concurrent.atomic.AtomicBoolean;
30
33
  import javax.annotation.Nullable;
31
34
 
32
35
  public class ReactNativeFirebaseAnalyticsModule extends ReactNativeFirebaseModule {
33
36
  private static final String SERVICE_NAME = "Analytics";
37
+ private static final long GET_SESSION_ID_TIMEOUT_MS = 60_000L;
34
38
 
35
39
  /**
36
40
  * GA4 parameters that must be sent as long values. React Native's bridge stores JS numbers as
@@ -112,10 +116,24 @@ public class ReactNativeFirebaseAnalyticsModule extends ReactNativeFirebaseModul
112
116
 
113
117
  @ReactMethod
114
118
  public void getSessionId(Promise promise) {
119
+ final AtomicBoolean completed = new AtomicBoolean(false);
120
+ final Handler handler = new Handler(Looper.getMainLooper());
121
+ final Runnable timeoutRunnable =
122
+ () -> {
123
+ if (completed.compareAndSet(false, true)) {
124
+ promise.resolve(null);
125
+ }
126
+ };
127
+ handler.postDelayed(timeoutRunnable, GET_SESSION_ID_TIMEOUT_MS);
128
+
115
129
  module
116
130
  .getSessionId()
117
131
  .addOnCompleteListener(
118
132
  task -> {
133
+ handler.removeCallbacks(timeoutRunnable);
134
+ if (!completed.compareAndSet(false, true)) {
135
+ return;
136
+ }
119
137
  if (task.isSuccessful()) {
120
138
  Long result = task.getResult();
121
139
  promise.resolve(result != null ? result.doubleValue() : null);
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
 
3
3
  // Generated by genversion.
4
- export const version = '24.1.0';
4
+ export const version = '25.0.0';
5
5
  //# sourceMappingURL=version.js.map
@@ -1,2 +1,2 @@
1
- export declare const version = "24.1.0";
1
+ export declare const version = "25.0.0";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -157,7 +157,24 @@ RCT_EXPORT_METHOD(getAppInstanceId
157
157
  RCT_EXPORT_METHOD(getSessionId
158
158
  : (RCTPromiseResolveBlock)resolve rejecter
159
159
  : (RCTPromiseRejectBlock)reject) {
160
+ __block BOOL completed = NO;
161
+ const int64_t timeoutNs = (int64_t)(60 * NSEC_PER_SEC);
162
+
163
+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, timeoutNs), dispatch_get_main_queue(), ^{
164
+ if (completed) {
165
+ return;
166
+ }
167
+ completed = YES;
168
+ DLog(@"Error getting session ID: timed out after 60 seconds");
169
+ resolve([NSNull null]);
170
+ });
171
+
160
172
  [FIRAnalytics sessionIDWithCompletion:^(int64_t sessionID, NSError *_Nullable error) {
173
+ if (completed) {
174
+ return;
175
+ }
176
+ completed = YES;
177
+
161
178
  // Occasionally sessionID is 0 despite nil error, reject as if it were an error
162
179
  // https://github.com/firebase/firebase-ios-sdk/issues/15258
163
180
  if (!error && [NSNumber numberWithLongLong:sessionID] == 0) {
package/lib/version.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- export const version = '24.1.0';
2
+ export const version = '25.0.0';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-native-firebase/analytics",
3
- "version": "24.1.0",
3
+ "version": "25.0.0",
4
4
  "author": "Invertase <oss@invertase.io> (http://invertase.io)",
5
5
  "description": "React Native Firebase - The analytics module provides out of the box support with Google Analytics for Firebase. Integration with the Android & iOS allows for in-depth analytical insight reporting, such as device information, location, user actions and more.",
6
6
  "main": "./dist/module/index.js",
@@ -25,7 +25,7 @@
25
25
  "analytics"
26
26
  ],
27
27
  "peerDependencies": {
28
- "@react-native-firebase/app": "24.1.0",
28
+ "@react-native-firebase/app": "25.0.0",
29
29
  "expo": ">=47.0.0"
30
30
  },
31
31
  "publishConfig": {
@@ -36,9 +36,9 @@
36
36
  "superstruct": "^2.0.2"
37
37
  },
38
38
  "devDependencies": {
39
- "expo": "^55.0.5",
40
- "react-native-builder-bob": "^0.40.17",
41
- "typescript": "^5.9.3"
39
+ "expo": "^55.0.18",
40
+ "react-native-builder-bob": "^0.41.0",
41
+ "typescript": "^6.0.3"
42
42
  },
43
43
  "peerDependenciesMeta": {
44
44
  "expo": {
@@ -76,5 +76,5 @@
76
76
  "node_modules/",
77
77
  "dist/"
78
78
  ],
79
- "gitHead": "804a51fd265453f2385adb0ac96a6abf992c0316"
79
+ "gitHead": "eac5bf5f3c80b158bf85b33789e4b64bfd16bbe1"
80
80
  }
@@ -1,6 +1,3 @@
1
- import {
2
- withIosWithoutAdIdSupport,
3
- withIosGoogleAppMeasurementOnDeviceConversion,
4
- } from './podfile';
1
+ import { withIosWithoutAdIdSupport, withIosGoogleAppMeasurementOnDeviceConversion } from './podfile';
5
2
 
6
3
  export { withIosWithoutAdIdSupport, withIosGoogleAppMeasurementOnDeviceConversion };
@@ -3,7 +3,8 @@
3
3
  "compilerOptions": {
4
4
  "outDir": "build",
5
5
  "rootDir": "src",
6
- "declaration": true
6
+ "declaration": true,
7
+ "types": ["react-native", "node"]
7
8
  },
8
9
  "include": ["./src"]
9
10
  }
@@ -1 +1 @@
1
- {"root":["./src/index.ts","./src/pluginConfig.ts","./src/ios/index.ts","./src/ios/podfile.ts"],"version":"5.9.3"}
1
+ {"root":["./src/index.ts","./src/pluginConfig.ts","./src/ios/index.ts","./src/ios/podfile.ts"],"version":"6.0.3"}
package/tsconfig.json CHANGED
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "extends": "../../tsconfig.packages.base.json",
3
3
  "compilerOptions": {
4
- "baseUrl": ".",
5
4
  "rootDir": ".",
6
5
  "paths": {
7
6
  "@react-native-firebase/app/dist/module/common/*": ["../app/dist/typescript/lib/common/*"],
@@ -14,7 +13,8 @@
14
13
  ],
15
14
  "@react-native-firebase/app/dist/module/internal": ["../app/dist/typescript/lib/internal"],
16
15
  "@react-native-firebase/app": ["../app/dist/typescript/lib"]
17
- }
16
+ },
17
+ "types": ["react-native", "node"]
18
18
  },
19
19
  "include": ["lib/**/*"],
20
20
  "exclude": ["node_modules", "dist", "__tests__", "**/*.test.ts"]