-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #165 from immutable/feat/track
[DX-2650] feat: add track function, track init passport
- Loading branch information
Showing
13 changed files
with
158 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
19 changes: 19 additions & 0 deletions
19
src/Packages/Passport/Runtime/Scripts/Private/Event/AnalyticsEvent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
namespace Immutable.Passport.Event | ||
{ | ||
public static class PassportAnalytics | ||
{ | ||
public const string TRACK = "track"; | ||
public const string MODULE_NAME = "unitySdk"; | ||
|
||
public static class EventName | ||
{ | ||
public const string START_INIT_PASSPORT = "startedInitialisePassport"; | ||
public const string INIT_PASSPORT = "initialisedPassport"; | ||
} | ||
|
||
public static class Properties | ||
{ | ||
public const string SUCCESS = "succeeded"; | ||
} | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...Scripts/Private/PassportConstants.cs.meta → ...ipts/Private/Event/AnalyticsEvent.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/Packages/Passport/Runtime/Scripts/Private/Model/Request/TrackData.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using System.Collections.Generic; | ||
using System; | ||
|
||
namespace Immutable.Passport.Model | ||
{ | ||
[Serializable] | ||
internal class TrackData | ||
{ | ||
public string moduleName; | ||
public string eventName; | ||
public string? properties; | ||
} | ||
} | ||
|
11 changes: 11 additions & 0 deletions
11
src/Packages/Passport/Runtime/Scripts/Private/Model/Request/TrackData.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
src/Packages/Passport/Runtime/Scripts/Private/PassportConstants.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/Packages/Passport/Tests/Runtime/Scripts/Helpers/JsonHelpersTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using System.Collections.Generic; | ||
using System; | ||
using NUnit.Framework; | ||
using Immutable.Passport.Helpers; | ||
|
||
namespace Immutable.Passport.Core | ||
{ | ||
[TestFixture] | ||
public class JsonHelpersTests | ||
{ | ||
[Test] | ||
public void DictionaryToJson() | ||
{ | ||
var properties = new Dictionary<string, object>(){ | ||
{"boolean", true}, | ||
{"string", "immutable"}, | ||
{"int", 1}, | ||
{"long", (long) 2}, | ||
{"double", (double) 3} | ||
}; | ||
Assert.AreEqual("{\"boolean\":true,\"string\":\"immutable\",\"int\":1,\"long\":2,\"double\":3}", properties.ToJson()); | ||
|
||
properties = new Dictionary<string, object>() { { "boolean", false } }; | ||
Assert.AreEqual("{\"boolean\":false}", properties.ToJson()); | ||
|
||
properties = new Dictionary<string, object>(); | ||
Assert.AreEqual("{}", properties.ToJson()); | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/Packages/Passport/Tests/Runtime/Scripts/Helpers/JsonHelpersTests.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters