mirror of
https://github.com/thegatesbrowser/thegates.git
synced 2025-08-24 02:17:27 -04:00
app version code
This commit is contained in:
parent
eecf9b31b7
commit
74c3c4e65e
2 changed files with 14 additions and 6 deletions
|
@ -21,10 +21,6 @@ func send_event(body: Dictionary = {}) -> void:
|
|||
if err != HTTPRequest.RESULT_SUCCESS: Debug.logclr("Cannot send request send_event", Color.RED)
|
||||
|
||||
|
||||
func get_app_version() -> void:
|
||||
AnalyticsEvents.app_version = ProjectSettings.get_setting("application/config/version")
|
||||
|
||||
|
||||
func get_user_id() -> void:
|
||||
AnalyticsEvents.user_id = DataSaver.get_string("analytics", "user_id")
|
||||
if not AnalyticsEvents.user_id.is_empty(): return
|
||||
|
@ -41,5 +37,15 @@ func get_user_id() -> void:
|
|||
if err != HTTPRequest.RESULT_SUCCESS: Debug.logclr("Cannot send request create_user_id", Color.RED)
|
||||
|
||||
|
||||
func get_app_version() -> void:
|
||||
AnalyticsEvents.app_version = ProjectSettings.get_setting("application/config/version")
|
||||
AnalyticsEvents.app_version_code = version_to_int(AnalyticsEvents.app_version)
|
||||
|
||||
|
||||
func version_to_int(version: String) -> int:
|
||||
var parts = version.split(".")
|
||||
return int(parts[0]) * 10000 + int(parts[1]) * 100 + int(parts[2])
|
||||
|
||||
|
||||
static func get_delta_sec_from_tick(from_tick: int) -> float:
|
||||
return float(Time.get_ticks_msec() - from_tick) / 1000
|
||||
|
|
|
@ -1,15 +1,17 @@
|
|||
extends Node
|
||||
#class_name AnalyticsEvents
|
||||
|
||||
var app_version := "none"
|
||||
var user_id := "none"
|
||||
var app_version := "none"
|
||||
var app_version_code := -1
|
||||
|
||||
|
||||
func base(event_name: String) -> Dictionary:
|
||||
var event = {}
|
||||
event.user_id = user_id
|
||||
event.event_name = event_name
|
||||
event.app_version = app_version
|
||||
event.user_id = user_id
|
||||
event.app_version_code = app_version_code
|
||||
return event
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue