FirebaseAnalyticsPlatform class abstract
The interface that implementations of firebase_analytics
must extend.
Platform implementations should extend this class rather than implement it
as firebase_analytics
does not consider newly added methods to be breaking
changes. Extending this class (using extends
) ensures that the subclass
will get the default implementation, while platform implementations that
implements
this interface will be broken by newly added
FirebaseAnalyticsPlatform methods.
- Inheritance
-
- Object
- PlatformInterface
- FirebaseAnalyticsPlatform
- Implementers
Constructors
- FirebaseAnalyticsPlatform({FirebaseApp? appInstance})
- Create an instance using app
- FirebaseAnalyticsPlatform.instanceFor({required FirebaseApp app})
-
Create an instance using
app
using the existing implementationfactory
Properties
- app → FirebaseApp
-
Returns the
FirebaseApp
for the current instance.no setter - appInstance ↔ FirebaseApp?
-
The
FirebaseApp
this instance was initialized with.getter/setter pair - hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
delegateFor(
{required FirebaseApp app}) → FirebaseAnalyticsPlatform - Enables delegates to create new instances of themselves
-
getAppInstanceId(
) → Future< String?> - Retrieves the app instance id from the service.
-
getSessionId(
) → Future< int?> -
initiateOnDeviceConversionMeasurement(
{String? emailAddress, String? phoneNumber}) → Future< void> - Used for ads conversion measurement, without allowing any personally identifiable information to leave the user device.
-
isSupported(
) → Future< bool> - isSupported() informs web users whether the browser supports Firebase.Analytics
-
logEvent(
{required String name, Map< String, Object?> ? parameters, AnalyticsCallOptions? callOptions}) → Future<void> -
Logs a custom Flutter Analytics event with the given
name
and eventparameters
. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
resetAnalyticsData(
) → Future< void> - Clears all analytics data for this app from the device and resets the app instance id.
-
setAnalyticsCollectionEnabled(
bool enabled) → Future< void> - Sets whether analytics collection is enabled for this app.
-
setConsent(
{bool? adStorageConsentGranted, bool? analyticsStorageConsentGranted, bool? adPersonalizationSignalsConsentGranted, bool? adUserDataConsentGranted, bool? functionalityStorageConsentGranted, bool? personalizationStorageConsentGranted, bool? securityStorageConsentGranted}) → Future< void> - Sets the applicable end user consent state. By default, no consent mode values are set.
-
setCurrentScreen(
{String? screenName, String? screenClassOverride, AnalyticsCallOptions? callOptions}) → Future< void> - Sets the current screen name, which specifies the current visual context in your app.
-
setDefaultEventParameters(
Map< String, Object?> ? defaultParameters) → Future<void> - Adds parameters that will be set on every event logged from the SDK, including automatic ones.
-
setSessionTimeoutDuration(
Duration timeout) → Future< void> - Sets the duration of inactivity that terminates the current session.
-
setUserId(
{String? id, AnalyticsCallOptions? callOptions}) → Future< void> -
Sets the user id.
Setting a null
id
removes the user id.callOptions
are for web platform only. -
setUserProperty(
{required String name, required String? value, AnalyticsCallOptions? callOptions}) → Future< void> -
Sets a user property to the given value.
Setting a null
value
removes the user property.callOptions
are for web platform only. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance ↔ FirebaseAnalyticsPlatform
-
The current default FirebaseAnalyticsPlatform instance.
getter/setter pair