mirror of
https://github.com/zhigang1992/react-native-firebase.git
synced 2026-05-31 18:10:46 +08:00
[skip ci] docs
This commit is contained in:
64
packages/analytics/lib/index.d.ts
vendored
64
packages/analytics/lib/index.d.ts
vendored
@@ -40,6 +40,14 @@ export namespace Analytics {
|
||||
*
|
||||
* @note 100 characters is the maximum length for param key names.
|
||||
*
|
||||
* #### Example
|
||||
*
|
||||
* ```js
|
||||
* await analytics().logEvent('product_view', {
|
||||
* id: '1234',
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* @param name Event name must not conflict with any Reserved Events.
|
||||
* @param params Parameters to be sent and displayed with the event.
|
||||
*/
|
||||
@@ -51,6 +59,13 @@ export namespace Analytics {
|
||||
*
|
||||
* @note Analytics collection is enabled by default.
|
||||
*
|
||||
* #### Example
|
||||
*
|
||||
* ```js
|
||||
* // Disable collection
|
||||
* await analytics().setAnalyticsCollectionEnabled(false);
|
||||
* ```
|
||||
*
|
||||
* @param enabled A boolean value representing whether Analytics collection is enabled or disabled.
|
||||
*/
|
||||
setAnalyticsCollectionEnabled(enabled: boolean): Promise<void>;
|
||||
@@ -62,6 +77,12 @@ export namespace Analytics {
|
||||
* always sent as your current class name. For example on Android it will always
|
||||
* show as 'MainActivity' if you do not specify it.
|
||||
*
|
||||
* #### Example
|
||||
*
|
||||
* ```js
|
||||
* await analytics().setCurrentScreen('ProductScreen', 'ProductScreen');
|
||||
* ```
|
||||
*
|
||||
* @param screenName A screen name, e.g. Product.
|
||||
* @param screenClassOverride On Android, React Native runs in a single activity called
|
||||
* 'MainActivity'. Setting this parameter overrides the default name shown on logs.
|
||||
@@ -71,6 +92,13 @@ export namespace Analytics {
|
||||
/**
|
||||
* Sets the minimum engagement time required before starting a session.
|
||||
*
|
||||
* #### Example
|
||||
*
|
||||
* ```js
|
||||
* // 20 seconds
|
||||
* await analytics().setMinimumSessionDuration(20000);
|
||||
* ```
|
||||
*
|
||||
* @param milliseconds The default value is 10000 (10 seconds).
|
||||
*/
|
||||
setMinimumSessionDuration(milliseconds: number): Promise<void>;
|
||||
@@ -78,6 +106,13 @@ export namespace Analytics {
|
||||
/**
|
||||
* Sets the duration of inactivity that terminates the current session.
|
||||
*
|
||||
* #### Example
|
||||
*
|
||||
* ```js
|
||||
* // 20 minutes
|
||||
* await analytics().setMinimumSessionDuration(900000);
|
||||
* ```
|
||||
*
|
||||
* @param milliseconds The default value is 1800000 (30 minutes).
|
||||
*/
|
||||
setSessionTimeoutDuration(milliseconds: number): Promise<void>;
|
||||
@@ -85,6 +120,14 @@ export namespace Analytics {
|
||||
/**
|
||||
* Gives a user a unique identification.
|
||||
*
|
||||
* #### Example
|
||||
*
|
||||
* ```js
|
||||
* // Set User
|
||||
* await analytics().setUserId('123456789');
|
||||
* // Remove User
|
||||
* await analytics().setUserId(null);
|
||||
* ```
|
||||
*
|
||||
* @param id Set to null to remove a previously assigned id from analytics events
|
||||
*/
|
||||
@@ -93,6 +136,12 @@ export namespace Analytics {
|
||||
/**
|
||||
* Sets a key/value pair of data on the current user.
|
||||
*
|
||||
* #### Example
|
||||
*
|
||||
* ```js
|
||||
* await analytics().setUserProperty('account_type', 'gold');
|
||||
* ```
|
||||
*
|
||||
* @param name A user property identifier.
|
||||
* @param value Set to null to remove a previously assigned id from analytics events.
|
||||
*/
|
||||
@@ -101,6 +150,15 @@ export namespace Analytics {
|
||||
/**
|
||||
* Sets multiple key/value pair of data on the current user.
|
||||
*
|
||||
* #### Example
|
||||
*
|
||||
* ```js
|
||||
* await analytics().setUserProperties({
|
||||
* account_type: 'gold',
|
||||
* account_name: 'Gold Badge',
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* @react-native-firebase
|
||||
* @param properties Set a property value to null to remove it.
|
||||
*/
|
||||
@@ -108,6 +166,12 @@ export namespace Analytics {
|
||||
|
||||
/**
|
||||
* Clears all analytics data for this instance from the device and resets the app instance ID.
|
||||
*
|
||||
* #### Example
|
||||
*
|
||||
* ```js
|
||||
* await analytics().resetAnalyticsData();
|
||||
* ```
|
||||
*/
|
||||
resetAnalyticsData(): Promise<void>;
|
||||
}
|
||||
|
||||
@@ -26,6 +26,14 @@ export interface Module extends ReactNativeFirebaseModule {
|
||||
*
|
||||
* @note 100 characters is the maximum length for param key names.
|
||||
*
|
||||
* #### Example
|
||||
*
|
||||
* ```js
|
||||
* await analytics().logEvent('product_view', {
|
||||
* id: '1234',
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* @param name Event name must not conflict with any Reserved Events.
|
||||
* @param params Parameters to be sent and displayed with the event.
|
||||
*/
|
||||
@@ -37,6 +45,13 @@ export interface Module extends ReactNativeFirebaseModule {
|
||||
*
|
||||
* @note Analytics collection is enabled by default.
|
||||
*
|
||||
* #### Example
|
||||
*
|
||||
* ```js
|
||||
* // Disable collection
|
||||
* await analytics().setAnalyticsCollectionEnabled(false);
|
||||
* ```
|
||||
*
|
||||
* @param enabled A boolean value representing whether Analytics collection is enabled or disabled.
|
||||
*/
|
||||
setAnalyticsCollectionEnabled(enabled: boolean): Promise<void>;
|
||||
@@ -48,6 +63,12 @@ export interface Module extends ReactNativeFirebaseModule {
|
||||
* always sent as your current class name. For example on Android it will always
|
||||
* show as 'MainActivity' if you do not specify it.
|
||||
*
|
||||
* #### Example
|
||||
*
|
||||
* ```js
|
||||
* await analytics().setCurrentScreen('ProductScreen', 'ProductScreen');
|
||||
* ```
|
||||
*
|
||||
* @param screenName A screen name, e.g. Product.
|
||||
* @param screenClassOverride On Android, React Native runs in a single activity called
|
||||
* 'MainActivity'. Setting this parameter overrides the default name shown on logs.
|
||||
@@ -57,6 +78,13 @@ export interface Module extends ReactNativeFirebaseModule {
|
||||
/**
|
||||
* Sets the minimum engagement time required before starting a session.
|
||||
*
|
||||
* #### Example
|
||||
*
|
||||
* ```js
|
||||
* // 20 seconds
|
||||
* await analytics().setMinimumSessionDuration(20000);
|
||||
* ```
|
||||
*
|
||||
* @param milliseconds The default value is 10000 (10 seconds).
|
||||
*/
|
||||
setMinimumSessionDuration(milliseconds: number): Promise<void>;
|
||||
@@ -64,6 +92,13 @@ export interface Module extends ReactNativeFirebaseModule {
|
||||
/**
|
||||
* Sets the duration of inactivity that terminates the current session.
|
||||
*
|
||||
* #### Example
|
||||
*
|
||||
* ```js
|
||||
* // 20 minutes
|
||||
* await analytics().setMinimumSessionDuration(900000);
|
||||
* ```
|
||||
*
|
||||
* @param milliseconds The default value is 1800000 (30 minutes).
|
||||
*/
|
||||
setSessionTimeoutDuration(milliseconds: number): Promise<void>;
|
||||
@@ -71,6 +106,14 @@ export interface Module extends ReactNativeFirebaseModule {
|
||||
/**
|
||||
* Gives a user a unique identification.
|
||||
*
|
||||
* #### Example
|
||||
*
|
||||
* ```js
|
||||
* // Set User
|
||||
* await analytics().setUserId('123456789');
|
||||
* // Remove User
|
||||
* await analytics().setUserId(null);
|
||||
* ```
|
||||
*
|
||||
* @param id Set to null to remove a previously assigned id from analytics events
|
||||
*/
|
||||
@@ -79,6 +122,12 @@ export interface Module extends ReactNativeFirebaseModule {
|
||||
/**
|
||||
* Sets a key/value pair of data on the current user.
|
||||
*
|
||||
* #### Example
|
||||
*
|
||||
* ```js
|
||||
* await analytics().setUserProperty('account_type', 'gold');
|
||||
* ```
|
||||
*
|
||||
* @param name A user property identifier.
|
||||
* @param value Set to null to remove a previously assigned id from analytics events.
|
||||
*/
|
||||
@@ -87,6 +136,15 @@ export interface Module extends ReactNativeFirebaseModule {
|
||||
/**
|
||||
* Sets multiple key/value pair of data on the current user.
|
||||
*
|
||||
* #### Example
|
||||
*
|
||||
* ```js
|
||||
* await analytics().setUserProperties({
|
||||
* account_type: 'gold',
|
||||
* account_name: 'Gold Badge',
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* @react-native-firebase
|
||||
* @param properties Set a property value to null to remove it.
|
||||
*/
|
||||
@@ -94,6 +152,12 @@ export interface Module extends ReactNativeFirebaseModule {
|
||||
|
||||
/**
|
||||
* Clears all analytics data for this instance from the device and resets the app instance ID.
|
||||
*
|
||||
* #### Example
|
||||
*
|
||||
* ```js
|
||||
* await analytics().resetAnalyticsData();
|
||||
* ```
|
||||
*/
|
||||
resetAnalyticsData(): Promise<void>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user