Interface NativeFirebaseAnalytics

All Superinterfaces:
NativeInterface

public interface NativeFirebaseAnalytics extends NativeInterface

Native bridge for FirebaseAnalyticsProvider. Each platform supplies an implementation that forwards to the native Firebase Analytics SDK:

  • Android: FirebaseAnalytics.getInstance(context).logEvent(...) / setUserId / setUserProperty (requires google-services.json and the Firebase Gradle plugin in the build).
  • iOS: FIRAnalytics logEventWithName:parameters: / setUserID: / setUserProperty:forName: (requires GoogleService-Info.plist and the Firebase pods).

When no native peer is present (for example in the simulator, or in a build without Firebase configured), NativeLookup.create returns null / NativeInterface.isSupported() returns false and the provider degrades to a no-op. Parameters are passed as a JSON object string so the native side can map them to the SDK's bundle / NSDictionary.

  • Method Details

    • logEvent

      void logEvent(String name, String paramsJson)

      Logs a named event with a JSON object of parameters.

      Parameters
      • name: the event name

      • paramsJson: a JSON object of parameters, may be empty

    • logScreen

      void logScreen(String screenName)

      Logs a screen view.

      Parameters
      • screenName: the screen name
    • setUserId

      void setUserId(String id)

      Sets the Firebase user id.

      Parameters
      • id: the user id, or null to clear
    • setUserProperty

      void setUserProperty(String key, String value)

      Sets a Firebase user property.

      Parameters
      • key: the property name

      • value: the property value