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.
- package/CHANGELOG.md +12 -0
- package/Editor/AmaGDKEditor.cs +35 -77
- package/Editor/AmaGDKManager.cs +236 -0
- package/{Runtime/Interfaces/Analytics/IAnalytics.cs.meta → Editor/AmaGDKManager.cs.meta} +1 -1
- package/Editor/Resources/amasdk-modules.json +31 -0
- package/Editor/Resources/amasdk-modules.json.meta +7 -0
- package/{Runtime/Interfaces.meta → Editor/Resources.meta} +1 -1
- package/Editor/Utils/AmaGDKEditor.ExtractVersion.cs +171 -0
- package/Editor/Utils/AmaGDKEditor.ExtractVersion.cs.meta +11 -0
- package/Editor/Utils/AmaGDKEditor.GUI.cs +82 -0
- package/Editor/Utils/AmaGDKEditor.GUI.cs.meta +11 -0
- package/Editor/Utils/AmaGDKEditor.Utils.cs +35 -0
- package/Editor/Utils/AmaGDKEditor.Utils.cs.meta +11 -0
- package/{Runtime/Interfaces/Analytics.meta → Editor/Utils.meta} +1 -1
- package/Packages/AmaGDKConfig.unitypackage +0 -0
- package/Packages/AmaGDKExample.unitypackage +0 -0
- package/Packages/AmaGDKExample.unitypackage.meta +7 -0
- package/Packages/AppsflyerAdapter_v6.5.4.unitypackage +0 -0
- package/Packages/AppsflyerAdapter_v6.5.4.unitypackage.meta +7 -0
- package/Packages/FirebaseAnalyticsAdapter_v9.1.0.unitypackage +0 -0
- package/Packages/IronsourceAdapter_v7.2.6.unitypackage +3 -0
- package/Packages/IronsourceAdapter_v7.2.6.unitypackage.meta +7 -0
- package/Runtime/AmaGDK.Ads.cs +235 -0
- package/Runtime/AmaGDK.Ads.cs.meta +11 -0
- package/Runtime/AmaGDK.Analytics.cs +81 -17
- package/Runtime/AmaGDK.Internal.cs +26 -1
- package/Runtime/AmaGDK.cs +19 -7
- package/Samples~/Example/AmaGDKExample.cs +87 -0
- package/Samples~/Example/AmaGDKExample.cs.meta +11 -0
- package/Samples~/Example/AmaGDKExample.unity +3114 -0
- package/Samples~/Example/AmaGDKExample.unity.meta +7 -0
- package/Sample~/Example/AmaGDKExample.cs +87 -0
- package/Sample~/Example/AmaGDKExample.cs.meta +11 -0
- package/Sample~/Example/AmaGDKExample.unity +3114 -0
- package/Sample~/Example/AmaGDKExample.unity.meta +7 -0
- package/Tests/Runtime/MigrationTest.cs +3 -3
- package/package.json +1 -1
- 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.
|
|
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
|
|
101
|
-
Analytics.
|
|
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
|
-
|
|
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 = "
|
|
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
|
+
}
|