Logs a crash message in Firebase. This API is avaliable to maintain retrocompatibility with legacy code. It's internal implementation is the same as implementation for logError.
const modules = await Eitri.modules();
const crashLog = modules?.fb?.crashLog;
if (!crashLog) return;
await crashLog({message: "App Crashed"})
Object for future destructuring containing the message of the error as it's single attribute
The message of the error.
Logs screen_view events in Firebase, sending the name of the screen and it's class.
const modules = await Eitri.modules();
const currentScreen = modules?.fb?.currentScreen;
if (!currentScreen) return;
await currentScreen({screen: "Home", screenClass: "HomeScreen"})
Object for future destructuring containing the name of the screen and it's class.
Name of the screen.
Name of the class that represents the screen.
Returns the Firebase Analytics app instance ID for this installation.
This is the identifier Firebase/GA4 uses to key a single app installation (e.g. as app_instance_id in BigQuery exports).
const modules = await Eitri.modules();
const getAppInstanceId = modules?.fb?.getAppInstanceId;
if (!getAppInstanceId) return;
const appInstanceId = await getAppInstanceId()
Returns the current Firebase Analytics session ID for this installation. This identifies the active analytics session and changes between sessions — it is not a stable per-user or per-installation identifier.
const modules = await Eitri.modules();
const getSessionId = modules?.fb?.getSessionId;
if (!getSessionId) return;
const sessionId = await getSessionId()
Logs a error message in Firebase.
const modules = await Eitri.modules();
const logError = modules?.fb?.logError;
if (!logError) return;
await logError({message: "Error message"})
Object for future destructuring containing the message of the error as it's single attribute
The message of the error.
Logs an app event in Firebase. The event can have up to 25 parameters, each being represented by the key-value pairs contained in the data object.
Example:
const modules = await Eitri.modules();
const logEvent = modules?.fb?.logEvent;
if (!logEvent) {
console.log("Firebase module is not available");
return;
}
await logEvent({eventName: "event", data: {appLanguage: "en-US"}})
Object describing the event.
Object describing the event's data.
Keys for a parameter's name can be up to 40 characters long, must start with an alphabetic character and contain only alphanumeric characters and underscores, as dictated by Firebase.
The value for a key can be up to 100 characters long if it is a string.
Name of the event.
Firebase dictates it must contain 1 to 40 alphanumeric characters or udndescores and start with an alphabetic character.
Sets the user ID property.
const modules = await Eitri.modules();
const setUserId = modules?.fb?.setUserId;
if (!setUserId) return;
await setUserId({id: "123456"})
Object containing an 'id' attribute for future destructuring.
ID property for the user.
Sets a user property.
const modules = await Eitri.modules();
const setUserProperty = modules?.fb?.setUserProperty;
if (!setUserProperty) return;
await setUserProperty({key: "age", value: "23"})
Object containing key/value pairs for future destructuring.
Name for the user's property.
Value for the user's property of name defined in param.key.
Set of methods allow eitri shopping apps to use Firebase native code methods. Through these methods, it is possible to log events, errors, crashes, the name of screens where functions have been called and it's class set an user's ID and set user properties.