public interface FirebaseAnalyticsProvider.Bridge

The platform’s connection to the native Firebase SDK. The Codename One build implements this for Android (direct SDK calls) and iOS (native methods) and hands it to registerBridge(Bridge). Application code never implements this directly.

Methods

public abstract boolean isSupported()Whether the native Firebase SDK is present and initialised.
public abstract void logEvent(String name, String paramsJson)Logs a named event with a JSON object of parameters.
public abstract void logScreen(String screenName)Logs a screen view.
public abstract void setUserId(String id)Sets the Firebase user id.
public abstract void setUserProperty(String key, String value)Sets a Firebase user property.

Method details

isSupported

public abstract boolean isSupported()
Whether the native Firebase SDK is present and initialised.

Returns

true when events can be delivered

logEvent

public abstract void logEvent(String name, String paramsJson)
Logs a named event with a JSON object of parameters.

Parameters

name String
the event name
paramsJson String
a JSON object of parameters, may be empty

logScreen

public abstract void logScreen(String screenName)
Logs a screen view.

Parameters

screenName String
the screen name

setUserId

public abstract void setUserId(String id)
Sets the Firebase user id.

Parameters

id String
the user id, or null to clear

setUserProperty

public abstract void setUserProperty(String key, String value)
Sets a Firebase user property.

Parameters

key String
the property name
value String
the property value