Skip to content

Commit e2b3917

Browse files
authored
Merge pull request #5 from aptabase/go/session-id
use new sessionid format
2 parents cf88a39 + deb3f01 commit e2b3917

4 files changed

Lines changed: 13 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.2.3
2+
3+
- use new session id format
4+
15
## 0.2.2
26

37
- Fixed issue with settings importer

PACKAGE.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "com.aptabase",
33
"displayName": "Aptabase",
4-
"version": "0.2.2",
4+
"version": "0.2.3",
55
"unity": "2018.4",
66
"description": "Analytics for Apps. Privacy-First. Simple. Real-Time.",
77
"keywords": ["analytics"],

Runtime/Aptabase.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.Threading;
44
using System.Threading.Tasks;
55
using UnityEngine;
6+
using Random = UnityEngine.Random;
67

78
namespace AptabaseSDK
89
{
@@ -165,6 +166,11 @@ private static int GetFlushInterval()
165166
return _env.isDebug ? 2000 : 60000;
166167
}
167168

168-
private static string NewSessionId() => Guid.NewGuid().ToString().ToLower();
169+
private static string NewSessionId()
170+
{
171+
var epochInSeconds = DateTimeOffset.UtcNow.ToUnixTimeSeconds();
172+
var random = Random.Range(0, 99999999);
173+
return (epochInSeconds * 100000000 + random).ToString();
174+
}
169175
}
170176
}

Runtime/Version.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ namespace AptabaseSDK
44
{
55
public static class Version
66
{
7-
private const string SDK_VERSION = "Aptabase.Unity@0.2.2";
7+
private const string SDK_VERSION = "Aptabase.Unity@0.2.3";
88

99
public static VersionInfo GetVersionInfo(Settings settings)
1010
{

0 commit comments

Comments
 (0)