@react-native-firebase/analytics 20.3.0 → 20.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,58 +1,86 @@
1
1
  import { firebase } from '..';
2
2
 
3
3
  /**
4
- * @typedef {import("..").FirebaseApp} FirebaseApp
4
+ * @typedef {import('@firebase/app').FirebaseApp} FirebaseApp
5
5
  * @typedef {import("..").FirebaseAnalyticsTypes.Module} FirebaseAnalytics
6
- */
7
-
8
- /**
9
- * Returns a Analytics instance for the given app.
10
- * @param app - FirebaseApp. Optional.
6
+ * @typedef {import("..").FirebaseAnalyticsTypes.AnalyticsCallOptions} AnalyticsCallOptions
7
+ * @typedef {import("..").FirebaseAnalyticsTypes.EventParams} EventParams
8
+ * @typedef {import("..").FirebaseAnalyticsTypes.AddPaymentInfoEventParameters} AddPaymentInfoEventParameters
9
+ * @typedef {import("..").FirebaseAnalyticsTypes.ScreenViewParameters} ScreenViewParameters
10
+ * @typedef {import("..").FirebaseAnalyticsTypes.AddShippingInfoParameters} AddShippingInfoParameters
11
+ * @typedef {import("..").FirebaseAnalyticsTypes.AddToCartEventParameters} AddToCartEventParameters
12
+ * @typedef {import("..").FirebaseAnalyticsTypes.AddToWishlistEventParameters} AddToWishlistEventParameters
13
+ * @typedef {import("..").FirebaseAnalyticsTypes.BeginCheckoutEventParameters} BeginCheckoutEventParameters
14
+ * @typedef {import("..").FirebaseAnalyticsTypes.CampaignDetailsEventParameters} CampaignDetailsEventParameters
15
+ * @typedef {import("..").FirebaseAnalyticsTypes.EarnVirtualCurrencyEventParameters} EarnVirtualCurrencyEventParameters
16
+ * @typedef {import("..").FirebaseAnalyticsTypes.GenerateLeadEventParameters} GenerateLeadEventParameters
17
+ * @typedef {import("..").FirebaseAnalyticsTypes.JoinGroupEventParameters} JoinGroupEventParameters
18
+ * @typedef {import("..").FirebaseAnalyticsTypes.LevelEndEventParameters} LevelEndEventParameters
19
+ * @typedef {import("..").FirebaseAnalyticsTypes.LevelStartEventParameters} LevelStartEventParameters
20
+ * @typedef {import("..").FirebaseAnalyticsTypes.LevelUpEventParameters} LevelUpEventParameters
21
+ * @typedef {import("..").FirebaseAnalyticsTypes.LoginEventParameters} LoginEventParameters
22
+ * @typedef {import("..").FirebaseAnalyticsTypes.PostScoreEventParameters} PostScoreEventParameters
23
+ * @typedef {import("..").FirebaseAnalyticsTypes.SelectContentEventParameters} SelectContentEventParameters
24
+ * @typedef {import("..").FirebaseAnalyticsTypes.PurchaseEventParameters} PurchaseEventParameters
25
+ * @typedef {import("..").FirebaseAnalyticsTypes.RefundEventParameters} RefundEventParameters
26
+ * @typedef {import("..").FirebaseAnalyticsTypes.RemoveFromCartEventParameters} RemoveFromCartEventParameters
27
+ * @typedef {import("..").FirebaseAnalyticsTypes.SearchEventParameters} SearchEventParameters
28
+ * @typedef {import("..").FirebaseAnalyticsTypes.SelectItemEventParameters} SelectItemEventParameters
29
+ * @typedef {import("..").FirebaseAnalyticsTypes.SetCheckoutOptionEventParameters} SetCheckoutOptionEventParameters
30
+ * @typedef {import("..").FirebaseAnalyticsTypes.SelectPromotionEventParameters} SelectPromotionEventParameters
31
+ * @typedef {import("..").FirebaseAnalyticsTypes.ShareEventParameters} ShareEventParameters
32
+ * @typedef {import("..").FirebaseAnalyticsTypes.SignUpEventParameters} SignUpEventParameters
33
+ * @typedef {import("..").FirebaseAnalyticsTypes.SpendVirtualCurrencyEventParameters} SpendVirtualCurrencyEventParameters
34
+ * @typedef {import("..").FirebaseAnalyticsTypes.UnlockAchievementEventParameters} UnlockAchievementEventParameters
35
+ * @typedef {import("..").FirebaseAnalyticsTypes.ViewCartEventParameters} ViewCartEventParameters
36
+ * @typedef {import("..").FirebaseAnalyticsTypes.ViewItemEventParameters} ViewItemEventParameters
37
+ * @typedef {import("..").FirebaseAnalyticsTypes.ViewItemListEventParameters} ViewItemListEventParameters
38
+ * @typedef {import("..").FirebaseAnalyticsTypes.ViewPromotionEventParameters} ViewPromotionEventParameters
39
+ * @typedef {import("..").FirebaseAnalyticsTypes.ViewSearchResultsParameters} ViewSearchResultsParameters
40
+ * @typedef {import("..").FirebaseAnalyticsTypes.ConsentSettings} ConsentSettings
41
+ * @typedef {import("..").FirebaseAnalyticsTypes.SettingsOptions} SettingsOptions
42
+ */
43
+
44
+ /**
45
+ * Returns an Analytics instance for the given app.
46
+ * @param {FirebaseApp} [app] - FirebaseApp. Optional.
11
47
  * @returns {FirebaseAnalytics}
12
48
  */
13
49
  export function getAnalytics(app) {
14
50
  if (app) {
15
51
  return firebase.app(app.name).analytics();
16
52
  }
17
-
18
53
  return firebase.app().analytics();
19
54
  }
20
55
 
21
56
  /**
22
- * Returns a Analytics instance for the given app.
23
- * @param app - FirebaseApp.
24
- * @param options - `AnalyticsSettings`. Web only.
57
+ * Returns an Analytics instance for the given app.
58
+ * @param {FirebaseApp} app - FirebaseApp.
59
+ * @param {object} [options] - AnalyticsSettings. Web only.
25
60
  * @returns {FirebaseAnalytics}
26
61
  */
27
62
  // eslint-disable-next-line
28
63
  export function initializeAnalytics(app, options) {
29
- // options is specifically for web. Implement when it becomes available.
30
64
  return firebase.app(app.name).analytics();
31
65
  }
32
66
 
33
67
  /**
34
- * Log a custom event with optional params. Note that there are various limits that applied
35
- * to event parameters (total parameter count, etc), but analytics applies the limits during
36
- * cloud processing, the errors will not be seen as Promise rejections when you call logEvent.
37
- * While integrating this API in your app you are strongly encouraged to enable
38
- * [DebugView](https://firebase.google.com/docs/analytics/debugview) -
39
- * any errors in your events will show up in the firebase web console with links to relevant documentation
40
- *
41
- * @param analytics Analytics instance.
42
- * @param name Event name must not conflict with any Reserved Events.
43
- * @param params Parameters to be sent and displayed with the event.
44
- * @param options Additional options that can be passed. Web only.
68
+ * Log a custom event with optional params.
69
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
70
+ * @param {string} name - Event name must not conflict with any Reserved Events.
71
+ * @param {object} [params={}] - Parameters to be sent and displayed with the event.
72
+ * @param {AnalyticsCallOptions} [options={}] - Additional options that can be passed. Web only.
73
+ * @returns {Promise<void>}
45
74
  */
46
- export function logEvent(analytics, name, eventParams = {}, options = {}) {
47
- return analytics.logEvent(name, eventParams, options);
75
+ export function logEvent(analytics, name, params = {}, options = {}) {
76
+ return analytics.logEvent(name, params, options);
48
77
  }
49
78
 
50
79
  /**
51
- * If true, allows the device to collect analytical data and send it to
52
- * Firebase. Useful for GDPR.
53
- *
54
- * @param analytics Analytics instance.
55
- * @param enabled A boolean value representing whether Analytics collection is enabled or disabled. Analytics collection is enabled by default.
80
+ * If true, allows the device to collect analytical data and send it to Firebase. Useful for GDPR.
81
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
82
+ * @param {boolean} enabled - A boolean value representing whether Analytics collection is enabled or disabled.
83
+ * @returns {Promise<void>}
56
84
  */
57
85
  export function setAnalyticsCollectionEnabled(analytics, enabled) {
58
86
  return analytics.setAnalyticsCollectionEnabled(enabled);
@@ -60,9 +88,9 @@ export function setAnalyticsCollectionEnabled(analytics, enabled) {
60
88
 
61
89
  /**
62
90
  * Sets the duration of inactivity that terminates the current session.
63
- *
64
- * @param analytics Analytics instance.
65
- * @param milliseconds The default value is 1800000 (30 minutes).
91
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
92
+ * @param {number} [milliseconds=1800000] - The default value is 1800000 (30 minutes).
93
+ * @returns {Promise<void>}
66
94
  */
67
95
  export function setSessionTimeoutDuration(analytics, milliseconds = 1800000) {
68
96
  return analytics.setSessionTimeoutDuration(milliseconds);
@@ -70,9 +98,8 @@ export function setSessionTimeoutDuration(analytics, milliseconds = 1800000) {
70
98
 
71
99
  /**
72
100
  * Retrieve the app instance id of the application.
73
- *
74
- * @param analytics Analytics instance.
75
- * @returns Returns the app instance id or null on android if FirebaseAnalytics.ConsentType.ANALYTICS_STORAGE has been set to FirebaseAnalytics.ConsentStatus.DENIED and null on iOS if ConsentType.analyticsStorage has been set to ConsentStatus.denied.
101
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
102
+ * @returns {Promise<string|null>} Returns the app instance id or null on android if FirebaseAnalytics.ConsentType.ANALYTICS_STORAGE has been set to FirebaseAnalytics.ConsentStatus.DENIED and null on iOS if ConsentType.analyticsStorage has been set to ConsentStatus.denied.
76
103
  */
77
104
  export function getAppInstanceId(analytics) {
78
105
  return analytics.getAppInstanceId();
@@ -81,19 +108,18 @@ export function getAppInstanceId(analytics) {
81
108
  /**
82
109
  * Retrieves the session id from the client.
83
110
  * 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.
84
- *
85
- * @param analytics Analytics instance.
86
- * @returns Returns the session id or null if session is expired, null on android if FirebaseAnalytics.ConsentType.ANALYTICS_STORAGE has been set to FirebaseAnalytics.ConsentStatus.DENIED and null on iOS if ConsentType.analyticsStorage has been set to ConsentStatus.denied.
111
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
112
+ * @returns {Promise<string|null>} Returns the session id or null if session is expired, null on android if FirebaseAnalytics.ConsentType.ANALYTICS_STORAGE has been set to FirebaseAnalytics.ConsentStatus.DENIED and null on iOS if ConsentType.analyticsStorage has been set to ConsentStatus.denied.
87
113
  */
88
114
  export function getSessionId(analytics) {
89
115
  return analytics.getSessionId();
90
116
  }
117
+
91
118
  /**
92
119
  * Gives a user a unique identification.
93
- *
94
- * @param analytics Analytics instance.
95
- * @param id Set to null to remove a previously assigned ID from analytics
96
- * events
120
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
121
+ * @param {string|null} id - Set to null to remove a previously assigned ID from analytics events.
122
+ * @returns {Promise<void>}
97
123
  */
98
124
  export function setUserId(analytics, id) {
99
125
  return analytics.setUserId(id);
@@ -101,10 +127,10 @@ export function setUserId(analytics, id) {
101
127
 
102
128
  /**
103
129
  * 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.
104
- *
105
- * @param analytics Analytics instance.
106
- * @param name A user property identifier.
107
- * @param value Set to null to remove a previously assigned ID from analytics events.
130
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
131
+ * @param {string} name - A user property identifier.
132
+ * @param {string|null} value - Set to null to remove a previously assigned ID from analytics events.
133
+ * @returns {Promise<void>}
108
134
  */
109
135
  export function setUserProperty(analytics, name, value) {
110
136
  return analytics.setUserProperty(name, value);
@@ -112,12 +138,10 @@ export function setUserProperty(analytics, name, value) {
112
138
 
113
139
  /**
114
140
  * 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.
115
- *
116
- * > When you set user properties, be sure to never include personally identifiable information such as names, social security numbers, or email addresses, even in hashed form.
117
- *
118
- * @param analytics Analytics instance.
119
- * @param properties Set a property value to null to remove it.
120
- * @param options `AnalyticsCallOptions`. Additional options that can be passed. Web only.
141
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
142
+ * @param {object} properties - Set a property value to null to remove it.
143
+ * @param {AnalyticsCallOptions} [options={}] - Additional options that can be passed. Web only.
144
+ * @returns {Promise<void>}
121
145
  */
122
146
  export function setUserProperties(analytics, properties, options = {}) {
123
147
  return analytics.setUserProperties(properties, options);
@@ -125,377 +149,286 @@ export function setUserProperties(analytics, properties, options = {}) {
125
149
 
126
150
  /**
127
151
  * Clears all analytics data for this instance from the device and resets the app instance ID.
128
- *
129
- * @param analytics Analytics instance.
152
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
153
+ * @returns {Promise<void>}
130
154
  */
131
155
  export function resetAnalyticsData(analytics) {
132
156
  return analytics.resetAnalyticsData();
133
157
  }
134
158
 
135
159
  /**
136
- * 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
137
- * automatically for Google Play-based apps.
138
- *
139
- * If you supply the `value` parameter, you must also supply the `currency` parameter so that revenue metrics can be computed accurately.
140
- *
141
- * Logged event name: `purchase`
142
- *
143
- * @param analytics Analytics instance.
144
- * @param params See {@link analytics.AddPaymentInfoEventParameters}.
160
+ * 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.
161
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
162
+ * @param {AddPaymentInfoEventParameters} params - Event parameters.
163
+ * @returns {Promise<void>}
145
164
  */
146
- export function logAddPaymentInfo(analytics, object = {}) {
147
- return analytics.logAddPaymentInfo(object);
165
+ export function logAddPaymentInfo(analytics, params) {
166
+ return analytics.logAddPaymentInfo(params);
148
167
  }
149
168
 
150
169
  /**
151
- * Sets or clears the screen name and class the user is currently viewing
152
- *
153
- * @param analytics Analytics instance.
154
- * @param params See {@link analytics.ScreenViewParameters}.
170
+ * Sets or clears the screen name and class the user is currently viewing.
171
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
172
+ * @param {ScreenViewParameters} params - Event parameters.
173
+ * @returns {Promise<void>}
155
174
  */
156
- export function logScreenView(analytics, object = {}) {
157
- return analytics.logScreenView(object);
175
+ export function logScreenView(analytics, params) {
176
+ return analytics.logScreenView(params);
158
177
  }
159
178
 
160
179
  /**
161
180
  * Add Payment Info event. This event signifies that a user has submitted their payment information to your app.
162
- *
163
- * If you supply the `value` parameter, you must also supply the `currency` parameter so that revenue metrics can be computed accurately.
164
- *
165
- * Logged event name: `add_payment_info`
166
- *
167
- * @param analytics Analytics instance.
168
- * @param params See {@link analytics.AddShippingInfoParameters}.
181
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
182
+ * @param {AddShippingInfoParameters} params - Event parameters.
183
+ * @returns {Promise<void>}
169
184
  */
170
- export function logAddShippingInfo(analytics, object = {}) {
171
- return analytics.logAddShippingInfo(object);
185
+ export function logAddShippingInfo(analytics, params) {
186
+ return analytics.logAddShippingInfo(params);
172
187
  }
173
188
 
174
189
  /**
175
190
  * E-Commerce Add To Cart event.
176
- *
177
- * If you supply the `value` parameter, you must also supply the `currency` parameter so that revenue metrics can be computed accurately.
178
- *
179
- * Logged event name: `add_to_cart`
180
- *
181
- * @param analytics Analytics instance.
182
- * @param params See {@link analytics.AddToCartEventParameters}.
191
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
192
+ * @param {AddToCartEventParameters} params - Event parameters.
193
+ * @returns {Promise<void>}
183
194
  */
184
- export function logAddToCart(analytics, object = {}) {
185
- return analytics.logAddToCart(object);
195
+ export function logAddToCart(analytics, params) {
196
+ return analytics.logAddToCart(params);
186
197
  }
187
198
 
188
199
  /**
189
200
  * E-Commerce Add To Wishlist event. This event signifies that an item was added to a wishlist.
190
- * Use this event to identify popular gift items in your app.
191
- *
192
- * If you supply the `value` parameter, you must also supply the `currency` parameter so that revenue metrics can be computed accurately.
193
- *
194
- * Logged event name: `add_to_wishlist
195
- *
196
- * @param analytics Analytics instance.
197
- * @param params See {@link analytics.AddToWishlistEventParameters}.
201
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
202
+ * @param {AddToWishlistEventParameters} params - Event parameters.
203
+ * @returns {Promise<void>}
198
204
  */
199
- export function logAddToWishlist(analytics, object = {}) {
200
- return analytics.logAddToWishlist(object);
205
+ export function logAddToWishlist(analytics, params) {
206
+ return analytics.logAddToWishlist(params);
201
207
  }
202
208
 
203
209
  /**
204
- * App Open event. By logging this event when an App is moved to the foreground, developers can
205
- * understand how often users leave and return during the course of a Session. Although Sessions
206
- * are automatically reported, this event can provide further clarification around the continuous
207
- * engagement of app-users.
208
- *
209
- * @param analytics Analytics instance.
210
+ * 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.
211
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
212
+ * @returns {Promise<void>}
210
213
  */
211
214
  export function logAppOpen(analytics) {
212
215
  return analytics.logAppOpen();
213
216
  }
214
217
 
215
218
  /**
216
- * E-Commerce Begin Checkout event. This event signifies that a user has begun the process of
217
- * checking out.
218
- *
219
- * If you supply the `value` parameter, you must also supply the `currency` parameter so that revenue metrics can be computed accurately.
220
- *
221
- * Logged event name: `begin_checkout`
222
- *
223
- * @param analytics Analytics instance.
224
- * @param params See {@link analytics.BeginCheckoutEventParameters}.
219
+ * E-Commerce Begin Checkout event. This event signifies that a user has begun the process of checking out.
220
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
221
+ * @param {BeginCheckoutEventParameters} params - Event parameters.
222
+ * @returns {Promise<void>}
225
223
  */
226
- export function logBeginCheckout(analytics, object = {}) {
227
- return analytics.logBeginCheckout(object);
224
+ export function logBeginCheckout(analytics, params) {
225
+ return analytics.logBeginCheckout(params);
228
226
  }
229
227
 
230
228
  /**
231
229
  * Log this event to supply the referral details of a re-engagement campaign.
232
- *
233
- * Logged event name: `campaign_details`
234
- *
235
- * @param analytics Analytics instance.
236
- * @param params See {@link analytics.CampaignDetailsEventParameters}.
230
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
231
+ * @param {CampaignDetailsEventParameters} params - Event parameters.
232
+ * @returns {Promise<void>}
237
233
  */
238
- export function logCampaignDetails(analytics, object = {}) {
239
- return analytics.logCampaignDetails(object);
234
+ export function logCampaignDetails(analytics, params) {
235
+ return analytics.logCampaignDetails(params);
240
236
  }
241
237
 
242
238
  /**
243
- * Earn Virtual Currency event. This event tracks the awarding of virtual currency in your app. Log this along with
244
- * {@link analytics.logSpendVirtualCurrency} to better understand your virtual economy.
245
- *
246
- * Logged event name: `earn_virtual_currency`
247
- *
248
- * @param analytics Analytics instance.
249
- * @param params See {@link analytics.EarnVirtualCurrencyEventParameters}.
239
+ * Earn Virtual Currency event. This event tracks the awarding of virtual currency in your app.
240
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
241
+ * @param {EarnVirtualCurrencyEventParameters} params - Event parameters.
242
+ * @returns {Promise<void>}
250
243
  */
251
- export function logEarnVirtualCurrency(analytics, object = {}) {
252
- return analytics.logEarnVirtualCurrency(object);
244
+ export function logEarnVirtualCurrency(analytics, params) {
245
+ return analytics.logEarnVirtualCurrency(params);
253
246
  }
254
247
 
255
248
  /**
256
- * Generate Lead event. Log this event when a lead has been generated in the app to understand
257
- * the efficacy of your install and re-engagement campaigns.
258
- *
259
- * If you supply the `value` parameter, you must also supply the `currency` parameter so that revenue metrics can be computed accurately.
260
- *
261
- * Logged event name: `generate_lead`
262
- *
263
- * @param analytics Analytics instance.
264
- * @param params See {@link analytics.GenerateLeadEventParameters}.
249
+ * Generate Lead event. Log this event when a lead has been generated in the app.
250
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
251
+ * @param {GenerateLeadEventParameters} params - Event parameters.
252
+ * @returns {Promise<void>}
265
253
  */
266
- export function logGenerateLead(analytics, object = {}) {
267
- return analytics.logGenerateLead(object);
254
+ export function logGenerateLead(analytics, params) {
255
+ return analytics.logGenerateLead(params);
268
256
  }
269
257
 
270
258
  /**
271
259
  * Join Group event. Log this event when a user joins a group such as a guild, team or family.
272
- * Use this event to analyze how popular certain groups or social features are in your app
273
- *
274
- * Logged event name: `join_group`
275
- *
276
- * @param analytics Analytics instance.
277
- * @param params See {@link analytics.JoinGroupEventParameters}.
260
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
261
+ * @param {JoinGroupEventParameters} params - Event parameters.
262
+ * @returns {Promise<void>}
278
263
  */
279
- export function logJoinGroup(analytics, object = {}) {
280
- return analytics.logJoinGroup(object);
264
+ export function logJoinGroup(analytics, params) {
265
+ return analytics.logJoinGroup(params);
281
266
  }
282
267
 
283
268
  /**
284
269
  * Level End event.
285
- *
286
- * Logged event name: `level_end`
287
- *
288
- * @param analytics Analytics instance.
289
- * @param params See {@link analytics.LevelEndEventParameters}.
270
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
271
+ * @param {LevelEndEventParameters} params - Event parameters.
272
+ * @returns {Promise<void>}
290
273
  */
291
- export function logLevelEnd(analytics, object = {}) {
292
- return analytics.logLevelEnd(object);
274
+ export function logLevelEnd(analytics, params) {
275
+ return analytics.logLevelEnd(params);
293
276
  }
294
277
 
295
278
  /**
296
279
  * Level Start event.
297
- *
298
- * Logged event name: `level_start`
299
- *
300
- * @param analytics Analytics instance.
301
- * @param params See {@link analytics.LevelStartEventParameters}.
280
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
281
+ * @param {LevelStartEventParameters} params - Event parameters.
282
+ * @returns {Promise<void>}
302
283
  */
303
- export function logLevelStart(analytics, object = {}) {
304
- return analytics.logLevelStart(object);
284
+ export function logLevelStart(analytics, params) {
285
+ return analytics.logLevelStart(params);
305
286
  }
306
287
 
307
288
  /**
308
289
  * Level Up event. This event signifies that a player has leveled up in your gaming app.
309
- * It can help you gauge the level distribution of your userbase and help you identify certain levels that are difficult to pass.
310
- *
311
- * Logged event name: `level_up`
312
- *
313
- * @param analytics Analytics instance.
314
- * @param params See {@link analytics.LevelUpEventParameters}.
290
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
291
+ * @param {LevelUpEventParameters} params - Event parameters.
292
+ * @returns {Promise<void>}
315
293
  */
316
- export function logLevelUp(analytics, object = {}) {
317
- return analytics.logLevelUp(object);
294
+ export function logLevelUp(analytics, params) {
295
+ return analytics.logLevelUp(params);
318
296
  }
319
297
 
320
298
  /**
321
299
  * Login event. Apps with a login feature can report this event to signify that a user has logged in.
322
- *
323
- * Logged event name: `login`
324
- *
325
- * @param analytics Analytics instance.
326
- * @param params See {@link analytics.LoginEventParameters}.
300
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
301
+ * @param {LoginEventParameters} params - Event parameters.
302
+ * @returns {Promise<void>}
327
303
  */
328
- export function logLogin(analytics, object = {}) {
329
- return analytics.logLogin(object);
304
+ export function logLogin(analytics, params) {
305
+ return analytics.logLogin(params);
330
306
  }
331
307
 
332
308
  /**
333
- * Post Score event. Log this event when the user posts a score in your gaming app. This event can
334
- * help you understand how users are actually performing in your game and it can help you correlate
335
- * high scores with certain audiences or behaviors.
336
- *
337
- * Logged event name: `post_score`
338
- *
339
- * @param analytics Analytics instance.
340
- * @param params See {@link analytics.PostScoreEventParameters}.
309
+ * Post Score event. Log this event when the user posts a score in your gaming app.
310
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
311
+ * @param {PostScoreEventParameters} params - Event parameters.
312
+ * @returns {Promise<void>}
341
313
  */
342
- export function logPostScore(analytics, object = {}) {
343
- return analytics.logPostScore(object);
314
+ export function logPostScore(analytics, params) {
315
+ return analytics.logPostScore(params);
344
316
  }
345
317
 
346
318
  /**
347
- * Select Content event. This general purpose event signifies that a user has selected some
348
- * content of a certain type in an app. The content can be any object in your app. This event
349
- * can help you identify popular content and categories of content in your app.
350
- *
351
- * Logged event name: `select_content`
352
- *
353
- * @param analytics Analytics instance.
354
- * @param params See {@link analytics.SelectContentEventParameters}.
319
+ * Select Content event. This general purpose event signifies that a user has selected some content of a certain type in an app.
320
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
321
+ * @param {SelectContentEventParameters} params - Event parameters.
322
+ * @returns {Promise<void>}
355
323
  */
356
- export function logSelectContent(analytics, object = {}) {
357
- return analytics.logSelectContent(object);
324
+ export function logSelectContent(analytics, params) {
325
+ return analytics.logSelectContent(params);
358
326
  }
359
327
 
360
328
  /**
361
- * 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
362
- * automatically for Google Play-based apps.
363
- *
364
- * If you supply the `value` parameter, you must also supply the `currency` parameter so that revenue metrics can be computed accurately.
365
- *
366
- * Logged event name: `purchase`
367
- *
368
- * @param analytics Analytics instance.
369
- * @param params See {@link analytics.PurchaseEventParameters}.
329
+ * E-Commerce Purchase event. This event signifies that an item(s) was purchased by a user.
330
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
331
+ * @param {PurchaseEventParameters} params - Event parameters.
332
+ * @returns {Promise<void>}
370
333
  */
371
- export function logPurchase(analytics, object = {}) {
372
- return analytics.logPurchase(object);
334
+ export function logPurchase(analytics, params) {
335
+ return analytics.logPurchase(params);
373
336
  }
374
337
 
375
338
  /**
376
339
  * E-Commerce Refund event. This event signifies that a refund was issued.
377
- *
378
- * Logged event name: `remove_from_cart`
379
- *
380
- * @param analytics Analytics instance.
381
- * @param params See {@link analytics.RefundEventParameters}.
340
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
341
+ * @param {RefundEventParameters} params - Event parameters.
342
+ * @returns {Promise<void>}
382
343
  */
383
- export function logRefund(analytics, object = {}) {
384
- return analytics.logRefund(object);
344
+ export function logRefund(analytics, params) {
345
+ return analytics.logRefund(params);
385
346
  }
386
347
 
387
348
  /**
388
349
  * Remove from cart event.
389
- *
390
- * Logged event name: `remove_from_cart`
391
- *
392
- * @param analytics Analytics instance.
393
- * @param params See {@link analytics.RemoveFromCartEventParameters}.
350
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
351
+ * @param {RemoveFromCartEventParameters} params - Event parameters.
352
+ * @returns {Promise<void>}
394
353
  */
395
- export function logRemoveFromCart(analytics, object = {}) {
396
- return analytics.logRemoveFromCart(object);
354
+ export function logRemoveFromCart(analytics, params) {
355
+ return analytics.logRemoveFromCart(params);
397
356
  }
398
357
 
399
358
  /**
400
- * Search event. Apps that support search features can use this event to contextualize search
401
- * operations by supplying the appropriate, corresponding parameters. This event can help you
402
- * identify the most popular content in your app.
403
- *
404
- * Logged event name: `search`
405
- *
406
- * @param analytics Analytics instance.
407
- * @param params See {@link analytics.SearchEventParameters}.
359
+ * Search event. Apps that support search features can use this event to contextualize search operations by supplying the appropriate, corresponding parameters.
360
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
361
+ * @param {SearchEventParameters} params - Event parameters.
362
+ * @returns {Promise<void>}
408
363
  */
409
- export function logSearch(analytics, object = {}) {
410
- return analytics.logSearch(object);
364
+ export function logSearch(analytics, params) {
365
+ return analytics.logSearch(params);
411
366
  }
412
367
 
413
368
  /**
414
369
  * Select Item event. This event signifies that an item was selected by a user from a list.
415
- * Use the appropriate parameters to contextualize the event.
416
- * Use this event to discover the most popular items selected.
417
- *
418
- * Logged event name: `select_item`
419
- *
420
- * @param analytics Analytics instance.
421
- * @param params See {@link analytics.SelectItemEventParameters}.
370
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
371
+ * @param {SelectItemEventParameters} params - Event parameters.
372
+ * @returns {Promise<void>}
422
373
  */
423
- export function logSelectItem(analytics, object = {}) {
424
- return analytics.logSelectItem(object);
374
+ export function logSelectItem(analytics, params) {
375
+ return analytics.logSelectItem(params);
425
376
  }
426
377
 
427
378
  /**
428
379
  * Set checkout option event.
429
- *
430
- * Logged event name: `set_checkout_option`
431
- *
432
- * @param analytics Analytics instance.
433
- * @param params See {@link analytics.SetCheckoutOptionEventParameters}.
380
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
381
+ * @param {SetCheckoutOptionEventParameters} params - Event parameters.
382
+ * @returns {Promise<void>}
434
383
  */
435
- export function logSetCheckoutOption(analytics, object = {}) {
436
- return analytics.logSetCheckoutOption(object);
384
+ export function logSetCheckoutOption(analytics, params) {
385
+ return analytics.logSetCheckoutOption(params);
437
386
  }
438
387
 
439
388
  /**
440
- * Select promotion event. This event signifies that a user has selected a promotion offer. Use the
441
- * appropriate parameters to contextualize the event, such as the item(s) for which the promotion applies.
442
- *
443
- * Logged event name: `select_promotion`
444
- *
445
- * @param analytics Analytics instance.
446
- * @param params See {@link analytics.SelectPromotionEventParameters}.
389
+ * Select promotion event. This event signifies that a user has selected a promotion offer.
390
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
391
+ * @param {SelectPromotionEventParameters} params - Event parameters.
392
+ * @returns {Promise<void>}
447
393
  */
448
- export function logSelectPromotion(analytics, object = {}) {
449
- return analytics.logSelectPromotion(object);
394
+ export function logSelectPromotion(analytics, params) {
395
+ return analytics.logSelectPromotion(params);
450
396
  }
451
397
 
452
398
  /**
453
399
  * Share event. Apps with social features can log the Share event to identify the most viral content.
454
- *
455
- * Logged event name: `share`
456
- *
457
- * @param analytics Analytics instance.
458
- * @param params See {@link analytics.ShareEventParameters}.
400
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
401
+ * @param {ShareEventParameters} params - Event parameters.
402
+ * @returns {Promise<void>}
459
403
  */
460
- export function logShare(analytics, object = {}) {
461
- return analytics.logShare(object);
404
+ export function logShare(analytics, params) {
405
+ return analytics.logShare(params);
462
406
  }
463
407
 
464
408
  /**
465
409
  * Sign Up event. This event indicates that a user has signed up for an account in your app.
466
- * The parameter signifies the method by which the user signed up. Use this event to understand
467
- * the different behaviors between logged in and logged out users.
468
- *
469
- * Logged event name: `sign_up`
470
- *
471
- * @param analytics Analytics instance.
472
- * @param params See {@link analytics.SignUpEventParameters}.
410
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
411
+ * @param {SignUpEventParameters} params - Event parameters.
412
+ * @returns {Promise<void>}
473
413
  */
474
- export function logSignUp(analytics, object = {}) {
475
- return analytics.logSignUp(object);
414
+ export function logSignUp(analytics, params) {
415
+ return analytics.logSignUp(params);
476
416
  }
477
417
 
478
418
  /**
479
- * Spend Virtual Currency event. This event tracks the sale of virtual goods in your app and can
480
- * help you identify which virtual goods are the most popular objects of purchase.
481
- *
482
- * Logged event name: `spend_virtual_currency`
483
- *
484
- * @param analytics Analytics instance.
485
- * @param params See {@link analytics.SpendVirtualCurrencyEventParameters}.
419
+ * Spend Virtual Currency event. This event tracks the sale of virtual goods in your app.
420
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
421
+ * @param {SpendVirtualCurrencyEventParameters} params - Event parameters.
422
+ * @returns {Promise<void>}
486
423
  */
487
- export function logSpendVirtualCurrency(analytics, object = {}) {
488
- return analytics.logSpendVirtualCurrency(object);
424
+ export function logSpendVirtualCurrency(analytics, params) {
425
+ return analytics.logSpendVirtualCurrency(params);
489
426
  }
490
427
 
491
428
  /**
492
429
  * Tutorial Begin event. This event signifies the start of the on-boarding process in your app.
493
- * Use this in a funnel with {@link analytics#logTutorialComplete} to understand how many users
494
- * complete this process and move on to the full app experience.
495
- *
496
- * Logged event name: `tutorial_begin`
497
- *
498
- * @param analytics Analytics instance.
430
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
431
+ * @returns {Promise<void>}
499
432
  */
500
433
  export function logTutorialBegin(analytics) {
501
434
  return analytics.logTutorialBegin();
@@ -503,12 +436,8 @@ export function logTutorialBegin(analytics) {
503
436
 
504
437
  /**
505
438
  * Tutorial End event. Use this event to signify the user's completion of your app's on-boarding process.
506
- * Add this to a funnel with {@link analytics#logTutorialBegin} to understand how many users
507
- * complete this process and move on to the full app experience.
508
- *
509
- * Logged event name: `tutorial_complete`
510
- *
511
- * @param analytics Analytics instance.
439
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
440
+ * @returns {Promise<void>}
512
441
  */
513
442
  export function logTutorialComplete(analytics) {
514
443
  return analytics.logTutorialComplete();
@@ -516,95 +445,69 @@ export function logTutorialComplete(analytics) {
516
445
 
517
446
  /**
518
447
  * Unlock Achievement event. Log this event when the user has unlocked an achievement in your game.
519
- * Since achievements generally represent the breadth of a gaming experience, this event can help
520
- * you understand how many users are experiencing all that your game has to offer.
521
- *
522
- * Logged event name: `unlock_achievement`
523
- *
524
- * @param analytics Analytics instance.
525
- * @param params See {@link analytics.UnlockAchievementEventParameters}.
448
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
449
+ * @param {UnlockAchievementEventParameters} params - Event parameters.
450
+ * @returns {Promise<void>}
526
451
  */
527
- export function logUnlockAchievement(analytics, object = {}) {
528
- return analytics.logUnlockAchievement(object);
452
+ export function logUnlockAchievement(analytics, params) {
453
+ return analytics.logUnlockAchievement(params);
529
454
  }
530
455
 
531
456
  /**
532
- * E-commerce View Cart event. This event signifies that a user has viewed their cart. Use this to analyze your purchase funnel.
533
- *
534
- * If you supply the `value` parameter, you must also supply the `currency` parameter so that revenue metrics can be computed accurately.
535
- *
536
- * Logged event name: `view_cart`
537
- *
538
- * @param analytics Analytics instance.
539
- * @param params See {@link analytics.ViewCartEventParameters}.
457
+ * E-commerce View Cart event. This event signifies that a user has viewed their cart.
458
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
459
+ * @param {ViewCartEventParameters} params - Event parameters.
460
+ * @returns {Promise<void>}
540
461
  */
541
- export function logViewCart(analytics, object = {}) {
542
- return analytics.logViewCart(object);
462
+ export function logViewCart(analytics, params) {
463
+ return analytics.logViewCart(params);
543
464
  }
544
465
 
545
466
  /**
546
- * View Item event. This event signifies that some content was shown to the user. This content
547
- * may be a product, a screen or just a simple image or text. Use the appropriate parameters
548
- * to contextualize the event. Use this event to discover the most popular items viewed in your app.
549
- *
550
- * If you supply the `value` parameter, you must also supply the `currency` parameter so that revenue metrics can be computed accurately.
551
- *
552
- * Logged event name: `view_item`
553
- *
554
- * @param analytics Analytics instance.
555
- * @param params See {@link analytics.ViewItemEventParameters}.
467
+ * View Item event. This event signifies that some content was shown to the user.
468
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
469
+ * @param {ViewItemEventParameters} params - Event parameters.
470
+ * @returns {Promise<void>}
556
471
  */
557
- export function logViewItem(analytics, object = {}) {
558
- return analytics.logViewItem(object);
472
+ export function logViewItem(analytics, params) {
473
+ return analytics.logViewItem(params);
559
474
  }
560
475
 
561
476
  /**
562
477
  * View Item List event. Log this event when the user has been presented with a list of items of a certain category.
563
- *
564
- * Logged event name: `view_item_list`
565
- *
566
- * @param analytics Analytics instance.
567
- * @param params See {@link analytics.ViewItemListEventParameters}.
478
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
479
+ * @param {ViewItemListEventParameters} params - Event parameters.
480
+ * @returns {Promise<void>}
568
481
  */
569
- export function logViewItemList(analytics, object = {}) {
570
- return analytics.logViewItemList(object);
482
+ export function logViewItemList(analytics, params) {
483
+ return analytics.logViewItemList(params);
571
484
  }
572
485
 
573
486
  /**
574
487
  * View Promotion event. This event signifies that a promotion was shown to a user.
575
- *
576
- * Logged event name: `view_promotion`
577
- *
578
- * @param analytics Analytics instance.
579
- * @param params See {@link analytics.ViewPromotionEventParameters}.
488
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
489
+ * @param {ViewPromotionEventParameters} params - Event parameters.
490
+ * @returns {Promise<void>}
580
491
  */
581
- export function logViewPromotion(analytics, object = {}) {
582
- return analytics.logViewPromotion(object);
492
+ export function logViewPromotion(analytics, params) {
493
+ return analytics.logViewPromotion(params);
583
494
  }
584
495
 
585
496
  /**
586
497
  * View Search Results event. Log this event when the user has been presented with the results of a search.
587
- *
588
- * Logged event name: `view_search_results`
589
- *
590
- * @param analytics Analytics instance.
591
- * @param params See {@link analytics.ViewSearchResultsParameters}.
498
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
499
+ * @param {ViewSearchResultsParameters} params - Event parameters.
500
+ * @returns {Promise<void>}
592
501
  */
593
- export function logViewSearchResults(analytics, object = {}) {
594
- return analytics.logViewSearchResults(object);
502
+ export function logViewSearchResults(analytics, params) {
503
+ return analytics.logViewSearchResults(params);
595
504
  }
596
505
 
597
506
  /**
598
507
  * Adds parameters that will be set on every event logged from the SDK, including automatic ones.
599
- *
600
- * @param analytics Analytics instance.
601
- * @param params Parameters to be added to the map of parameters added to every event.
602
- * They will be added to the map of default event parameters, replacing any existing
603
- * parameter with the same name. Valid parameter values are String, long, and double.
604
- * Setting a key's value to null will clear that parameter. Passing in a null bundle
605
- * will clear all parameters.
606
- * For Web, the values passed persist on the current page and are passed with all
607
- * subsequent events.
508
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
509
+ * @param {object} [params={}] - Parameters to be added to the map of parameters added to every event.
510
+ * @returns {Promise<void>}
608
511
  */
609
512
  export function setDefaultEventParameters(analytics, params = {}) {
610
513
  return analytics.setDefaultEventParameters(params);
@@ -613,10 +516,9 @@ export function setDefaultEventParameters(analytics, params = {}) {
613
516
  /**
614
517
  * start privacy-sensitive on-device conversion management.
615
518
  * This is iOS-only.
616
- * This is a no-op if you do not include '$RNFirebaseAnalyticsGoogleAppMeasurementOnDeviceConversion = true' in your Podfile
617
- *
618
- * @param analytics Analytics instance.
619
- * @param emailAddress email address, properly formatted complete with domain name e.g, 'user@example.com'
519
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
520
+ * @param {string} emailAddress - Email address, properly formatted complete with domain name e.g, 'user@example.com'.
521
+ * @returns {Promise<void>}
620
522
  */
621
523
  export function initiateOnDeviceConversionMeasurementWithEmailAddress(analytics, emailAddress) {
622
524
  return analytics.initiateOnDeviceConversionMeasurementWithEmailAddress(emailAddress);
@@ -625,10 +527,9 @@ export function initiateOnDeviceConversionMeasurementWithEmailAddress(analytics,
625
527
  /**
626
528
  * start privacy-sensitive on-device conversion management.
627
529
  * This is iOS-only.
628
- * This is a no-op if you do not include '$RNFirebaseAnalyticsGoogleAppMeasurementOnDeviceConversion = true' in your Podfile
629
- *
630
- * @param analytics Analytics instance.
631
- * @param phoneNumber phone number in E.164 format - that is a leading + sign, then up to 15 digits, no dashes or spaces.
530
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
531
+ * @param {string} phoneNumber - Phone number in E.164 format - that is a leading + sign, then up to 15 digits, no dashes or spaces.
532
+ * @returns {Promise<void>}
632
533
  */
633
534
  export function initiateOnDeviceConversionMeasurementWithPhoneNumber(analytics, phoneNumber) {
634
535
  return analytics.initiateOnDeviceConversionMeasurementWithPhoneNumber(phoneNumber);
@@ -643,29 +544,23 @@ export function initiateOnDeviceConversionMeasurementWithPhoneNumber(analytics,
643
544
  * @returns {Promise<boolean>}
644
545
  */
645
546
  export function isSupported() {
646
- // always return "true" for now until Web implementation. Web only.
647
547
  return Promise.resolve(true);
648
548
  }
649
549
 
650
550
  /**
651
551
  * Sets the applicable end user consent state for this app.
652
- * references once Firebase Analytics is initialized.
653
- * @param analytics Analytics instance.
654
- * @param consentSettings See {@link analytics.ConsentSettings}.
552
+ * @param {FirebaseAnalytics} analytics - Analytics instance.
553
+ * @param {ConsentSettings} consentSettings - See ConsentSettings.
655
554
  * @returns {Promise<void>}
656
555
  */
657
- // eslint-disable-next-line
658
556
  export function setConsent(analytics, consentSettings) {
659
557
  return analytics.setConsent(consentSettings);
660
558
  }
661
559
 
662
560
  /**
663
561
  * Configures Firebase Analytics to use custom gtag or dataLayer names.
664
- * Intended to be used if gtag.js script has been installed on this page
665
- * independently of Firebase Analytics, and is using non-default names for
666
- * either the gtag function or for dataLayer. Must be called before calling
667
- * `getAnalytics()` or it won't have any effect. Web only.
668
- * @param options See {@link analytics.SettingsOptions}.
562
+ * 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.
563
+ * @param {SettingsOptions} options - See SettingsOptions.
669
564
  * @returns {void}
670
565
  */
671
566
  // eslint-disable-next-line