com.amanotes.gdk 0.2.89 → 0.2.90
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 +1 -1
- package/Extra/AmaGDKInstaller.unitypackage +0 -0
- package/Extra/AutoEventQC.unitypackage +0 -0
- package/Extra/CheckDiskSpace.unitypackage +0 -0
- package/Extra/Consent.unitypackage +0 -0
- package/Extra/CrashlyticHook.unitypackage +0 -0
- package/Extra/ForceUpdate.unitypackage +0 -0
- package/Extra/LegacyGDKUpdateHelper.unitypackage +0 -0
- package/Extra/PostProcessor.unitypackage +0 -0
- package/Packages/AmaGDKConfig.unitypackage +0 -0
- package/Packages/AmaGDKExample.unitypackage +0 -0
- package/Packages/AmaGDKTest.unitypackage +0 -0
- package/Packages/AppsFlyerAdapter.PurchaseConnector.unitypackage +0 -0
- package/Packages/AppsFlyerAdapter.unitypackage +0 -0
- package/Packages/FirebaseAnalyticsAdapter.unitypackage +0 -0
- package/Packages/FirebaseRemoteConfigAdapter.unitypackage +0 -0
- package/Packages/IronSourceAdapter.unitypackage +0 -0
- package/Packages/MaxAdNetworkAdapter.unitypackage +0 -0
- package/Packages/RevenueCatAdapter.unitypackage +0 -0
- package/Packages/SqliteAnalyticsAdapter.unitypackage +0 -0
- package/Runtime/AmaGDK.cs +1 -1
- package/Runtime/Internal/AmaGDK.WebUtils.cs +22 -23
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/Runtime/AmaGDK.cs
CHANGED
|
@@ -27,7 +27,7 @@ namespace Amanotes.Core
|
|
|
27
27
|
{
|
|
28
28
|
public partial class AmaGDK : MonoBehaviour
|
|
29
29
|
{
|
|
30
|
-
public const string VERSION = "0.2.
|
|
30
|
+
public const string VERSION = "0.2.90";
|
|
31
31
|
|
|
32
32
|
internal static Status _status = Status.None;
|
|
33
33
|
internal static ConfigAsset _config = null;
|
|
@@ -37,12 +37,20 @@ namespace Amanotes.Core.Internal
|
|
|
37
37
|
byte[] bodyRaw = Encoding.UTF8.GetBytes(requestJson);
|
|
38
38
|
uploadHandler = new UploadHandlerRaw(bodyRaw);
|
|
39
39
|
downloadHandler = new DownloadHandlerBuffer();
|
|
40
|
-
SetRequestHeader(
|
|
41
|
-
|
|
42
|
-
{
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
40
|
+
SetRequestHeader(
|
|
41
|
+
new Dictionary<string, string>
|
|
42
|
+
{
|
|
43
|
+
{
|
|
44
|
+
"Authorization", $"bearer {requestHeader}"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"Content-Type", "application/json"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"api-token", requestHeader
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
);
|
|
46
54
|
yield return SendWebRequest();
|
|
47
55
|
|
|
48
56
|
if (!string.IsNullOrEmpty(error))
|
|
@@ -101,7 +109,7 @@ namespace Amanotes.Core.Internal
|
|
|
101
109
|
{
|
|
102
110
|
return GDKUtils.StartCoroutine(PostJsonCoroutine(url, jsonData, onComplete, headers));
|
|
103
111
|
}
|
|
104
|
-
|
|
112
|
+
|
|
105
113
|
private static IEnumerator PostJsonCoroutine(string url, string jsonData,
|
|
106
114
|
Action<bool, string> onComplete = null, Dictionary<string, string> headers = null)
|
|
107
115
|
{
|
|
@@ -136,26 +144,17 @@ namespace Amanotes.Core.Internal
|
|
|
136
144
|
|
|
137
145
|
public static IEnumerator CheckInternet(Action<bool> hasInternet)
|
|
138
146
|
{
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
www.timeout = 10; // Set a reasonable timeout
|
|
143
|
-
yield return www.SendWebRequest();
|
|
147
|
+
UnityWebRequest www = UnityWebRequest.Get(AmaGDK.Config.common.internetCheckUrl);
|
|
148
|
+
www.timeout = 10; // Set a reasonable timeout
|
|
149
|
+
yield return www.SendWebRequest();
|
|
144
150
|
|
|
145
|
-
|
|
146
|
-
{
|
|
147
|
-
hasInternet?.Invoke(false);
|
|
148
|
-
yield break;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
hasInternet?.Invoke(true);
|
|
152
|
-
}
|
|
153
|
-
catch (System.Exception ex)
|
|
151
|
+
if (www.result != UnityWebRequest.Result.Success && www.responseCode != 429) //429 = Too many requests
|
|
154
152
|
{
|
|
155
|
-
// Log the exception but assume no internet connection
|
|
156
|
-
LogWarning($"Internet check failed with exception: {ex.Message}");
|
|
157
153
|
hasInternet?.Invoke(false);
|
|
154
|
+
yield break;
|
|
158
155
|
}
|
|
156
|
+
|
|
157
|
+
hasInternet?.Invoke(true);
|
|
159
158
|
}
|
|
160
159
|
}
|
|
161
160
|
|