@@ -22,19 +22,58 @@ import {
22
22
} from '@react-native-firebase/app-types' ;
23
23
24
24
/**
25
- * Analytics integrates across Firebase features and provides
26
- * you with unlimited reporting for up to 500 distinct events
27
- * that you can define using the Firebase SDK. Analytics reports
28
- * help you understand clearly how your users behave, which enables
29
- * you to make informed decisions regarding app marketing and
30
- * performance optimizations.
25
+ * Firebase Analytics package for React Native.
26
+ *
27
+ * #### Example 1
28
+ *
29
+ * Access the firebase export from the `analytics` package:
30
+ *
31
+ * ```js
32
+ * import { firebase } from '@react-native-firebase/analytics';
33
+ *
34
+ * // firebase.analytics().X
35
+ * ```
36
+ *
37
+ * #### Example 2
38
+ *
39
+ * Using the default export from the `analytics` package:
40
+ *
41
+ * ```js
42
+ * import analytics from '@react-native-firebase/analytics';
43
+ *
44
+ * // analytics().X
45
+ * ```
46
+ *
47
+ * #### Example 3
48
+ *
49
+ * Using the default export from the `app` package:
50
+ *
51
+ * ```js
52
+ * import firebase from '@react-native-firebase/app';
53
+ * import '@react-native-firebase/analytics';
54
+ *
55
+ * // firebase.analytics().X
56
+ * ```
31
57
*
32
58
* @firebase analytics
33
59
*/
34
60
export namespace Analytics {
35
61
export interface Statics { }
36
62
37
- export interface Module extends ReactNativeFirebaseModule {
63
+ /**
64
+ * The Firebase Analytics service interface.
65
+ *
66
+ * > This module is available for the default app only.
67
+ *
68
+ * #### Example
69
+ *
70
+ * Get the Analytics service for the default app:
71
+ *
72
+ * ```js
73
+ * const defaultAppAnalytics = firebase.analytics();
74
+ * ```
75
+ */
76
+ export class Module extends ReactNativeFirebaseModule {
38
77
/**
39
78
* Log a custom event with optional params.
40
79
*
@@ -183,7 +222,6 @@ declare module '@react-native-firebase/analytics' {
183
222
const FirebaseNamespaceExport : { } & ReactNativeFirebaseNamespace ;
184
223
185
224
/**
186
- * @example
187
225
* ```js
188
226
* import { firebase } from '@react-native-firebase/analytics';
189
227
* firebase.analytics().logEvent(...);
@@ -195,13 +233,7 @@ declare module '@react-native-firebase/analytics' {
195
233
Analytics . Module ,
196
234
Analytics . Statics
197
235
> ;
198
- /**
199
- * @example
200
- * ```js
201
- * import analytics from '@react-native-firebase/analytics';
202
- * analytics().logEvent(...);
203
- * ```
204
- */
236
+
205
237
export default AnalyticsDefaultExport ;
206
238
}
207
239
@@ -210,29 +242,13 @@ declare module '@react-native-firebase/analytics' {
210
242
*/
211
243
declare module '@react-native-firebase/app-types' {
212
244
interface ReactNativeFirebaseNamespace {
213
- /**
214
- * Analytics integrates across Firebase features and provides
215
- * you with unlimited reporting for up to 500 distinct events
216
- * that you can define using the Firebase SDK. Analytics reports
217
- * help you understand clearly how your users behave, which enables
218
- * you to make informed decisions regarding app marketing and
219
- * performance optimizations.
220
- */
221
245
analytics : ReactNativeFirebaseModuleAndStatics <
222
246
Analytics . Module ,
223
247
Analytics . Statics
224
248
> ;
225
249
}
226
250
227
251
interface FirebaseApp {
228
- /**
229
- * Analytics integrates across Firebase features and provides
230
- * you with unlimited reporting for up to 500 distinct events
231
- * that you can define using the Firebase SDK. Analytics reports
232
- * help you understand clearly how your users behave, which enables
233
- * you to make informed decisions regarding app marketing and
234
- * performance optimizations.
235
- */
236
252
analytics ( ) : Analytics . Module ;
237
253
}
238
254
}
0 commit comments