HMSAnalytics class
Properties
hashCode
→ int
The hash code for this object.
no setter inherited
runtimeType
→ Type
A representation of the runtime type of the object.
no setter inherited
Methods
clearCachedData ()
→ Future <void >
Delete all collected data in the local cache, including the cached data that fails to be sent.
deleteUserId ()
→ Future <void >
Delete created user ID.
deleteUserProfile (String key )
→ Future <void >
Delete created user profile
disableLogger ()
→ Future <void >
Disables the HMSLogger capability.
enableLog ()
→ Future <void >
Enables the log function.
note This function is specifically used by Android Platforms.
enableLogger ()
→ Future <void >
Enables the HMSLogger capability.
enableLogWithLevel (String logLevel )
→ Future <void >
Enables the debug log function and sets the minimum log level.
note This function is specifically used by Android Platforms.
getAAID ()
→ Future <String ? >
Obtains the app instance ID from AppGallery Connect.
getReportPolicyThreshold (String policyType )
→ Future <int ? >
Obtains the threshold for event reporting.
@param reportPolicyType : Event reporting policy name.
note This function is specifically used by Android Platforms.
getUserProfiles (bool predefined )
→ Future <Map <String , dynamic > >
Enables AB Testing. Predefined or custom user attributes are supported.
isRestrictionEnabled ()
→ Future <bool >
Obtains the restriction status of HUAWEI Analytics.
noSuchMethod (Invocation invocation )
→ dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onEvent (String eventId , Map <String , dynamic > params )
→ Future <void >
Records an event.
pageEnd (String pageName )
→ Future <void >
Defines a custom page exit event.
pageStart (String pageName , String pageClassOverride )
→ Future <void >
Defines a custom page entry event.
note This function is specifically used by Android Platforms.
setAnalyticsEnabled (bool enabled )
→ Future <void >
Specifies whether to enable event collection.
setMinActivitySessions (int interval )
→ Future <void >
Sets the minimum interval for starting a new session.
note This function is specifically used by Android Platforms.
setPushToken (String token )
→ Future <void >
Sets the push token, which is obtained using the Push Kit.
note This function is specifically used by Android Platforms.
setReportPolicies ({int ? scheduledTime , bool ? appLaunch , bool ? moveBackground , int ? cacheThreshold })
→ Future <void >
Sets data reporting policies.
setRestrictionEnabled (bool enabled )
→ Future <void >
Specifies whether to enable restriction of HUAWEI Analytics.
The default value is false, which indicates that HUAWEI Analytics is
enabled by default.
setSessionDuration (int duration )
→ Future <void >
Sets the session timeout interval.
setUserId (String ? userId )
→ Future <void >
Set a user ID.
important : When the setUserId API is called, if the old userId is not
empty and is different from the new userId, a new session is generated.
If you do not want to use setUserId to identify a user
(for example, when a user signs out), set userId to null .
setUserProfile (String key , String value )
→ Future <void >
User attribute values remain unchanged throughout the app's lifecycle and session.
A maximum of 25 user attribute names are supported.
If an attribute name is duplicate with an existing one, the attribute names needs to be changed.
toString ()
→ String
A string representation of this object.
inherited
huawei_analytics 5.2.0+301