com.amanotes.gdk 0.1.12 → 0.1.15
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 +13 -0
- package/Editor/AmaGDKEditor.cs +1 -1
- package/Editor/Utils/AmaGDKEditor.ExtractVersion.cs +13 -13
- package/Packages/AmaGDKConfig.unitypackage +0 -0
- package/Packages/AmaGDKExample.unitypackage +0 -0
- package/Packages/AppsFlyerAdapter_v6.5.4.unitypackage +0 -0
- package/Packages/FirebaseAnalyticsAdapter_v9.1.0.unitypackage +0 -0
- package/Runtime/AmaGDK.Analytics.cs +22 -0
- package/Runtime/AmaGDK.Internal.SemVer.cs +13 -7
- package/Runtime/AmaGDK.WebUtils.cs +43 -0
- package/Runtime/AmaGDK.WebUtils.cs.meta +11 -0
- package/Runtime/AmaGDK.cs +1 -1
- package/package.json +1 -1
- /package/Packages/{AppsFlyerAdapter_v6.5.4.unitypackage.meta → AppsflyerAdapter_v6.5.4.unitypackage.meta} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.1.15 - 2023-03-06]
|
|
4
|
+
### Release AmaGDK v0.1.15
|
|
5
|
+
### Fix null exception in VersionExtractor
|
|
6
|
+
### Warn unhandle platform in Appsflyer initialization
|
|
7
|
+
### Allow dev to SetPermittedEvents and SetForbiddenEvents to the adapter config
|
|
8
|
+
|
|
9
|
+
## [0.1.14 - 2023-03-02]
|
|
10
|
+
### Release AmaGDK v0.1.14
|
|
11
|
+
|
|
12
|
+
## [0.1.13 - 2023-03-01]
|
|
13
|
+
### Release AmaGDK v0.1.13
|
|
14
|
+
### Fix Semver parser
|
|
15
|
+
|
|
3
16
|
## [0.1.12 - 2023-03-01]
|
|
4
17
|
### Release AmaGDK v0.1.12
|
|
5
18
|
### Prioritize analytics instant config over the base config
|
package/Editor/AmaGDKEditor.cs
CHANGED
|
@@ -185,7 +185,7 @@ namespace Amanotes.Editor
|
|
|
185
185
|
DrawGUI_AutoInit();
|
|
186
186
|
ToggleGroup("Config", ref showConfigDetail, DrawGUI_ConfigDetail, DrawGUI_ConfigAsset);
|
|
187
187
|
ToggleGroup("Adapters", ref showAdapterInstaller, DrawGUI_AdapterList);
|
|
188
|
-
|
|
188
|
+
//("Example", ref showExampleDetail, DrawGUI_ExampleScene);
|
|
189
189
|
}
|
|
190
190
|
|
|
191
191
|
private static void DrawVersion(string label, string version){
|
|
@@ -50,7 +50,7 @@ namespace Amanotes.Editor
|
|
|
50
50
|
{
|
|
51
51
|
public static string GDKAdapter(string sdkId)
|
|
52
52
|
{
|
|
53
|
-
string version =
|
|
53
|
+
string version = "";
|
|
54
54
|
var adapterId = sdkId + "Adapter";
|
|
55
55
|
// Debug.Log($"Searching for AdapterId: {adapterId}");
|
|
56
56
|
List<Assembly> assemblies = AppDomain.CurrentDomain.GetAssemblies().ToList();
|
|
@@ -73,12 +73,12 @@ namespace Amanotes.Editor
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
|
-
return version;
|
|
76
|
+
return version.Trim();
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
public static string ThirdParty(string sdkId)
|
|
80
80
|
{
|
|
81
|
-
string version =
|
|
81
|
+
string version = "";
|
|
82
82
|
switch (sdkId)
|
|
83
83
|
{
|
|
84
84
|
case FIREBASE_ANALYTICS : return FirebaseAnalytics();
|
|
@@ -95,7 +95,7 @@ namespace Amanotes.Editor
|
|
|
95
95
|
|
|
96
96
|
internal static string FirebaseAnalytics()
|
|
97
97
|
{
|
|
98
|
-
string version =
|
|
98
|
+
string version = "";
|
|
99
99
|
string[] filesFirebase = Directory.GetFiles("Assets", "maven-metadata.xml", SearchOption.AllDirectories);
|
|
100
100
|
if (filesFirebase != null && filesFirebase.Length > 0)
|
|
101
101
|
{
|
|
@@ -116,12 +116,12 @@ namespace Amanotes.Editor
|
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
|
-
return version;
|
|
119
|
+
return version.Trim();
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
internal static string FirebaseRemoteConfig()
|
|
123
123
|
{
|
|
124
|
-
string version =
|
|
124
|
+
string version = "";
|
|
125
125
|
string[] filesFirebase = Directory.GetFiles("Assets", "maven-metadata.xml", SearchOption.AllDirectories);
|
|
126
126
|
if (filesFirebase != null && filesFirebase.Length > 0)
|
|
127
127
|
{
|
|
@@ -142,12 +142,12 @@ namespace Amanotes.Editor
|
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
|
-
return version;
|
|
145
|
+
return version.Trim();
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
internal static string AppsFlyer()
|
|
149
149
|
{
|
|
150
|
-
string version =
|
|
150
|
+
string version = "";
|
|
151
151
|
List<Assembly> assemblies = AppDomain.CurrentDomain.GetAssemblies().ToList();
|
|
152
152
|
if (assemblies != null)
|
|
153
153
|
{
|
|
@@ -163,12 +163,12 @@ namespace Amanotes.Editor
|
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
165
|
|
|
166
|
-
return version;
|
|
166
|
+
return version.Trim();
|
|
167
167
|
}
|
|
168
168
|
|
|
169
169
|
internal static string Ironsource()
|
|
170
170
|
{
|
|
171
|
-
string version =
|
|
171
|
+
string version = "";
|
|
172
172
|
string[] issdk = Directory.GetFiles("Assets", "IronSourceSDKDependencies.xml", System.IO.SearchOption.AllDirectories);
|
|
173
173
|
if (issdk != null && issdk.Length > 0)
|
|
174
174
|
{
|
|
@@ -178,14 +178,14 @@ namespace Amanotes.Editor
|
|
|
178
178
|
XmlNode dataVersion2 = root2.SelectSingleNode("unityversion");
|
|
179
179
|
version = dataVersion2.InnerText;
|
|
180
180
|
}
|
|
181
|
-
return version;
|
|
181
|
+
return version.Trim();
|
|
182
182
|
}
|
|
183
183
|
|
|
184
184
|
internal static string RevenueCat()
|
|
185
185
|
{
|
|
186
186
|
string[] files = Directory.GetFiles("Assets", "PurchasesWrapper.java", SearchOption.AllDirectories);
|
|
187
187
|
string searchString = "PLUGIN_VERSION";
|
|
188
|
-
string version =
|
|
188
|
+
string version = "";
|
|
189
189
|
if (files.Length < 1)
|
|
190
190
|
{
|
|
191
191
|
return version;
|
|
@@ -206,7 +206,7 @@ namespace Amanotes.Editor
|
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
|
-
return version;
|
|
209
|
+
return version.Trim();
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
212
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -215,6 +215,24 @@ namespace Amanotes.Core
|
|
|
215
215
|
|
|
216
216
|
localData.UpdateMigrationLog();
|
|
217
217
|
}
|
|
218
|
+
|
|
219
|
+
public static void SetPermittedEvents(List<string> eventNames, params string[] adapterIDs)
|
|
220
|
+
{
|
|
221
|
+
foreach (var adapterID in adapterIDs)
|
|
222
|
+
{
|
|
223
|
+
var adapter = listAdapters.Find(a => a.id == adapterID)?.GetAdapterApi<IAnalyticAdapter>();
|
|
224
|
+
adapter?.SetPermittedEvents(eventNames);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
public static void SetForbiddenEvents(List<string> eventNames, params string[] adapterIDs)
|
|
229
|
+
{
|
|
230
|
+
foreach (var adapterID in adapterIDs)
|
|
231
|
+
{
|
|
232
|
+
var adapter = listAdapters.Find(a => a.id == adapterID)?.GetAdapterApi<IAnalyticAdapter>();
|
|
233
|
+
adapter?.SetForbiddenEvents(eventNames);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
218
236
|
}
|
|
219
237
|
|
|
220
238
|
//INTERNAL
|
|
@@ -587,5 +605,9 @@ namespace Amanotes.Core.Internal
|
|
|
587
605
|
void SetUserId(string userId);
|
|
588
606
|
|
|
589
607
|
void SetUserProperty(string key, string value);
|
|
608
|
+
|
|
609
|
+
void SetPermittedEvents(List<string> eventNames);
|
|
610
|
+
|
|
611
|
+
void SetForbiddenEvents(List<string> eventNames);
|
|
590
612
|
}
|
|
591
613
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
using System;
|
|
2
2
|
using System.Collections.Generic;
|
|
3
3
|
using System.Text.RegularExpressions;
|
|
4
|
+
using static Amanotes.Core.Internal.Logging;
|
|
4
5
|
|
|
5
6
|
namespace Amanotes.Core.Internal
|
|
6
7
|
{
|
|
7
8
|
public struct SemVer : IComparable<SemVer>, IComparer<SemVer>
|
|
8
9
|
{
|
|
9
|
-
public static readonly SemVer ZERO = new SemVer(0,0,0);
|
|
10
|
+
public static readonly SemVer ZERO = new SemVer(0, 0, 0);
|
|
10
11
|
|
|
11
12
|
public int major;
|
|
12
13
|
public int minor;
|
|
@@ -21,25 +22,30 @@ namespace Amanotes.Core.Internal
|
|
|
21
22
|
|
|
22
23
|
public SemVer(string version)
|
|
23
24
|
{
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
major = 0;
|
|
26
|
+
minor = 0;
|
|
27
|
+
patch = 0;
|
|
28
|
+
|
|
29
|
+
if (string.IsNullOrEmpty(version))
|
|
30
|
+
{
|
|
28
31
|
return;
|
|
29
32
|
}
|
|
30
33
|
|
|
34
|
+
version = version.Trim();
|
|
35
|
+
|
|
31
36
|
Regex regex = new Regex(@"^(\d+)\.(\d+)\.(\d+)$");
|
|
32
37
|
Match match = regex.Match(version);
|
|
33
38
|
if (!match.Success)
|
|
34
39
|
{
|
|
35
|
-
|
|
40
|
+
LogWarning($"Invalid SemVer string: [{version}]");
|
|
41
|
+
return;
|
|
36
42
|
}
|
|
37
43
|
major = int.Parse(match.Groups[1].Value);
|
|
38
44
|
minor = int.Parse(match.Groups[2].Value);
|
|
39
45
|
patch = int.Parse(match.Groups[3].Value);
|
|
40
46
|
}
|
|
41
47
|
|
|
42
|
-
public bool isValid { get { return this != ZERO; }}
|
|
48
|
+
public bool isValid { get { return this != ZERO; } }
|
|
43
49
|
|
|
44
50
|
public override string ToString()
|
|
45
51
|
{
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
using System.Collections;
|
|
2
|
+
using UnityEngine.Networking;
|
|
3
|
+
using System;
|
|
4
|
+
using System.Collections.Generic;
|
|
5
|
+
using static Amanotes.Core.Internal.Logging;
|
|
6
|
+
|
|
7
|
+
namespace Amanotes.Core.Internal
|
|
8
|
+
{
|
|
9
|
+
internal class WebUtils
|
|
10
|
+
{
|
|
11
|
+
public static void PostJson(string url, string jsonData, Action<bool, string> onComplete = null, Dictionary<string, string> headers = null)
|
|
12
|
+
{
|
|
13
|
+
AmaGDK._instance.StartCoroutine(PostJsonCoroutine(url, jsonData, onComplete, headers));
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
static IEnumerator PostJsonCoroutine(string url, string jsonData, Action<bool, string> onComplete = null, Dictionary<string, string> headers = null)
|
|
17
|
+
{
|
|
18
|
+
UnityWebRequest webRequest = new UnityWebRequest(url, "POST");
|
|
19
|
+
if (headers != null)
|
|
20
|
+
{
|
|
21
|
+
foreach (KeyValuePair<string, string> kvp in headers)
|
|
22
|
+
{
|
|
23
|
+
webRequest.SetRequestHeader(kvp.Key, kvp.Value);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
byte[] bodyRaw = System.Text.Encoding.UTF8.GetBytes(jsonData);
|
|
28
|
+
webRequest.uploadHandler = new UploadHandlerRaw(bodyRaw);
|
|
29
|
+
webRequest.downloadHandler = new DownloadHandlerBuffer();
|
|
30
|
+
yield return webRequest.SendWebRequest();
|
|
31
|
+
|
|
32
|
+
if (webRequest.result != UnityWebRequest.Result.Success)
|
|
33
|
+
{
|
|
34
|
+
LogWarning("POST request failed: " + webRequest.error);
|
|
35
|
+
onComplete?.Invoke(false, webRequest.error);
|
|
36
|
+
}
|
|
37
|
+
else
|
|
38
|
+
{
|
|
39
|
+
onComplete?.Invoke(true, webRequest.downloadHandler.text);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
package/Runtime/AmaGDK.cs
CHANGED
package/package.json
CHANGED
|
File without changes
|