-
Notifications
You must be signed in to change notification settings - Fork 9
Description
Currently, the application sends plugin status data to the backend (This is WIP: Refer to this PR). However, in cases where there is network congestion or the server connection cannot be established, this data cannot be sent. To address this, we should implement support for Firebase Analytics custom events to log plugin statuses even when the backend is unreachable.
We need to implement a background service or periodic task that runs daily to check the status of all plugins, verify which plugins have successfully sent data in the last 24 hours, and identify those that have not. This data should then be logged to Firebase Analytics as custom events for easy tracking.
Analytics Event Details:
The event should capture the following details:
- Plugin Name
- Status (CONNECTED, DISCONNECTED, FAILED, etc.)
- User ID
- Project ID (to group users within projects)
Something Like:
fun logPluginStatus(pluginName: String, status: String, userId: String, projectId: String) {
val analytics = Firebase.analytics
val bundle = Bundle().apply {
putString("plugin_name", pluginName)
putString("status", status)
putString("user_id", userId)
putString("project_id", projectId)
}
analytics.logEvent("plugin_status_log", bundle)
}Based on the current scenario, each user will generate at most 10 events per day (one per plugin), which should be minimal in terms of data load.