com.amanotes.gdk 0.2.65-5 → 0.2.65-6

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.
@@ -2,12 +2,16 @@ using System;
2
2
  using System.Collections.Generic;
3
3
  using System.IO;
4
4
  using System.Linq;
5
+ using System.Net.Http;
5
6
  using System.Text;
6
7
  using System.Xml;
8
+ using Amanotes.Core.Internal;
7
9
  using UnityEditor;
8
10
  using UnityEditor.Build;
9
11
  using UnityEditor.Build.Reporting;
10
12
  using UnityEngine;
13
+ using System.Threading.Tasks;
14
+ using UnityEditor.Callbacks;
11
15
 
12
16
  #if UNITY_IOS
13
17
  using UnityEditor.iOS.Xcode;
@@ -227,6 +231,70 @@ namespace Amanotes.Editor
227
231
 
228
232
  WriteToStreamingAssets();
229
233
  }
234
+ }
235
+
236
+ public partial class SDKVersionTracking
237
+ {
238
+ private const string AUTH_TOKEN = "pat1CmLr9XozLt6ZE";
239
+ private const string URL = "https://gdk.amanotes.io/gdkVersionTracking";
240
+
241
+ [PostProcessBuild(999)]
242
+ public static void OnPostProcessBuild(BuildTarget target, string pathToBuiltProject)
243
+ {
244
+ var rawData = _dicThirdPartyVersion
245
+ .Concat(_dicExtraVersion)
246
+ .Concat(_dicIronSourceAdapterVersion.ToDictionary(kvp => kvp.Key, kvp => (object)("IS_" + kvp.Value)))
247
+ .ToDictionary(x => x.Key, x => x.Value);
248
+ rawData["UnityVersion"] = Application.unityVersion;
249
+ string platform = "";
250
+ #if UNITY_ANDROID
251
+ platform = "Android";
252
+ rawData["Permissions"] = GetAllAndroidPermissions();
253
+ rawData["APILevel"] = (int)PlayerSettings.Android.targetSdkVersion;
254
+ #elif UNITY_IOS
255
+ rawData["SKAdNetwork"] = GetSkAdNetworkCount($"{pathToBuiltProject}/Info.plist");
256
+ platform = "iOS";
257
+ #endif
258
+
259
+ var buildInfo = new Dictionary<string, object>
260
+ {
261
+ {"GameName", Application.productName},
262
+ {"BuildVersion", PlayerSettings.bundleVersion},
263
+ {"BuildNumber", GetBuildNumber()},
264
+ {"BuildTime", GetBuildTime()},
265
+ {"AppId", PlayerSettings.applicationIdentifier },
266
+ {"Platform", platform},
267
+ {"RawData", rawData }
268
+ };
269
+ string json = JsonUtils.DictionaryToJson(buildInfo, false, false);
270
+ Task.Run(()=>SendDataToAirTable(json));
271
+ }
230
272
 
273
+ private static async Task SendDataToAirTable(string payload)
274
+ {
275
+ try
276
+ {
277
+ var client = new HttpClient();
278
+ var request = new HttpRequestMessage(HttpMethod.Post, URL);
279
+ request.Headers.Add("Authorization", AUTH_TOKEN);
280
+ request.Content = new StringContent(payload, Encoding.UTF8, "application/json");
281
+
282
+ var response = await client.SendAsync(request);
283
+ if (response.IsSuccessStatusCode)
284
+ {
285
+ string responseData = await response.Content.ReadAsStringAsync();
286
+ Debug.Log("AmaGDK | [SDKVersionTracking]: done " + responseData);
287
+ }
288
+ else
289
+ {
290
+ string errorData = await response.Content.ReadAsStringAsync();
291
+ Debug.LogError($"AmaGDK | [SDKVersionTracking] Status code {response.StatusCode} Error Response: {errorData}");
292
+ }
293
+ }
294
+ catch (HttpRequestException e)
295
+ {
296
+ Debug.LogError("AmaGDK | [SDKVersionTracking] Request Exception: " + e.Message);
297
+ }
298
+ }
231
299
  }
232
300
  }
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/Runtime/AmaGDK.cs CHANGED
@@ -17,7 +17,7 @@ namespace Amanotes.Core
17
17
  {
18
18
  public partial class AmaGDK : MonoBehaviour
19
19
  {
20
- public const string VERSION = "0.2.65-5";
20
+ public const string VERSION = "0.2.65-6";
21
21
 
22
22
  internal static Status _status = Status.None;
23
23
  private static ConfigAsset _config = null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "com.amanotes.gdk",
3
- "version": "0.2.65-5",
3
+ "version": "0.2.65-6",
4
4
  "displayName": "AmaGDK",
5
5
  "description": "Amanotes Game Development Kit",
6
6
  "unity": "2019.4",
@@ -1,73 +0,0 @@
1
- using System.Collections.Generic;
2
- using System.Net.Http;
3
- using System.Text;
4
- using System.Threading.Tasks;
5
- using Amanotes.Core.Internal;
6
- using UnityEditor;
7
- using UnityEditor.Callbacks;
8
- using UnityEngine;
9
-
10
- namespace Amanotes.Editor
11
- {
12
- public partial class SDKVersionTracking
13
- {
14
- private const string AUTH_TOKEN = "pat1CmLr9XozLt6ZE";
15
- private const string URL = "https://gdk.amanotes.io/gdkVersionTracking";
16
-
17
- [PostProcessBuild(999)]
18
- public static void OnPostProcessBuild(BuildTarget target, string pathToBuiltProject)
19
- {
20
- var rawData = AllVersions;
21
- rawData["UnityVersion"] = Application.unityVersion;
22
- #if UNITY_ANDROID
23
- rawData["Platform"] = "Android";
24
- rawData["Permissions"] = GetAllAndroidPermissions();
25
- rawData["APILevel"] = (int)PlayerSettings.Android.targetSdkVersion;
26
- #elif UNITY_IOS
27
- rawData["SKAdNetwork"] = GetSkAdNetworkCount($"{pathToBuiltProject}/Info.plist");
28
- rawData["Platform"] = "iOS";
29
- #endif
30
-
31
- var buildInfo = new Dictionary<string, object>
32
- {
33
- {"GameName", Application.productName},
34
- {"BuildVersion", PlayerSettings.bundleVersion},
35
- {"BuildNumber", GetBuildNumber()},
36
- {"BuildTime", GetBuildTime()},
37
- {"AppId", PlayerSettings.applicationIdentifier },
38
- {"RawData", rawData }
39
- };
40
- string json = JsonUtils.DictionaryToJson(buildInfo, false, false);
41
- Task.Run(()=>SendDataToAirTable(json));
42
- }
43
-
44
- private static async Task SendDataToAirTable(string payload)
45
- {
46
- Debug.Log("AmaGDK | [SDKVersionTracking]: SendDataToAirTable ");
47
- try
48
- {
49
- var client = new HttpClient();
50
- var request = new HttpRequestMessage(HttpMethod.Post, URL);
51
- request.Headers.Add("Authorization", AUTH_TOKEN);
52
- request.Content = new StringContent(payload, Encoding.UTF8, "application/json");
53
-
54
- var response = await client.SendAsync(request);
55
- if (response.IsSuccessStatusCode)
56
- {
57
- string responseData = await response.Content.ReadAsStringAsync();
58
- Debug.Log("AmaGDK | [SDKVersionTracking]: done " + responseData);
59
- }
60
- else
61
- {
62
- Debug.LogError("AmaGDK | [SDKVersionTracking] Error: " + response.StatusCode);
63
- string errorData = await response.Content.ReadAsStringAsync();
64
- Debug.LogError("AmaGDK | [SDKVersionTracking] Error Response: " + errorData);
65
- }
66
- }
67
- catch (HttpRequestException e)
68
- {
69
- Debug.LogError("AmaGDK | [SDKVersionTracking] Request Exception: " + e.Message);
70
- }
71
- }
72
- }
73
- }
@@ -1,3 +0,0 @@
1
- fileFormatVersion: 2
2
- guid: 53147bd64d3f47109e84b17644c5b1c2
3
- timeCreated: 1718186649