@react-native-firebase/analytics 23.6.0 → 23.8.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.
Files changed (132) hide show
  1. package/dist/commonjs/index.js +38 -0
  2. package/dist/commonjs/index.js.map +1 -0
  3. package/dist/commonjs/modular.js +613 -0
  4. package/dist/commonjs/modular.js.map +1 -0
  5. package/dist/commonjs/namespaced.js +441 -0
  6. package/dist/commonjs/namespaced.js.map +1 -0
  7. package/dist/commonjs/package.json +1 -0
  8. package/dist/commonjs/struct.js +54 -0
  9. package/dist/commonjs/struct.js.map +1 -0
  10. package/dist/commonjs/structs.js +214 -0
  11. package/dist/commonjs/structs.js.map +1 -0
  12. package/dist/commonjs/types/analytics.js +79 -0
  13. package/dist/commonjs/types/analytics.js.map +1 -0
  14. package/dist/commonjs/types/web.js +2 -0
  15. package/dist/commonjs/types/web.js.map +1 -0
  16. package/dist/commonjs/version.js +9 -0
  17. package/dist/commonjs/version.js.map +1 -0
  18. package/dist/commonjs/web/RNFBAnalyticsModule.android.js +9 -0
  19. package/dist/commonjs/web/RNFBAnalyticsModule.android.js.map +1 -0
  20. package/dist/commonjs/web/RNFBAnalyticsModule.ios.js +9 -0
  21. package/dist/commonjs/web/RNFBAnalyticsModule.ios.js.map +1 -0
  22. package/dist/commonjs/web/RNFBAnalyticsModule.js +119 -0
  23. package/dist/commonjs/web/RNFBAnalyticsModule.js.map +1 -0
  24. package/dist/commonjs/web/api.js +294 -0
  25. package/dist/commonjs/web/api.js.map +1 -0
  26. package/{ios/RNFBAnalytics/RNFBAnalyticsModule.h → dist/module/index.js} +10 -6
  27. package/dist/module/index.js.map +1 -0
  28. package/{lib/modular/index.js → dist/module/modular.js} +43 -161
  29. package/dist/module/modular.js.map +1 -0
  30. package/dist/module/namespaced.js +438 -0
  31. package/dist/module/namespaced.js.map +1 -0
  32. package/dist/module/package.json +1 -0
  33. package/{lib → dist/module}/struct.js +12 -14
  34. package/dist/module/struct.js.map +1 -0
  35. package/dist/module/structs.js +210 -0
  36. package/dist/module/structs.js.map +1 -0
  37. package/dist/module/types/analytics.js +75 -0
  38. package/dist/module/types/analytics.js.map +1 -0
  39. package/dist/module/types/web.js +2 -0
  40. package/dist/module/types/web.js.map +1 -0
  41. package/dist/module/version.js +5 -0
  42. package/dist/module/version.js.map +1 -0
  43. package/dist/module/web/RNFBAnalyticsModule.android.js +6 -0
  44. package/dist/module/web/RNFBAnalyticsModule.android.js.map +1 -0
  45. package/dist/module/web/RNFBAnalyticsModule.ios.js +6 -0
  46. package/dist/module/web/RNFBAnalyticsModule.ios.js.map +1 -0
  47. package/{lib → dist/module}/web/RNFBAnalyticsModule.js +17 -21
  48. package/dist/module/web/RNFBAnalyticsModule.js.map +1 -0
  49. package/{lib → dist/module}/web/api.js +34 -77
  50. package/dist/module/web/api.js.map +1 -0
  51. package/dist/typescript/commonjs/lib/index.d.ts +5 -0
  52. package/dist/typescript/commonjs/lib/index.d.ts.map +1 -0
  53. package/dist/typescript/commonjs/lib/modular.d.ts +476 -0
  54. package/dist/typescript/commonjs/lib/modular.d.ts.map +1 -0
  55. package/dist/typescript/commonjs/lib/namespaced.d.ts +12 -0
  56. package/dist/typescript/commonjs/lib/namespaced.d.ts.map +1 -0
  57. package/dist/typescript/commonjs/lib/struct.d.ts +3 -0
  58. package/dist/typescript/commonjs/lib/struct.d.ts.map +1 -0
  59. package/dist/typescript/commonjs/lib/structs.d.ts +1155 -0
  60. package/dist/typescript/commonjs/lib/structs.d.ts.map +1 -0
  61. package/dist/typescript/commonjs/lib/types/analytics.d.ts +944 -0
  62. package/dist/typescript/commonjs/lib/types/analytics.d.ts.map +1 -0
  63. package/dist/typescript/commonjs/lib/types/web.d.ts +36 -0
  64. package/dist/typescript/commonjs/lib/types/web.d.ts.map +1 -0
  65. package/dist/typescript/commonjs/lib/version.d.ts +2 -0
  66. package/dist/typescript/commonjs/lib/version.d.ts.map +1 -0
  67. package/dist/typescript/commonjs/lib/web/RNFBAnalyticsModule.android.d.ts +3 -0
  68. package/dist/typescript/commonjs/lib/web/RNFBAnalyticsModule.android.d.ts.map +1 -0
  69. package/dist/typescript/commonjs/lib/web/RNFBAnalyticsModule.d.ts +9 -0
  70. package/dist/typescript/commonjs/lib/web/RNFBAnalyticsModule.d.ts.map +1 -0
  71. package/dist/typescript/commonjs/lib/web/RNFBAnalyticsModule.ios.d.ts +3 -0
  72. package/dist/typescript/commonjs/lib/web/RNFBAnalyticsModule.ios.d.ts.map +1 -0
  73. package/dist/typescript/commonjs/lib/web/api.d.ts +37 -0
  74. package/dist/typescript/commonjs/lib/web/api.d.ts.map +1 -0
  75. package/dist/typescript/commonjs/package.json +1 -0
  76. package/dist/typescript/module/lib/index.d.ts +5 -0
  77. package/dist/typescript/module/lib/index.d.ts.map +1 -0
  78. package/dist/typescript/module/lib/modular.d.ts +476 -0
  79. package/dist/typescript/module/lib/modular.d.ts.map +1 -0
  80. package/dist/typescript/module/lib/namespaced.d.ts +12 -0
  81. package/dist/typescript/module/lib/namespaced.d.ts.map +1 -0
  82. package/dist/typescript/module/lib/struct.d.ts +3 -0
  83. package/dist/typescript/module/lib/struct.d.ts.map +1 -0
  84. package/dist/typescript/module/lib/structs.d.ts +1155 -0
  85. package/dist/typescript/module/lib/structs.d.ts.map +1 -0
  86. package/dist/typescript/module/lib/types/analytics.d.ts +944 -0
  87. package/dist/typescript/module/lib/types/analytics.d.ts.map +1 -0
  88. package/dist/typescript/module/lib/types/web.d.ts +36 -0
  89. package/dist/typescript/module/lib/types/web.d.ts.map +1 -0
  90. package/dist/typescript/module/lib/version.d.ts +2 -0
  91. package/dist/typescript/module/lib/version.d.ts.map +1 -0
  92. package/dist/typescript/module/lib/web/RNFBAnalyticsModule.android.d.ts +3 -0
  93. package/dist/typescript/module/lib/web/RNFBAnalyticsModule.android.d.ts.map +1 -0
  94. package/dist/typescript/module/lib/web/RNFBAnalyticsModule.d.ts +9 -0
  95. package/dist/typescript/module/lib/web/RNFBAnalyticsModule.d.ts.map +1 -0
  96. package/dist/typescript/module/lib/web/RNFBAnalyticsModule.ios.d.ts +3 -0
  97. package/dist/typescript/module/lib/web/RNFBAnalyticsModule.ios.d.ts.map +1 -0
  98. package/dist/typescript/module/lib/web/api.d.ts +37 -0
  99. package/dist/typescript/module/lib/web/api.d.ts.map +1 -0
  100. package/dist/typescript/module/package.json +1 -0
  101. package/lib/index.ts +73 -0
  102. package/lib/modular.ts +1026 -0
  103. package/lib/{index.js → namespaced.ts} +145 -72
  104. package/lib/struct.ts +61 -0
  105. package/lib/{structs.js → structs.ts} +3 -3
  106. package/lib/types/analytics.ts +1078 -0
  107. package/lib/types/web.ts +56 -0
  108. package/lib/version.ts +2 -0
  109. package/lib/web/RNFBAnalyticsModule.android.ts +3 -0
  110. package/lib/web/RNFBAnalyticsModule.ios.ts +3 -0
  111. package/lib/web/RNFBAnalyticsModule.ts +135 -0
  112. package/lib/web/api.ts +366 -0
  113. package/package.json +61 -7
  114. package/CHANGELOG.md +0 -1081
  115. package/RNFBAnalytics.podspec +0 -71
  116. package/android/.editorconfig +0 -10
  117. package/android/build.gradle +0 -177
  118. package/android/lint.xml +0 -5
  119. package/android/settings.gradle +0 -1
  120. package/android/src/main/AndroidManifest.xml +0 -21
  121. package/android/src/main/java/io/invertase/firebase/analytics/UniversalFirebaseAnalyticsModule.java +0 -141
  122. package/android/src/reactnative/AndroidManifest.xml +0 -2
  123. package/android/src/reactnative/java/io/invertase/firebase/analytics/ReactNativeFirebaseAnalyticsModule.java +0 -213
  124. package/android/src/reactnative/java/io/invertase/firebase/analytics/ReactNativeFirebaseAnalyticsPackage.java +0 -41
  125. package/ios/RNFBAnalytics/RNFBAnalyticsModule.m +0 -268
  126. package/ios/RNFBAnalytics.xcodeproj/project.pbxproj +0 -349
  127. package/ios/RNFBAnalytics.xcodeproj/xcshareddata/IDETemplateMacros.plist +0 -24
  128. package/lib/index.d.ts +0 -1903
  129. package/lib/modular/index.d.ts +0 -1267
  130. package/lib/version.js +0 -2
  131. package/lib/web/RNFBAnalyticsModule.android.js +0 -2
  132. package/lib/web/RNFBAnalyticsModule.ios.js +0 -2
package/lib/modular.ts ADDED
@@ -0,0 +1,1026 @@
1
+ import { MODULAR_DEPRECATION_ARG } from '@react-native-firebase/app/lib/common';
2
+ import { getApp } from '@react-native-firebase/app';
3
+ import type { Analytics } from './types/analytics';
4
+ import { Platform } from 'react-native';
5
+ import type { ReactNativeFirebase } from '@react-native-firebase/app';
6
+ import type {
7
+ AnalyticsSettings,
8
+ AnalyticsCallOptions,
9
+ ConsentSettings,
10
+ AddPaymentInfoEventParameters,
11
+ ScreenViewParameters,
12
+ AddShippingInfoParameters,
13
+ AddToCartEventParameters,
14
+ AddToWishlistEventParameters,
15
+ BeginCheckoutEventParameters,
16
+ CampaignDetailsEventParameters,
17
+ EarnVirtualCurrencyEventParameters,
18
+ GenerateLeadEventParameters,
19
+ JoinGroupEventParameters,
20
+ LevelEndEventParameters,
21
+ LevelStartEventParameters,
22
+ LevelUpEventParameters,
23
+ LoginEventParameters,
24
+ PostScoreEventParameters,
25
+ SelectContentEventParameters,
26
+ PurchaseEventParameters,
27
+ RefundEventParameters,
28
+ RemoveFromCartEventParameters,
29
+ SearchEventParameters,
30
+ SelectItemEventParameters,
31
+ SetCheckoutOptionEventParameters,
32
+ SelectPromotionEventParameters,
33
+ ShareEventParameters,
34
+ SignUpEventParameters,
35
+ SpendVirtualCurrencyEventParameters,
36
+ UnlockAchievementEventParameters,
37
+ ViewCartEventParameters,
38
+ ViewItemEventParameters,
39
+ ViewItemListEventParameters,
40
+ ViewPromotionEventParameters,
41
+ ViewSearchResultsParameters,
42
+ SettingsOptions,
43
+ EventParams,
44
+ CustomEventName,
45
+ } from './types/analytics';
46
+
47
+ /**
48
+ * Returns an Analytics instance for the given app.
49
+ */
50
+ export function getAnalytics(app?: ReactNativeFirebase.FirebaseApp): Analytics {
51
+ if (app) {
52
+ return getApp(app.name).analytics();
53
+ }
54
+ return getApp().analytics();
55
+ }
56
+
57
+ /**
58
+ * Returns an Analytics instance for the given app.
59
+ */
60
+ export function initializeAnalytics(
61
+ app: ReactNativeFirebase.FirebaseApp,
62
+ _options?: AnalyticsSettings,
63
+ ): Analytics {
64
+ return getApp(app.name).analytics();
65
+ }
66
+
67
+ /**
68
+ * Retrieves a unique Google Analytics identifier for the web client.
69
+ */
70
+ export async function getGoogleAnalyticsClientId(analytics: Analytics): Promise<string> {
71
+ if (Platform.OS === 'android' || Platform.OS === 'ios') {
72
+ throw new Error('getGoogleAnalyticsClientId is web-only.');
73
+ } else {
74
+ const instanceId = await getAppInstanceId(analytics);
75
+ return instanceId || '';
76
+ }
77
+ }
78
+
79
+ /**
80
+ * Log a custom event with optional params.
81
+ */
82
+ // Overloads for standard event names
83
+ export function logEvent(
84
+ analytics: Analytics,
85
+ name: 'add_payment_info',
86
+ params?: {
87
+ items?: EventParams['items'];
88
+ currency?: EventParams['currency'];
89
+ value?: EventParams['value'];
90
+ coupon?: EventParams['coupon'];
91
+ payment_type?: EventParams['payment_type'];
92
+ },
93
+ options?: AnalyticsCallOptions,
94
+ ): Promise<void>;
95
+
96
+ export function logEvent(
97
+ analytics: Analytics,
98
+ name: 'add_shipping_info',
99
+ params?: {
100
+ items?: EventParams['items'];
101
+ currency?: EventParams['currency'];
102
+ value?: EventParams['value'];
103
+ coupon?: EventParams['coupon'];
104
+ shipping_tier?: EventParams['shipping_tier'];
105
+ },
106
+ options?: AnalyticsCallOptions,
107
+ ): Promise<void>;
108
+
109
+ export function logEvent(
110
+ analytics: Analytics,
111
+ name: 'add_to_cart',
112
+ params?: {
113
+ items?: EventParams['items'];
114
+ currency?: EventParams['currency'];
115
+ value?: EventParams['value'];
116
+ },
117
+ options?: AnalyticsCallOptions,
118
+ ): Promise<void>;
119
+
120
+ export function logEvent(
121
+ analytics: Analytics,
122
+ name: 'add_to_wishlist',
123
+ params?: {
124
+ items?: EventParams['items'];
125
+ currency?: EventParams['currency'];
126
+ value?: EventParams['value'];
127
+ },
128
+ options?: AnalyticsCallOptions,
129
+ ): Promise<void>;
130
+
131
+ export function logEvent(
132
+ analytics: Analytics,
133
+ name: 'begin_checkout',
134
+ params?: {
135
+ currency?: EventParams['currency'];
136
+ value?: EventParams['value'];
137
+ coupon?: EventParams['coupon'];
138
+ items?: EventParams['items'];
139
+ [key: string]: any;
140
+ },
141
+ options?: AnalyticsCallOptions,
142
+ ): Promise<void>;
143
+
144
+ export function logEvent(
145
+ analytics: Analytics,
146
+ name: 'checkout_progress',
147
+ params?: {
148
+ checkout_step?: EventParams['checkout_step'];
149
+ checkout_option?: EventParams['checkout_option'];
150
+ [key: string]: any;
151
+ },
152
+ options?: AnalyticsCallOptions,
153
+ ): Promise<void>;
154
+
155
+ export function logEvent(
156
+ analytics: Analytics,
157
+ name: 'exception',
158
+ params?: {
159
+ description?: EventParams['description'];
160
+ fatal?: EventParams['fatal'];
161
+ [key: string]: any;
162
+ },
163
+ options?: AnalyticsCallOptions,
164
+ ): Promise<void>;
165
+
166
+ export function logEvent(
167
+ analytics: Analytics,
168
+ name: 'generate_lead',
169
+ params?: {
170
+ currency?: EventParams['currency'];
171
+ value?: EventParams['value'];
172
+ },
173
+ options?: AnalyticsCallOptions,
174
+ ): Promise<void>;
175
+
176
+ export function logEvent(
177
+ analytics: Analytics,
178
+ name: 'login',
179
+ params: {
180
+ method: EventParams['method'];
181
+ },
182
+ options?: AnalyticsCallOptions,
183
+ ): Promise<void>;
184
+
185
+ export function logEvent(
186
+ analytics: Analytics,
187
+ name: 'page_view',
188
+ params?: {
189
+ page_title?: EventParams['page_title'];
190
+ page_location?: EventParams['page_location'];
191
+ page_path?: EventParams['page_path'];
192
+ [key: string]: any;
193
+ },
194
+ options?: AnalyticsCallOptions,
195
+ ): Promise<void>;
196
+
197
+ export function logEvent(
198
+ analytics: Analytics,
199
+ name: 'purchase',
200
+ params?: {
201
+ affiliation?: EventParams['affiliation'];
202
+ coupon?: EventParams['coupon'];
203
+ currency?: EventParams['currency'];
204
+ items?: EventParams['items'];
205
+ shipping?: EventParams['shipping'];
206
+ tax?: EventParams['tax'];
207
+ value?: EventParams['value'];
208
+ transaction_id?: EventParams['transaction_id'];
209
+ [key: string]: any;
210
+ },
211
+ options?: AnalyticsCallOptions,
212
+ ): Promise<void>;
213
+
214
+ export function logEvent(
215
+ analytics: Analytics,
216
+ name: 'refund',
217
+ params?: {
218
+ affiliation?: EventParams['affiliation'];
219
+ coupon?: EventParams['coupon'];
220
+ currency?: EventParams['currency'];
221
+ items?: EventParams['items'];
222
+ shipping?: EventParams['shipping'];
223
+ tax?: EventParams['tax'];
224
+ value?: EventParams['value'];
225
+ transaction_id?: EventParams['transaction_id'];
226
+ },
227
+ options?: AnalyticsCallOptions,
228
+ ): Promise<void>;
229
+
230
+ export function logEvent(
231
+ analytics: Analytics,
232
+ name: 'remove_from_cart',
233
+ params?: {
234
+ items?: EventParams['items'];
235
+ value?: EventParams['value'];
236
+ currency?: EventParams['currency'];
237
+ },
238
+ options?: AnalyticsCallOptions,
239
+ ): Promise<void>;
240
+
241
+ export function logEvent(
242
+ analytics: Analytics,
243
+ name: 'screen_view',
244
+ params?: {
245
+ screen_name?: EventParams['screen_name'];
246
+ screen_class?: EventParams['screen_class'];
247
+ [key: string]: any;
248
+ },
249
+ options?: AnalyticsCallOptions,
250
+ ): Promise<void>;
251
+
252
+ export function logEvent(
253
+ analytics: Analytics,
254
+ name: 'search',
255
+ params: {
256
+ search_term: EventParams['search_term'];
257
+ number_of_nights?: number;
258
+ number_of_rooms?: number;
259
+ number_of_passengers?: number;
260
+ origin?: string;
261
+ destination?: string;
262
+ start_date?: string;
263
+ end_date?: string;
264
+ travel_class?: string;
265
+ },
266
+ options?: AnalyticsCallOptions,
267
+ ): Promise<void>;
268
+
269
+ export function logEvent(
270
+ analytics: Analytics,
271
+ name: 'select_content',
272
+ params: {
273
+ content_type: EventParams['content_type'];
274
+ item_id: EventParams['item_id'];
275
+ },
276
+ options?: AnalyticsCallOptions,
277
+ ): Promise<void>;
278
+
279
+ export function logEvent(
280
+ analytics: Analytics,
281
+ name: 'select_item',
282
+ params: {
283
+ items?: EventParams['items'];
284
+ content_type: EventParams['content_type'];
285
+ item_list_id: EventParams['item_list_id'];
286
+ item_list_name: EventParams['item_list_name'];
287
+ },
288
+ options?: AnalyticsCallOptions,
289
+ ): Promise<void>;
290
+
291
+ export function logEvent(
292
+ analytics: Analytics,
293
+ name: 'select_promotion',
294
+ params: {
295
+ creative_name: string;
296
+ creative_slot: string;
297
+ items?: EventParams['items'];
298
+ location_id: string;
299
+ promotion_id: EventParams['promotion_id'];
300
+ promotion_name: EventParams['promotion_name'];
301
+ },
302
+ options?: AnalyticsCallOptions,
303
+ ): Promise<void>;
304
+
305
+ export function logEvent(
306
+ analytics: Analytics,
307
+ name: 'set_checkout_option',
308
+ params?: {
309
+ checkout_step?: EventParams['checkout_step'];
310
+ checkout_option?: EventParams['checkout_option'];
311
+ [key: string]: any;
312
+ },
313
+ options?: AnalyticsCallOptions,
314
+ ): Promise<void>;
315
+
316
+ export function logEvent(
317
+ analytics: Analytics,
318
+ name: 'share',
319
+ params: {
320
+ content_type: EventParams['content_type'];
321
+ item_id: EventParams['item_id'];
322
+ method: EventParams['method'];
323
+ },
324
+ options?: AnalyticsCallOptions,
325
+ ): Promise<void>;
326
+
327
+ export function logEvent(
328
+ analytics: Analytics,
329
+ name: 'sign_up',
330
+ params: {
331
+ method: EventParams['method'];
332
+ },
333
+ options?: AnalyticsCallOptions,
334
+ ): Promise<void>;
335
+
336
+ export function logEvent(
337
+ analytics: Analytics,
338
+ name: 'timing_complete',
339
+ params?: {
340
+ [key: string]: any;
341
+ },
342
+ options?: AnalyticsCallOptions,
343
+ ): Promise<void>;
344
+
345
+ export function logEvent(
346
+ analytics: Analytics,
347
+ name: 'view_cart',
348
+ params?: {
349
+ items?: EventParams['items'];
350
+ currency?: EventParams['currency'];
351
+ value?: EventParams['value'];
352
+ },
353
+ options?: AnalyticsCallOptions,
354
+ ): Promise<void>;
355
+
356
+ export function logEvent(
357
+ analytics: Analytics,
358
+ name: 'view_item',
359
+ params?: {
360
+ items?: EventParams['items'];
361
+ currency?: EventParams['currency'];
362
+ value?: EventParams['value'];
363
+ },
364
+ options?: AnalyticsCallOptions,
365
+ ): Promise<void>;
366
+
367
+ export function logEvent(
368
+ analytics: Analytics,
369
+ name: 'view_item_list',
370
+ params?: {
371
+ items?: EventParams['items'];
372
+ item_list_id?: EventParams['item_list_id'];
373
+ item_list_name?: EventParams['item_list_name'];
374
+ },
375
+ options?: AnalyticsCallOptions,
376
+ ): Promise<void>;
377
+
378
+ export function logEvent(
379
+ analytics: Analytics,
380
+ name: 'view_promotion',
381
+ params?: {
382
+ items?: EventParams['items'];
383
+ location_id?: string;
384
+ creative_name?: string;
385
+ creative_slot?: string;
386
+ promotion_id?: EventParams['promotion_id'];
387
+ promotion_name?: EventParams['promotion_name'];
388
+ },
389
+ options?: AnalyticsCallOptions,
390
+ ): Promise<void>;
391
+
392
+ export function logEvent(
393
+ analytics: Analytics,
394
+ name: 'view_search_results',
395
+ params: {
396
+ search_term: EventParams['search_term'];
397
+ },
398
+ options?: AnalyticsCallOptions,
399
+ ): Promise<void>;
400
+
401
+ // Generic fallback for custom event names
402
+ export function logEvent<T extends string>(
403
+ analytics: Analytics,
404
+ name: CustomEventName<T>,
405
+ params?: { [key: string]: any },
406
+ options?: AnalyticsCallOptions,
407
+ ): Promise<void>;
408
+
409
+ export function logEvent(
410
+ analytics: Analytics,
411
+ name: string,
412
+ params: { [key: string]: any } = {},
413
+ options: AnalyticsCallOptions = { global: false },
414
+ ): Promise<void> {
415
+ // @ts-ignore - MODULAR_DEPRECATION_ARG is filtered out internally
416
+ return analytics.logEvent.call(analytics, name, params, options, MODULAR_DEPRECATION_ARG);
417
+ }
418
+
419
+ /**
420
+ * If true, allows the device to collect analytical data and send it to Firebase. Useful for GDPR.
421
+ */
422
+ export function setAnalyticsCollectionEnabled(
423
+ analytics: Analytics,
424
+ enabled: boolean,
425
+ ): Promise<void> {
426
+ // @ts-ignore - MODULAR_DEPRECATION_ARG is filtered out internally
427
+ return analytics.setAnalyticsCollectionEnabled.call(analytics, enabled, MODULAR_DEPRECATION_ARG);
428
+ }
429
+
430
+ /**
431
+ * Sets the duration of inactivity that terminates the current session.
432
+ */
433
+ export function setSessionTimeoutDuration(
434
+ analytics: Analytics,
435
+ milliseconds: number = 1800000,
436
+ ): Promise<void> {
437
+ // This doesn't exist on firebase-js-sdk, but probably should keep this for android & iOS
438
+ // @ts-ignore - MODULAR_DEPRECATION_ARG is filtered out internally
439
+ return analytics.setSessionTimeoutDuration.call(analytics, milliseconds, MODULAR_DEPRECATION_ARG);
440
+ }
441
+
442
+ /**
443
+ * Retrieve the app instance id of the application.
444
+ */
445
+ export function getAppInstanceId(analytics: Analytics): Promise<string | null> {
446
+ // This doesn't exist on firebase-js-sdk, but probably should keep this for android & iOS
447
+ // @ts-ignore - MODULAR_DEPRECATION_ARG is filtered out internally
448
+ return analytics.getAppInstanceId.call(analytics, MODULAR_DEPRECATION_ARG);
449
+ }
450
+
451
+ /**
452
+ * Retrieves the session id from the client.
453
+ * On iOS, Firebase SDK may return an error that is handled internally and may take many minutes to return a valid value. Check native debug logs for more details.
454
+ */
455
+ export function getSessionId(analytics: Analytics): Promise<number | null> {
456
+ // This doesn't exist on firebase-js-sdk, but probably should keep this for android & iOS
457
+ // @ts-ignore - MODULAR_DEPRECATION_ARG is filtered out internally
458
+ return analytics.getSessionId.call(analytics, MODULAR_DEPRECATION_ARG);
459
+ }
460
+
461
+ /**
462
+ * Gives a user a unique identification.
463
+ */
464
+ export function setUserId(analytics: Analytics, id: string | null): Promise<void> {
465
+ // @ts-ignore - MODULAR_DEPRECATION_ARG is filtered out internally
466
+ return analytics.setUserId.call(analytics, id, MODULAR_DEPRECATION_ARG);
467
+ }
468
+
469
+ /**
470
+ * Sets a key/value pair of data on the current user. Each Firebase project can have up to 25 uniquely named (case-sensitive) user properties.
471
+ */
472
+ export function setUserProperty(
473
+ analytics: Analytics,
474
+ name: string,
475
+ value: string | null,
476
+ ): Promise<void> {
477
+ // This doesn't exist on firebase-js-sdk, but probably should keep this for android & iOS
478
+ // @ts-ignore - MODULAR_DEPRECATION_ARG is filtered out internally
479
+ return analytics.setUserProperty.call(analytics, name, value, MODULAR_DEPRECATION_ARG);
480
+ }
481
+
482
+ /**
483
+ * Sets multiple key/value pairs of data on the current user. Each Firebase project can have up to 25 uniquely named (case-sensitive) user properties.
484
+ */
485
+ export function setUserProperties(
486
+ analytics: Analytics,
487
+ properties: { [key: string]: string | null },
488
+ options: AnalyticsCallOptions = { global: false },
489
+ ): Promise<void> {
490
+ // @ts-ignore - MODULAR_DEPRECATION_ARG is filtered out internally
491
+ return analytics.setUserProperties.call(analytics, properties, options, MODULAR_DEPRECATION_ARG);
492
+ }
493
+
494
+ /**
495
+ * Clears all analytics data for this instance from the device and resets the app instance ID.
496
+ */
497
+ export function resetAnalyticsData(analytics: Analytics): Promise<void> {
498
+ // This doesn't exist on firebase-js-sdk, but probably should keep this for android & iOS
499
+ // @ts-ignore - MODULAR_DEPRECATION_ARG is filtered out internally
500
+ return analytics.resetAnalyticsData.call(analytics, MODULAR_DEPRECATION_ARG);
501
+ }
502
+
503
+ /**
504
+ * E-Commerce Purchase event. This event signifies that an item(s) was purchased by a user. Note: This is different from the in-app purchase event, which is reported automatically for Google Play-based apps.
505
+ */
506
+ export function logAddPaymentInfo(
507
+ analytics: Analytics,
508
+ params: AddPaymentInfoEventParameters,
509
+ ): Promise<void> {
510
+ // This is deprecated for both namespaced and modular.
511
+ return analytics.logAddPaymentInfo(params);
512
+ }
513
+
514
+ /**
515
+ * Sets or clears the screen name and class the user is currently viewing.
516
+ */
517
+ export function logScreenView(analytics: Analytics, params: ScreenViewParameters): Promise<void> {
518
+ // This is deprecated for both namespaced and modular.
519
+ return analytics.logScreenView(params);
520
+ }
521
+
522
+ /**
523
+ * Add Payment Info event. This event signifies that a user has submitted their payment information to your app.
524
+ */
525
+ export function logAddShippingInfo(
526
+ analytics: Analytics,
527
+ params: AddShippingInfoParameters,
528
+ ): Promise<void> {
529
+ // This is deprecated for both namespaced and modular.
530
+ return analytics.logAddShippingInfo(params);
531
+ }
532
+
533
+ /**
534
+ * E-Commerce Add To Cart event.
535
+ */
536
+ export function logAddToCart(
537
+ analytics: Analytics,
538
+ params: AddToCartEventParameters,
539
+ ): Promise<void> {
540
+ // This is deprecated for both namespaced and modular.
541
+ return analytics.logAddToCart(params);
542
+ }
543
+
544
+ /**
545
+ * E-Commerce Add To Wishlist event. This event signifies that an item was added to a wishlist.
546
+ */
547
+ export function logAddToWishlist(
548
+ analytics: Analytics,
549
+ params: AddToWishlistEventParameters,
550
+ ): Promise<void> {
551
+ // This is deprecated for both namespaced and modular.
552
+ return analytics.logAddToWishlist(params);
553
+ }
554
+
555
+ /**
556
+ * App Open event. By logging this event when an App is moved to the foreground, developers can understand how often users leave and return during the course of a Session.
557
+ */
558
+ export function logAppOpen(analytics: Analytics): Promise<void> {
559
+ // This is deprecated for both namespaced and modular.
560
+ return analytics.logAppOpen();
561
+ }
562
+
563
+ /**
564
+ * E-Commerce Begin Checkout event. This event signifies that a user has begun the process of checking out.
565
+ */
566
+ export function logBeginCheckout(
567
+ analytics: Analytics,
568
+ params: BeginCheckoutEventParameters,
569
+ ): Promise<void> {
570
+ // This is deprecated for both namespaced and modular.
571
+ return analytics.logBeginCheckout(params);
572
+ }
573
+
574
+ /**
575
+ * Log this event to supply the referral details of a re-engagement campaign.
576
+ */
577
+ export function logCampaignDetails(
578
+ analytics: Analytics,
579
+ params: CampaignDetailsEventParameters,
580
+ ): Promise<void> {
581
+ // This is deprecated for both namespaced and modular.
582
+ return analytics.logCampaignDetails(params);
583
+ }
584
+
585
+ /**
586
+ * Earn Virtual Currency event. This event tracks the awarding of virtual currency in your app.
587
+ */
588
+ export function logEarnVirtualCurrency(
589
+ analytics: Analytics,
590
+ params: EarnVirtualCurrencyEventParameters,
591
+ ): Promise<void> {
592
+ // This is deprecated for both namespaced and modular.
593
+ return analytics.logEarnVirtualCurrency(params);
594
+ }
595
+
596
+ /**
597
+ * Generate Lead event. Log this event when a lead has been generated in the app.
598
+ */
599
+ export function logGenerateLead(
600
+ analytics: Analytics,
601
+ params: GenerateLeadEventParameters,
602
+ ): Promise<void> {
603
+ // This is deprecated for both namespaced and modular.
604
+ return analytics.logGenerateLead(params);
605
+ }
606
+
607
+ /**
608
+ * Join Group event. Log this event when a user joins a group such as a guild, team or family.
609
+ */
610
+ export function logJoinGroup(
611
+ analytics: Analytics,
612
+ params: JoinGroupEventParameters,
613
+ ): Promise<void> {
614
+ // This is deprecated for both namespaced and modular.
615
+ return analytics.logJoinGroup(params);
616
+ }
617
+
618
+ /**
619
+ * Level End event.
620
+ */
621
+ export function logLevelEnd(analytics: Analytics, params: LevelEndEventParameters): Promise<void> {
622
+ // This is deprecated for both namespaced and modular.
623
+ return analytics.logLevelEnd(params);
624
+ }
625
+
626
+ /**
627
+ * Level Start event.
628
+ */
629
+ export function logLevelStart(
630
+ analytics: Analytics,
631
+ params: LevelStartEventParameters,
632
+ ): Promise<void> {
633
+ // This is deprecated for both namespaced and modular.
634
+ return analytics.logLevelStart(params);
635
+ }
636
+
637
+ /**
638
+ * Level Up event. This event signifies that a player has leveled up in your gaming app.
639
+ */
640
+ export function logLevelUp(analytics: Analytics, params: LevelUpEventParameters): Promise<void> {
641
+ // This is deprecated for both namespaced and modular.
642
+ return analytics.logLevelUp(params);
643
+ }
644
+
645
+ /**
646
+ * Login event. Apps with a login feature can report this event to signify that a user has logged in.
647
+ */
648
+ export function logLogin(analytics: Analytics, params: LoginEventParameters): Promise<void> {
649
+ // This is deprecated for both namespaced and modular.
650
+ return analytics.logLogin(params);
651
+ }
652
+
653
+ /**
654
+ * Post Score event. Log this event when the user posts a score in your gaming app.
655
+ */
656
+ export function logPostScore(
657
+ analytics: Analytics,
658
+ params: PostScoreEventParameters,
659
+ ): Promise<void> {
660
+ // This is deprecated for both namespaced and modular.
661
+ return analytics.logPostScore(params);
662
+ }
663
+
664
+ /**
665
+ * Select Content event. This general purpose event signifies that a user has selected some content of a certain type in an app.
666
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
667
+ * @param {SelectContentEventParameters} params - Event parameters.
668
+ * @returns {Promise<void>}
669
+ */
670
+ export function logSelectContent(
671
+ analytics: Analytics,
672
+ params: SelectContentEventParameters,
673
+ ): Promise<void> {
674
+ // This is deprecated for both namespaced and modular.
675
+ return analytics.logSelectContent(params);
676
+ }
677
+
678
+ /**
679
+ * E-Commerce Purchase event. This event signifies that an item(s) was purchased by a user.
680
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
681
+ * @param {PurchaseEventParameters} params - Event parameters.
682
+ * @returns {Promise<void>}
683
+ */
684
+ export function logPurchase(analytics: Analytics, params: PurchaseEventParameters): Promise<void> {
685
+ // This is deprecated for both namespaced and modular.
686
+ return analytics.logPurchase(params);
687
+ }
688
+
689
+ /**
690
+ * E-Commerce Refund event. This event signifies that a refund was issued.
691
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
692
+ * @param {RefundEventParameters} params - Event parameters.
693
+ * @returns {Promise<void>}
694
+ */
695
+ export function logRefund(analytics: Analytics, params: RefundEventParameters): Promise<void> {
696
+ // This is deprecated for both namespaced and modular.
697
+ return analytics.logRefund(params);
698
+ }
699
+
700
+ /**
701
+ * Remove from cart event.
702
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
703
+ * @param {RemoveFromCartEventParameters} params - Event parameters.
704
+ * @returns {Promise<void>}
705
+ */
706
+ export function logRemoveFromCart(
707
+ analytics: Analytics,
708
+ params: RemoveFromCartEventParameters,
709
+ ): Promise<void> {
710
+ // This is deprecated for both namespaced and modular.
711
+ return analytics.logRemoveFromCart(params);
712
+ }
713
+
714
+ /**
715
+ * Search event. Apps that support search features can use this event to contextualize search operations by supplying the appropriate, corresponding parameters.
716
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
717
+ * @param {SearchEventParameters} params - Event parameters.
718
+ * @returns {Promise<void>}
719
+ */
720
+ export function logSearch(analytics: Analytics, params: SearchEventParameters): Promise<void> {
721
+ // This is deprecated for both namespaced and modular.
722
+ return analytics.logSearch(params);
723
+ }
724
+
725
+ /**
726
+ * Select Item event. This event signifies that an item was selected by a user from a list.
727
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
728
+ * @param {SelectItemEventParameters} params - Event parameters.
729
+ * @returns {Promise<void>}
730
+ */
731
+ export function logSelectItem(
732
+ analytics: Analytics,
733
+ params: SelectItemEventParameters,
734
+ ): Promise<void> {
735
+ // This is deprecated for both namespaced and modular.
736
+ return analytics.logSelectItem(params);
737
+ }
738
+
739
+ /**
740
+ * Set checkout option event.
741
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
742
+ * @param {SetCheckoutOptionEventParameters} params - Event parameters.
743
+ * @returns {Promise<void>}
744
+ */
745
+ export function logSetCheckoutOption(
746
+ analytics: Analytics,
747
+ params: SetCheckoutOptionEventParameters,
748
+ ): Promise<void> {
749
+ // This is deprecated for both namespaced and modular.
750
+ return analytics.logSetCheckoutOption(params);
751
+ }
752
+
753
+ /**
754
+ * Select promotion event. This event signifies that a user has selected a promotion offer.
755
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
756
+ * @param {SelectPromotionEventParameters} params - Event parameters.
757
+ * @returns {Promise<void>}
758
+ */
759
+ export function logSelectPromotion(
760
+ analytics: Analytics,
761
+ params: SelectPromotionEventParameters,
762
+ ): Promise<void> {
763
+ // This is deprecated for both namespaced and modular.
764
+ return analytics.logSelectPromotion(params);
765
+ }
766
+
767
+ /**
768
+ * Share event. Apps with social features can log the Share event to identify the most viral content.
769
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
770
+ * @param {ShareEventParameters} params - Event parameters.
771
+ * @returns {Promise<void>}
772
+ */
773
+ export function logShare(analytics: Analytics, params: ShareEventParameters): Promise<void> {
774
+ // This is deprecated for both namespaced and modular.
775
+ return analytics.logShare(params);
776
+ }
777
+
778
+ /**
779
+ * Sign Up event. This event indicates that a user has signed up for an account in your app.
780
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
781
+ * @param {SignUpEventParameters} params - Event parameters.
782
+ * @returns {Promise<void>}
783
+ */
784
+ export function logSignUp(analytics: Analytics, params: SignUpEventParameters): Promise<void> {
785
+ // This is deprecated for both namespaced and modular.
786
+ return analytics.logSignUp(params);
787
+ }
788
+
789
+ /**
790
+ * Spend Virtual Currency event. This event tracks the sale of virtual goods in your app.
791
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
792
+ * @param {SpendVirtualCurrencyEventParameters} params - Event parameters.
793
+ * @returns {Promise<void>}
794
+ */
795
+ export function logSpendVirtualCurrency(
796
+ analytics: Analytics,
797
+ params: SpendVirtualCurrencyEventParameters,
798
+ ): Promise<void> {
799
+ // This is deprecated for both namespaced and modular.
800
+ return analytics.logSpendVirtualCurrency(params);
801
+ }
802
+
803
+ /**
804
+ * Tutorial Begin event. This event signifies the start of the on-boarding process in your app.
805
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
806
+ * @returns {Promise<void>}
807
+ */
808
+ export function logTutorialBegin(analytics: Analytics): Promise<void> {
809
+ // This is deprecated for both namespaced and modular.
810
+ return analytics.logTutorialBegin();
811
+ }
812
+
813
+ /**
814
+ * Tutorial End event. Use this event to signify the user's completion of your app's on-boarding process.
815
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
816
+ * @returns {Promise<void>}
817
+ */
818
+ export function logTutorialComplete(analytics: Analytics): Promise<void> {
819
+ // This is deprecated for both namespaced and modular.
820
+ return analytics.logTutorialComplete();
821
+ }
822
+
823
+ /**
824
+ * Unlock Achievement event. Log this event when the user has unlocked an achievement in your game.
825
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
826
+ * @param {UnlockAchievementEventParameters} params - Event parameters.
827
+ * @returns {Promise<void>}
828
+ */
829
+ export function logUnlockAchievement(
830
+ analytics: Analytics,
831
+ params: UnlockAchievementEventParameters,
832
+ ): Promise<void> {
833
+ // This is deprecated for both namespaced and modular.
834
+ return analytics.logUnlockAchievement(params);
835
+ }
836
+
837
+ /**
838
+ * E-commerce View Cart event. This event signifies that a user has viewed their cart.
839
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
840
+ * @param {ViewCartEventParameters} params - Event parameters.
841
+ * @returns {Promise<void>}
842
+ */
843
+ export function logViewCart(analytics: Analytics, params: ViewCartEventParameters): Promise<void> {
844
+ // This is deprecated for both namespaced and modular.
845
+ return analytics.logViewCart(params);
846
+ }
847
+
848
+ /**
849
+ * View Item event. This event signifies that some content was shown to the user.
850
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
851
+ * @param {ViewItemEventParameters} params - Event parameters.
852
+ * @returns {Promise<void>}
853
+ */
854
+ export function logViewItem(analytics: Analytics, params: ViewItemEventParameters): Promise<void> {
855
+ // This is deprecated for both namespaced and modular.
856
+ return analytics.logViewItem(params);
857
+ }
858
+
859
+ /**
860
+ * View Item List event. Log this event when the user has been presented with a list of items of a certain category.
861
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
862
+ * @param {ViewItemListEventParameters} params - Event parameters.
863
+ * @returns {Promise<void>}
864
+ */
865
+ export function logViewItemList(
866
+ analytics: Analytics,
867
+ params: ViewItemListEventParameters,
868
+ ): Promise<void> {
869
+ // This is deprecated for both namespaced and modular.
870
+ return analytics.logViewItemList(params);
871
+ }
872
+
873
+ /**
874
+ * View Promotion event. This event signifies that a promotion was shown to a user.
875
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
876
+ * @param {ViewPromotionEventParameters} params - Event parameters.
877
+ * @returns {Promise<void>}
878
+ */
879
+ export function logViewPromotion(
880
+ analytics: Analytics,
881
+ params: ViewPromotionEventParameters,
882
+ ): Promise<void> {
883
+ // This is deprecated for both namespaced and modular.
884
+ return analytics.logViewPromotion(params);
885
+ }
886
+
887
+ /**
888
+ * View Search Results event. Log this event when the user has been presented with the results of a search.
889
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
890
+ * @param {ViewSearchResultsParameters} params - Event parameters.
891
+ * @returns {Promise<void>}
892
+ */
893
+ export function logViewSearchResults(
894
+ analytics: Analytics,
895
+ params: ViewSearchResultsParameters,
896
+ ): Promise<void> {
897
+ // This is deprecated for both namespaced and modular.
898
+ return analytics.logViewSearchResults(params);
899
+ }
900
+
901
+ /**
902
+ * Adds parameters that will be set on every event logged from the SDK, including automatic ones.
903
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
904
+ * @param {object} [params={}] - Parameters to be added to the map of parameters added to every event.
905
+ * @returns {Promise<void>}
906
+ */
907
+ export function setDefaultEventParameters(
908
+ analytics: Analytics,
909
+ params: { [key: string]: any } = {},
910
+ ): Promise<void> {
911
+ // @ts-ignore - MODULAR_DEPRECATION_ARG is filtered out internally
912
+ return analytics.setDefaultEventParameters.call(analytics, params, MODULAR_DEPRECATION_ARG);
913
+ }
914
+
915
+ /**
916
+ * start privacy-sensitive on-device conversion management.
917
+ * This is iOS-only.
918
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
919
+ * @param {string} emailAddress - Email address, properly formatted complete with domain name e.g, 'user@example.com'.
920
+ * @returns {Promise<void>}
921
+ */
922
+ export function initiateOnDeviceConversionMeasurementWithEmailAddress(
923
+ analytics: Analytics,
924
+ emailAddress: string,
925
+ ): Promise<void> {
926
+ return analytics.initiateOnDeviceConversionMeasurementWithEmailAddress.call(
927
+ analytics,
928
+ emailAddress,
929
+ // @ts-ignore - MODULAR_DEPRECATION_ARG is filtered out internally
930
+ MODULAR_DEPRECATION_ARG,
931
+ );
932
+ }
933
+
934
+ /**
935
+ * start privacy-sensitive on-device conversion management.
936
+ * This is iOS-only.
937
+ * This is a no-op if you do not include '$RNFirebaseAnalyticsGoogleAppMeasurementOnDeviceConversion = true' in your Podfile
938
+ *
939
+ * @param analytics Analytics instance.
940
+ * @param hashedEmailAddress sha256-hashed of normalized email address, properly formatted complete with domain name e.g, 'user@example.com'
941
+ * @link https://firebase.google.com/docs/tutorials/ads-ios-on-device-measurement/step-3#use-hashed-credentials
942
+ */
943
+ export function initiateOnDeviceConversionMeasurementWithHashedEmailAddress(
944
+ analytics: Analytics,
945
+ hashedEmailAddress: string,
946
+ ): Promise<void> {
947
+ return analytics.initiateOnDeviceConversionMeasurementWithHashedEmailAddress.call(
948
+ analytics,
949
+ hashedEmailAddress,
950
+ // @ts-ignore - MODULAR_DEPRECATION_ARG is filtered out internally
951
+ MODULAR_DEPRECATION_ARG,
952
+ );
953
+ }
954
+
955
+ /**
956
+ * start privacy-sensitive on-device conversion management.
957
+ * This is iOS-only.
958
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
959
+ * @param {string} phoneNumber - Phone number in E.164 format - that is a leading + sign, then up to 15 digits, no dashes or spaces.
960
+ * @returns {Promise<void>}
961
+ */
962
+ export function initiateOnDeviceConversionMeasurementWithPhoneNumber(
963
+ analytics: Analytics,
964
+ phoneNumber: string,
965
+ ): Promise<void> {
966
+ return analytics.initiateOnDeviceConversionMeasurementWithPhoneNumber.call(
967
+ analytics,
968
+ phoneNumber,
969
+ // @ts-ignore - MODULAR_DEPRECATION_ARG is filtered out internally
970
+ MODULAR_DEPRECATION_ARG,
971
+ );
972
+ }
973
+
974
+ /**
975
+ * start privacy-sensitive on-device conversion management.
976
+ * This is iOS-only.
977
+ * This is a no-op if you do not include '$RNFirebaseAnalyticsGoogleAppMeasurementOnDeviceConversion = true' in your Podfile
978
+ *
979
+ * @param analytics Analytics instance.
980
+ * @param hashedPhoneNumber sha256-hashed of normalized phone number in E.164 format - that is a leading + sign, then up to 15 digits, no dashes or spaces.
981
+ * @link https://firebase.google.com/docs/tutorials/ads-ios-on-device-measurement/step-3#use-hashed-credentials
982
+ */
983
+ export function initiateOnDeviceConversionMeasurementWithHashedPhoneNumber(
984
+ analytics: Analytics,
985
+ hashedPhoneNumber: string,
986
+ ): Promise<void> {
987
+ return analytics.initiateOnDeviceConversionMeasurementWithHashedPhoneNumber.call(
988
+ analytics,
989
+ hashedPhoneNumber,
990
+ // @ts-ignore - MODULAR_DEPRECATION_ARG is filtered out internally
991
+ MODULAR_DEPRECATION_ARG,
992
+ );
993
+ }
994
+
995
+ /**
996
+ * Checks four different things.
997
+ * 1. Checks if it's not a browser extension environment.
998
+ * 2. Checks if cookies are enabled in current browser.
999
+ * 3. Checks if IndexedDB is supported by the browser environment.
1000
+ * 4. Checks if the current browser context is valid for using IndexedDB.open().
1001
+ * @returns {Promise<boolean>}
1002
+ */
1003
+ export function isSupported(): Promise<boolean> {
1004
+ return Promise.resolve(true);
1005
+ }
1006
+
1007
+ /**
1008
+ * Sets the applicable end user consent state for this app.
1009
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
1010
+ * @param {ConsentSettings} consentSettings - See ConsentSettings.
1011
+ * @returns {Promise<void>}
1012
+ */
1013
+ export function setConsent(analytics: Analytics, consentSettings: ConsentSettings): Promise<void> {
1014
+ // @ts-ignore - MODULAR_DEPRECATION_ARG is filtered out internally
1015
+ return analytics.setConsent.call(analytics, consentSettings, MODULAR_DEPRECATION_ARG);
1016
+ }
1017
+
1018
+ /**
1019
+ * Configures Firebase Analytics to use custom gtag or dataLayer names.
1020
+ * Intended to be used if gtag.js script has been installed on this page independently of Firebase Analytics, and is using non-default names for either the gtag function or for dataLayer. Must be called before calling `getAnalytics()` or it won't have any effect. Web only.
1021
+ * @param {SettingsOptions} options - See SettingsOptions.
1022
+ * @returns {void}
1023
+ */
1024
+ export function settings(_options: SettingsOptions): void {
1025
+ // Returns nothing until Web implemented.
1026
+ }