com.amanotes.gdk 0.1.9 → 0.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/Editor/AmaGDKEditor.cs +35 -77
  3. package/Editor/AmaGDKManager.cs +236 -0
  4. package/{Runtime/Interfaces/Analytics/IAnalytics.cs.meta → Editor/AmaGDKManager.cs.meta} +1 -1
  5. package/Editor/Resources/amasdk-modules.json +31 -0
  6. package/Editor/Resources/amasdk-modules.json.meta +7 -0
  7. package/{Runtime/Interfaces.meta → Editor/Resources.meta} +1 -1
  8. package/Editor/Utils/AmaGDKEditor.ExtractVersion.cs +171 -0
  9. package/Editor/Utils/AmaGDKEditor.ExtractVersion.cs.meta +11 -0
  10. package/Editor/Utils/AmaGDKEditor.GUI.cs +82 -0
  11. package/Editor/Utils/AmaGDKEditor.GUI.cs.meta +11 -0
  12. package/Editor/Utils/AmaGDKEditor.Utils.cs +35 -0
  13. package/Editor/Utils/AmaGDKEditor.Utils.cs.meta +11 -0
  14. package/{Runtime/Interfaces/Analytics.meta → Editor/Utils.meta} +1 -1
  15. package/Packages/AmaGDKConfig.unitypackage +0 -0
  16. package/Packages/AmaGDKExample.unitypackage +0 -0
  17. package/Packages/AmaGDKExample.unitypackage.meta +7 -0
  18. package/Packages/AppsflyerAdapter_v6.5.4.unitypackage +0 -0
  19. package/Packages/AppsflyerAdapter_v6.5.4.unitypackage.meta +7 -0
  20. package/Packages/FirebaseAnalyticsAdapter_v9.1.0.unitypackage +0 -0
  21. package/Packages/IronsourceAdapter_v7.2.6.unitypackage +3 -0
  22. package/Packages/IronsourceAdapter_v7.2.6.unitypackage.meta +7 -0
  23. package/Runtime/AmaGDK.Ads.cs +235 -0
  24. package/Runtime/AmaGDK.Ads.cs.meta +11 -0
  25. package/Runtime/AmaGDK.Analytics.cs +81 -17
  26. package/Runtime/AmaGDK.Internal.cs +26 -1
  27. package/Runtime/AmaGDK.cs +19 -7
  28. package/Samples~/Example/AmaGDKExample.cs +87 -0
  29. package/Samples~/Example/AmaGDKExample.cs.meta +11 -0
  30. package/Samples~/Example/AmaGDKExample.unity +3114 -0
  31. package/Samples~/Example/AmaGDKExample.unity.meta +7 -0
  32. package/Sample~/Example/AmaGDKExample.cs +87 -0
  33. package/Sample~/Example/AmaGDKExample.cs.meta +11 -0
  34. package/Sample~/Example/AmaGDKExample.unity +3114 -0
  35. package/Sample~/Example/AmaGDKExample.unity.meta +7 -0
  36. package/Tests/Runtime/MigrationTest.cs +3 -3
  37. package/package.json +1 -1
  38. package/Runtime/Interfaces/Analytics/IAnalytics.cs +0 -6
package/Runtime/AmaGDK.cs CHANGED
@@ -12,9 +12,10 @@ namespace Amanotes.Core
12
12
  {
13
13
  public partial class AmaGDK : MonoBehaviour
14
14
  {
15
- public const string VERSION = "0.1.9";
15
+ public const string VERSION = "0.1.11";
16
16
 
17
17
  internal static AmaGDK _instance;
18
+ internal static event Action _frameUpdate;
18
19
  private static ConfigAsset _config = null;
19
20
  internal static ConfigAsset Config {
20
21
  get {
@@ -24,7 +25,7 @@ namespace Amanotes.Core
24
25
  return _config;
25
26
  }
26
27
  }
27
-
28
+
28
29
  internal static Status _status = Status.None;
29
30
  internal static Action _onReadyCallback;
30
31
  internal static bool _allowInit = false;
@@ -97,9 +98,10 @@ namespace Amanotes.Core
97
98
  Log($"Adapter {adapter.id} inited!");
98
99
  }
99
100
 
100
- // Init adapters
101
- Analytics.GetAnalyticAdapters();
102
-
101
+ // Init modules (Adapter managers)
102
+ Analytics.Init();
103
+ Ads.Init();
104
+
103
105
  _status = Status.Ready;
104
106
  _onReadyCallback?.Invoke();
105
107
  _onReadyCallback = null;
@@ -109,7 +111,7 @@ namespace Amanotes.Core
109
111
  private void Update()
110
112
  {
111
113
  if (!isReady) return;
112
- Analytics.ProcessEventQueue();
114
+ _frameUpdate?.Invoke();
113
115
  }
114
116
  }
115
117
 
@@ -145,6 +147,16 @@ namespace Amanotes.Core
145
147
  _instance = sdk.AddComponent<AmaGDK>();
146
148
  }
147
149
 
150
+ public static void BeginCoroutine(IEnumerator enumerator)
151
+ {
152
+ _instance.StartCoroutine(enumerator);
153
+ }
154
+
155
+ public static void EndCoroutine(IEnumerator enumerator)
156
+ {
157
+ _instance.StopCoroutine(enumerator);
158
+ }
159
+
148
160
  public static void AddCallback(Action onReady)
149
161
  {
150
162
  if (onReady == null)
@@ -165,7 +177,7 @@ namespace Amanotes.Core
165
177
  public const string FIREBASE_ANALYTICS = "FirebaseAnalytics";
166
178
  public const string FIREBASE_REMOTE_CONFIG = "FirebaseRemoteConfig";
167
179
  public const string APPSFLYER = "Appsflyer";
168
- public const string IRONSOURCE = "ironSource";
180
+ public const string IRONSOURCE = "IronSource";
169
181
  public const string REVENUECAT = "RevenueCat";
170
182
  }
171
183
  }
@@ -0,0 +1,87 @@
1
+ using System.Collections;
2
+ using System.Collections.Generic;
3
+ using UnityEngine;
4
+ using Amanotes.Core;
5
+
6
+ public class AmaGDKExample : MonoBehaviour
7
+ {
8
+ private void Start()
9
+ {
10
+ //Config: log at even count
11
+ AmaGDK.Analytics.SetLogEventCondition((eventDetail) =>
12
+ {
13
+ if (eventDetail.eventName == "even_count")
14
+ {
15
+ return eventDetail.count % 2 == 0;
16
+ }
17
+
18
+ return true;
19
+ });
20
+ }
21
+
22
+ public void OnInitSDKClick()
23
+ {
24
+ AmaGDK.Init();
25
+ }
26
+
27
+ public void OnLogEventClick()
28
+ {
29
+ Debug.Log("Log test event");
30
+ AmaGDK.Analytics.LogEvent("TestEvent");
31
+ }
32
+
33
+ public void SaveUser()
34
+ {
35
+ var user = AmaGDK.User;
36
+ user.amaId = "3";
37
+ user.amaDeviceId = "4";
38
+ Debug.Log($"[Save] ama_id: {user.amaId},\nama_device_id: {user.amaDeviceId}");
39
+ AmaGDK.User.Save();
40
+ }
41
+
42
+ public void LoadUser()
43
+ {
44
+ var user = AmaGDK.User;
45
+ Debug.Log($"[Load] ama_id: {user.amaId},\nama_device_id: {user.amaDeviceId}");
46
+ }
47
+
48
+ public void LogFunnelWithSignature()
49
+ {
50
+ AmaGDK.Analytics.LogFunnelEvent("funnel", "TestFunnel1");
51
+ }
52
+
53
+ public void LogFunnelWithoutSignature()
54
+ {
55
+ AmaGDK.Analytics.LogFunnelEvent("funnel");
56
+ }
57
+
58
+ public void LogAccumulatedEvent()
59
+ {
60
+ AmaGDK.Analytics.LogEvent("accu").SetAsAccumulated();
61
+ }
62
+
63
+ public void LogWithEven()
64
+ {
65
+ AmaGDK.Analytics.LogEvent("even_count");
66
+ }
67
+
68
+ public void ShowBanner()
69
+ {
70
+ AmaGDK.Ads.ShowBanner();
71
+ }
72
+
73
+ public void HideBanner()
74
+ {
75
+ AmaGDK.Ads.HideBanner();
76
+ }
77
+
78
+ public void ShowInterstitial()
79
+ {
80
+ AmaGDK.Ads.ShowInterstitial();
81
+ }
82
+
83
+ public void ShowReward()
84
+ {
85
+ AmaGDK.Ads.ShowRewardedVideo();
86
+ }
87
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 289f046fd8a0c46b790440a86ed22453
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant: