firebase

Functions and constants for interacting with Firebase

Version: stable

FUNCTIONS
firebase.analytics.initialize()
firebase.analytics.set_callback()
firebase.analytics.log()
firebase.analytics.log_string()
firebase.analytics.log_int()
firebase.analytics.log_number()
firebase.analytics.log_table()
firebase.analytics.set_default_event_params()
firebase.analytics.set_user_id()
firebase.analytics.set_user_property()
firebase.analytics.reset()
firebase.analytics.get_id()
firebase.analytics.set_enabled()
CONSTANTS
MSG_ERROR
MSG_INSTANCE_ID

Functions

firebase.analytics.initialize()

firebase.analytics.initialize()

Initialise analytics

PARAMETERS

None


firebase.analytics.set_callback()

firebase.analytics.set_callback(callback)

Sets a callback function for receiving events from the SDK. Call `firebase.analytics.set_callback(nil)` to remove callback

PARAMETERS

callback function
Callback function that is executed on any event in the SDK.
self object
The calling script instance
message_id number
One of message types: `firebase.analytics.MSG_ERROR` `firebase.analytics.MSG_INSTANCE_ID`
message table
A table holding the data
error string
The error message (if an error occurred or `nil` otherwise)
instance_id string
For message_id MSG_INSTANCE_ID or `nil` otherwise.

firebase.analytics.log()

firebase.analytics.log(name)

Log an event without parameters.

PARAMETERS

name string
Event name

firebase.analytics.log_string()

firebase.analytics.log_string(name,PARAMeter_name,PARAMeter_value)

Log an event with one string parameter.

PARAMETERS

name string
Event name
PARAMeter_name string
Parameter name
PARAMeter_value string
Parameter value

firebase.analytics.log_int()

firebase.analytics.log_int(name,PARAMeter_name,PARAMeter_value)

Log an event with one integer parameter.

PARAMETERS

name string
Event name
PARAMeter_name string
Parameter name
PARAMeter_value number
Parameter value

firebase.analytics.log_number()

firebase.analytics.log_number(name,PARAMeter_name,PARAMeter_value)

Log an event with one float parameter.

PARAMETERS

name string
Event name
PARAMeter_name string
Parameter name
PARAMeter_value number
Parameter value

firebase.analytics.log_table()

firebase.analytics.log_table(name,parameters_table)

Log an event with table parameters.

PARAMETERS

name string
Event name
parameters_table table
Table with parameters (key-value pairs)

firebase.analytics.set_default_event_params()

firebase.analytics.set_default_event_params(default_params)

Log an event with table parameters.

PARAMETERS

default_params table
Table with default parameters (key-value pairs)

firebase.analytics.set_user_id()

firebase.analytics.set_user_id(user_id)

Sets the user ID property.

PARAMETERS

user_id string
User ID property

firebase.analytics.set_user_property()

firebase.analytics.set_user_property(name,property)

Set a user property to the given value.

PARAMETERS

name string
User property name
property string
User property value

firebase.analytics.reset()

firebase.analytics.reset()

Clears all data for this app from the device and resets the app instance id.

PARAMETERS

None


firebase.analytics.get_id()

firebase.analytics.get_id()

Get the instance ID from the service. Returned in callback with MSG_INSTANCE_ID message_id.

PARAMETERS

None


firebase.analytics.set_enabled()

firebase.analytics.set_enabled(key)

Sets whether analytics collection is enabled for this app on this device.

PARAMETERS

key boolean
The value

Constants

MSG_ERROR

Event generated when an error occurred.


MSG_INSTANCE_ID

Event generated when instance_id ready after `firebase.analytics.get_id()` call