com.amanotes.gdk 0.2.75 → 0.2.77

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 (71) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/Editor/AmaGDKEditor.cs +24 -15
  3. package/Editor/Utils/GDKPackageInstaller.cs +116 -0
  4. package/Editor/Utils/GDKPackageInstaller.cs.meta +11 -0
  5. package/Extra/AmaGDKInstaller.unitypackage +0 -0
  6. package/Extra/AutoEventQC.unitypackage +0 -0
  7. package/{Runtime/GDKAudio/Plugins/iOS.meta → Extra/AutoEventQC.unitypackage.meta} +1 -2
  8. package/Extra/CheckDiskSpace.unitypackage +0 -0
  9. package/Extra/Consent.unitypackage +0 -0
  10. package/Extra/ForceUpdate.unitypackage +0 -0
  11. package/Extra/LegacyGDKUpdateHelper.unitypackage +0 -0
  12. package/Extra/PostProcessor.unitypackage +0 -0
  13. package/Packages/AmaGDKConfig.unitypackage +0 -0
  14. package/Packages/AmaGDKExample.unitypackage +0 -0
  15. package/Packages/AmaGDKTest.unitypackage +0 -0
  16. package/Packages/AppsFlyerAdapter.AdRevenue.AF6.14AndOlder.unitypackage +0 -0
  17. package/Packages/AppsFlyerAdapter.PurchaseConnector.unitypackage +0 -0
  18. package/Packages/AppsFlyerAdapter.unitypackage +0 -0
  19. package/Packages/FirebaseAnalyticsAdapter.unitypackage +0 -0
  20. package/Packages/FirebaseRemoteConfigAdapter.unitypackage +0 -0
  21. package/Packages/IronSourceAdapter.AdQuality.unitypackage +0 -0
  22. package/{Runtime/GDKAudio/Plugins/macOS.meta → Packages/IronSourceAdapter.AdQuality.unitypackage.meta} +1 -2
  23. package/Packages/IronSourceAdapter.unitypackage +0 -0
  24. package/Packages/MaxAdNetworkAdapter.unitypackage +0 -0
  25. package/Packages/RevenueCatAdapter.unitypackage +0 -0
  26. package/Packages/SqliteAnalyticsAdapter.unitypackage +0 -0
  27. package/Runtime/Ad/AdLogic.cs +52 -55
  28. package/Runtime/Ad/AdShowContext.cs +1 -1
  29. package/Runtime/AmaGDK.Analytics.cs +18 -15
  30. package/Runtime/AmaGDK.Consent.cs +3 -8
  31. package/Runtime/AmaGDK.Mono.cs +1 -1
  32. package/Runtime/AmaGDK.RemoteConfig.cs +12 -2
  33. package/Runtime/AmaGDK.UserProfile.cs +31 -23
  34. package/Runtime/AmaGDK.cs +76 -40
  35. package/Runtime/Core/GDKDebug.cs +12 -5
  36. package/Runtime/Core/GDKPrefabPool.cs +571 -0
  37. package/Runtime/Core/GDKPrefabPool.cs.meta +11 -0
  38. package/Runtime/Core/GDKRoutine.cs +48 -2
  39. package/Runtime/Internal/AmaGDK.Internal.cs +1 -1
  40. package/Runtime/UI/ScrollView/Editor/GDKScrollViewEditor.cs +50 -0
  41. package/Runtime/UI/ScrollView/Editor/GDKScrollViewEditor.cs.meta +11 -0
  42. package/Runtime/{GDKAudio/Resources.meta → UI/ScrollView/Editor.meta} +1 -1
  43. package/Runtime/UI/ScrollView/GDKScrollView.cs +702 -0
  44. package/Runtime/UI/ScrollView/GDKScrollView.cs.meta +12 -0
  45. package/Runtime/UI/ScrollView.meta +9 -0
  46. package/Runtime/UI/ScrollableText/GDKScrollableText.cs +68 -0
  47. package/Runtime/UI/ScrollableText/GDKScrollableText.cs.meta +3 -0
  48. package/Runtime/UI/ScrollableText/GDKScrollableText.prefab +806 -0
  49. package/Runtime/UI/ScrollableText/GDKScrollableText.prefab.meta +7 -0
  50. package/Runtime/UI/ScrollableText.meta +3 -0
  51. package/Runtime/{GDKAudio/Plugins.meta → UI.meta} +1 -1
  52. package/Runtime/Utils/GDKUtils.cs +18 -0
  53. package/package.json +1 -1
  54. package/Packages/AppsFlyerAdapter.AdRevenue.unitypackage +0 -0
  55. package/Runtime/GDKAudio/GDKAudio.cs +0 -483
  56. package/Runtime/GDKAudio/GDKAudio.cs.meta +0 -3
  57. package/Runtime/GDKAudio/Plugins/Android/atensor-release.aar +0 -0
  58. package/Runtime/GDKAudio/Plugins/Android/atensor-release.aar.meta +0 -32
  59. package/Runtime/GDKAudio/Plugins/Android.meta +0 -3
  60. package/Runtime/GDKAudio/Plugins/iOS/libatensor.a +0 -0
  61. package/Runtime/GDKAudio/Plugins/iOS/libatensor.a.meta +0 -68
  62. package/Runtime/GDKAudio/Plugins/iOS/libcrypto.a +0 -0
  63. package/Runtime/GDKAudio/Plugins/iOS/libcrypto.a.meta +0 -68
  64. package/Runtime/GDKAudio/Plugins/iOS/libssl.a +0 -0
  65. package/Runtime/GDKAudio/Plugins/iOS/libssl.a.meta +0 -68
  66. package/Runtime/GDKAudio/Plugins/macOS/libatensor.dylib +0 -0
  67. package/Runtime/GDKAudio/Plugins/macOS/libatensor.dylib.meta +0 -81
  68. package/Runtime/GDKAudio/Resources/GDKAudioMixer.mixer +0 -133
  69. package/Runtime/GDKAudio/Resources/GDKAudioMixer.mixer.meta +0 -8
  70. package/Runtime/GDKAudio.meta +0 -3
  71. /package/Packages/{AppsFlyerAdapter.AdRevenue.unitypackage.meta → AppsFlyerAdapter.AdRevenue.AF6.14AndOlder.unitypackage.meta} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,49 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.2.77] - 2024-11-07
4
+ - [Release] 0.2.76
5
+ - [Dev] Remove GDKAudio
6
+ - [Dev] Handle format exception in RemoteConfig
7
+ - [Dev] Handle exception of FetchConfig
8
+ - [Fix] Corrected handling of events after LogImmediately()
9
+ - [Dev] Convert value with invariant culture in Remote Config
10
+ - [Feature] Support AppsFlyer 6.15.x by default
11
+ - [Dev] GameOpsSDK
12
+ - [Dev] Fix bug missing ads callback on iOS
13
+ - [Dev] Add OnAdReady logging
14
+ - [Dev] Add more params to impressionData
15
+ - [CI] Update pipeline
16
+ - [Dev] Rework GDK_Example
17
+ - [Dev] Early validate IDFA, GAId and update pattern of AmaDeviceId
18
+ - [Dev] Add device memory info to gdk_init
19
+ - [Dev] Do not use Dispatcher in Init phase (optimize for performance)
20
+ - [Dev] Reduce calls to DoOnMainThread for start stop GDKRoutine
21
+ - [Dev] Minor clean up
22
+ - [Dev] Add memory profiler
23
+ - [CI] Enable cache
24
+ - [Dev] Add Package Installer
25
+ - [Dev] Add Klavar event alias
26
+ - [CI] Disable CI cache temporarily
27
+ - [Dev] Use Array.Fill instead of loop
28
+ - [Fix] Clear cached audio buffer when not playing
29
+ - Revert "[Dev] Upgrade api level 34 for GDKDev"
30
+ - This reverts commit 6ea19dec18c3f2cb0a8000ae746bc58f0b3f3dc2.
31
+ - [Dev] Decouple IronSource AdQuality
32
+ - [Dev] Upgrade api level 34 for GDKDev
33
+ - [Dev] Improve GDKConfig
34
+ - [Dev] Upload test result as artifact
35
+ - [Dev] Add default-manifest for integration test project
36
+ - [CI] Enhance error handling in integration_test.sh
37
+ - [CI] update export-android job to wait for export-ios completion
38
+ - [Dev] Activate Unity license once during integration tests
39
+ - [Dev] Export Packages
40
+ - [Dev] Add AutoEventQC extra package
41
+ - [Dev] Integration test
42
+ - [Dev] Show consent config on Inspector
43
+ - [Dev] Ignore LevelPlay to keep the hard link locally
44
+
45
+ ## [0.2.76] - 2024-11-07
46
+
3
47
  ## [0.2.75] - 2024-09-20
4
48
  - [Dev] Use GDKUtils.StartCoroutine to capture exceptions
5
49
  - [Fix] Initialize modules lazily to fix AmaGDK serialization layout mismatch
@@ -1,4 +1,4 @@
1
- using System;
1
+ using System;
2
2
  using System.Collections.Generic;
3
3
  using System.IO;
4
4
  using System.Linq;
@@ -24,11 +24,11 @@ namespace Amanotes.Editor
24
24
  private static readonly Color ORANGE = new Color32(0xFF, 0xC0, 0x00, 0xFF);
25
25
 
26
26
  [NonSerialized] private static AmaGDK sdk;
27
- [NonSerialized] private static ConfigAsset configAsset;
28
27
  [NonSerialized] private static UnityObject invalidConfigAsset;
29
28
  [NonSerialized] private static SerializedObject configSO;
30
29
  [NonSerialized] private static UnityEditor.Editor editor;
31
30
 
31
+ private static ConfigAsset configAsset => AmaGDK.Config;
32
32
  private static bool showIRSAdapter;
33
33
  private static bool showConfigDetail;
34
34
  private static bool showAdapterInstaller;
@@ -62,7 +62,7 @@ namespace Amanotes.Editor
62
62
 
63
63
  SDKStatus.ClearCache();
64
64
  RefreshConfigStatus();
65
- RefreshListAdapters();
65
+ RefreshListAdapters();
66
66
  }
67
67
 
68
68
  internal enum ConfigAssetStatus
@@ -92,7 +92,6 @@ namespace Amanotes.Editor
92
92
  return;
93
93
  }
94
94
 
95
- configAsset = Resources.Load<ConfigAsset>("AmaGDKConfig");
96
95
  cfgStatus = configAsset != null ? ConfigAssetStatus.AssetOk : ConfigAssetStatus.AssetIsInvalid;
97
96
  if (cfgStatus == ConfigAssetStatus.AssetOk) adapterScanned = false;
98
97
  }
@@ -277,12 +276,7 @@ namespace Amanotes.Editor
277
276
  {
278
277
  if (AmaGUI.BigButton("CREATE", 40f, BLUE))
279
278
  {
280
- ScriptableObject config = CreateInstance("Amanotes.Core.AmaGDKConfigAsset");
281
- var resourcePath = "Assets/AmaGDK/Resources";
282
- Directory.CreateDirectory(resourcePath);
283
-
284
- AssetDatabase.CreateAsset(config, Path.Combine(resourcePath, "AmaGDKConfig.asset"));
285
- AssetDatabase.SaveAssets();
279
+ CreateGDKConfig();
286
280
  RefreshConfigStatus();
287
281
  }
288
282
 
@@ -308,6 +302,16 @@ namespace Amanotes.Editor
308
302
  GUILayout.ExpandWidth(true));
309
303
  }
310
304
 
305
+ internal static void CreateGDKConfig()
306
+ {
307
+ ScriptableObject config = CreateInstance("Amanotes.Core.AmaGDKConfigAsset");
308
+ var resourcePath = "Assets/AmaGDK/Resources";
309
+ Directory.CreateDirectory(resourcePath);
310
+
311
+ AssetDatabase.CreateAsset(config, Path.Combine(resourcePath, "AmaGDKConfig.asset"));
312
+ AssetDatabase.SaveAssets();
313
+ }
314
+
311
315
  public override void OnInspectorGUI()
312
316
  {
313
317
  Profiler.BeginSample("GDKEditor.OnInspectorGUI()");
@@ -359,6 +363,7 @@ namespace Amanotes.Editor
359
363
  DrawProperty(configSO, "enableAudioModule", false);
360
364
  DrawProperty(configSO, "enableServerTime", false);
361
365
  DrawProperty(configSO, "enableGeoLocation", false);
366
+ DrawProperty(configSO, "autoGetConsent", false);
362
367
  GUILayout.Space(8f);
363
368
 
364
369
  for (var i = 0; i < allAdapters.Count; i++)
@@ -378,6 +383,13 @@ namespace Amanotes.Editor
378
383
  GDKAutoUpdateAdapter.ImportAdapters();
379
384
  }
380
385
 
386
+ // Always apply changes to the config asset, but only save to disk if not in play mode
387
+ if (configSO.ApplyModifiedProperties() && !Application.isPlaying)
388
+ {
389
+ EditorUtility.SetDirty(configAsset);
390
+ AssetDatabase.SaveAssets();
391
+ }
392
+
381
393
  Profiler.EndSample();
382
394
  }
383
395
 
@@ -553,7 +565,6 @@ namespace Amanotes.Editor
553
565
  if (adapter is RemoteConfigAdapter) EditorGUILayout.PropertyField(configSO.FindProperty("remoteConfig"), new GUIContent("Shared settings for Remote Config Modules"));
554
566
  GUI.contentColor = c;
555
567
  }
556
- configSO.ApplyModifiedProperties();
557
568
  }
558
569
  EditorGUIUtility.labelWidth -= 70;
559
570
  EditorGUI.EndDisabledGroup();
@@ -578,11 +589,9 @@ namespace Amanotes.Editor
578
589
  while (property.NextVisible(first))
579
590
  {
580
591
  first = false;
581
- if (!property.propertyPath.Contains(basePath)) break;
582
- EditorGUILayout.PropertyField(property);
592
+ if (!property.propertyPath.Contains(basePath)) break;
593
+ EditorGUILayout.PropertyField(property);
583
594
  }
584
-
585
- so.ApplyModifiedProperties();
586
595
  }
587
596
 
588
597
  private static Adapter2 GetAdapter(string id)
@@ -0,0 +1,116 @@
1
+ using System;
2
+ using System.IO;
3
+ using System.Linq;
4
+ using System.Text.RegularExpressions;
5
+ using Amanotes.Core;
6
+ using UnityEditor;
7
+ using UnityEditor.PackageManager;
8
+ using UnityEditor.PackageManager.Requests;
9
+ using UnityEngine;
10
+
11
+ namespace Amanotes.Editor
12
+ {
13
+ [System.Serializable]
14
+ internal class ScopedRegistry
15
+ {
16
+ public string name;
17
+ public string url;
18
+ public string[] scopes;
19
+ }
20
+
21
+ [System.Serializable]
22
+ internal class ScopedRegistries
23
+ {
24
+ public ScopedRegistry[] scopedRegistries;
25
+ }
26
+
27
+ internal class GDKPackageInstaller
28
+ {
29
+ private static AddRequest _addRequest;
30
+ private static Action _onAddRequestCompleted;
31
+
32
+ internal static void AddScope(string name, string url, string[] scopes)
33
+ {
34
+ try
35
+ {
36
+ const string manifestPath = "Packages/manifest.json";
37
+ var manifestJson = File.ReadAllText(manifestPath);
38
+
39
+ var registries = JsonUtility.FromJson<ScopedRegistries>(manifestJson);
40
+ var scopedRegistry = registries.scopedRegistries;
41
+
42
+ if (scopedRegistry != null)
43
+ {
44
+ if(IsScopesExist(scopes, scopedRegistry))
45
+ return;
46
+ Array.Resize(ref registries.scopedRegistries, scopedRegistry.Length + 1);
47
+ }
48
+ else
49
+ {
50
+ registries.scopedRegistries = new ScopedRegistry[1];
51
+ }
52
+
53
+ registries.scopedRegistries[registries.scopedRegistries.Length - 1] = new ScopedRegistry
54
+ {
55
+ name = name,
56
+ scopes = scopes,
57
+ url = url
58
+ };
59
+
60
+ const string pattern = "\"dependencies\"\\s*:\\s*\\{(.+?)\\}";
61
+ Match match = Regex.Match(manifestJson, pattern, RegexOptions.Singleline);
62
+ manifestJson = "{" + $"{match.Value},{JsonUtility.ToJson(registries).Remove(0, 1)}";
63
+ File.WriteAllText(manifestPath, manifestJson);
64
+
65
+ // Double check
66
+ manifestJson = File.ReadAllText(manifestPath);
67
+ registries = JsonUtility.FromJson<ScopedRegistries>(manifestJson);
68
+ scopedRegistry = registries.scopedRegistries;
69
+
70
+ if (scopedRegistry == null || IsScopesExist(scopes, scopedRegistry) == false)
71
+ {
72
+ Debug.LogWarning("Failed to add new scopes to the manifest");
73
+ return;
74
+ }
75
+ AssetDatabase.Refresh(ImportAssetOptions.ForceUpdate);
76
+ Client.Resolve();
77
+ Debug.Log("Successfully add new scopes to the manifest");
78
+ }
79
+ catch (IOException e)
80
+ {
81
+ Debug.LogWarning($"Failed to add new scopes to the manifest : {e}");
82
+ }
83
+ }
84
+
85
+ private static bool IsScopesExist(string[] scopes, ScopedRegistry[] scopedRegistries)
86
+ {
87
+ return scopes.All(scopeToCheck => scopedRegistries
88
+ .SelectMany(registry => registry.scopes)
89
+ .Any(scope => scope.ToString() == scopeToCheck));
90
+ }
91
+
92
+ internal static void InstallPackage(string package, Action callback)
93
+ {
94
+ EditorApplication.update -= AddPackageProgress;
95
+ EditorApplication.update += AddPackageProgress;
96
+ _addRequest = Client.Add(package);
97
+ _onAddRequestCompleted = callback;
98
+ }
99
+
100
+ private static void AddPackageProgress()
101
+ {
102
+ if (_addRequest == null || _addRequest.IsCompleted == false)
103
+ return;
104
+ if (_addRequest.Status == StatusCode.Success)
105
+ {
106
+ EditorApplication.update -= AddPackageProgress;
107
+ _onAddRequestCompleted?.Invoke();
108
+ }
109
+ else if (_addRequest.Status == StatusCode.Failure)
110
+ {
111
+ Debug.LogWarning("Fail to add new package");
112
+ }
113
+ _addRequest = null;
114
+ }
115
+ }
116
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 53696434971b84be1952094cf8394336
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
Binary file
Binary file
@@ -1,6 +1,5 @@
1
1
  fileFormatVersion: 2
2
- guid: 4dd306252a3244a37808570f9979dfbd
3
- folderAsset: yes
2
+ guid: 01e544bb41adc44a7a1b8b41cb7b63eb
4
3
  DefaultImporter:
5
4
  externalObjects: {}
6
5
  userData:
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -1,6 +1,5 @@
1
1
  fileFormatVersion: 2
2
- guid: 3fd1ceb1d6c8d43379e780718f6f38f5
3
- folderAsset: yes
2
+ guid: fbd8abe022fe742a1a1fa38c740ce072
4
3
  DefaultImporter:
5
4
  externalObjects: {}
6
5
  userData:
@@ -1,3 +1,4 @@
1
+ using System;
1
2
  using System.Collections;
2
3
  using UnityEngine;
3
4
  using static Amanotes.Core.GDKDebug;
@@ -131,17 +132,8 @@ namespace Amanotes.Core.Internal
131
132
  protected bool _isRequesting;
132
133
  protected bool _isInterstitial => adType == AdType.Interstitial;
133
134
 
134
- // Do not warn unused variable, it's been use outside of Editor (Runtime)
135
- #pragma warning disable
136
- private bool isFocus;
137
- #pragma warning enable
138
-
139
135
  public void StartShowAd()
140
136
  {
141
- isFocus = false;
142
- unityCallbacks.OnApplicationFocus -= OnApplicationFocus;
143
- unityCallbacks.OnApplicationFocus += OnApplicationFocus;
144
-
145
137
  if (_showState != ShowAdsState.None)
146
138
  {
147
139
  LogWarning("[Ad] StartShowAd() --> Invalid _showState: " + _showState);
@@ -163,14 +155,6 @@ namespace Amanotes.Core.Internal
163
155
  _showAdRoutine = GDKUtils.StartCoroutine(ShowAdRoutine());
164
156
  }
165
157
 
166
- private void OnApplicationFocus(bool focus)
167
- {
168
- if (!focus) return;
169
-
170
- unityCallbacks.OnApplicationFocus -= OnApplicationFocus;
171
- isFocus = true;
172
- }
173
-
174
158
  public void StopShowAd()
175
159
  {
176
160
  Log($"[Ad] {adType} StopShowAd");
@@ -238,14 +222,59 @@ namespace Amanotes.Core.Internal
238
222
  _showState = ShowAdsState.Showing;
239
223
  OnAdShowReadyStatus(true, AdShowReadyStatus.Ready);
240
224
  TriggerBeforeAdShow();
225
+ #if !UNITY_EDITOR && UNITY_ANDROID
226
+ GDKUtils.StartCoroutine(HandleAdActivityKilledSilently());
227
+ #endif
241
228
  ShowAd();
242
-
243
229
  yield return WaitForMediationCallback();
244
-
245
- // wait 1 frame in case hasReward callback after onClose
246
- if (!context.hasReward && adType == AdType.VideoReward && !context.hasFailedOrCancelled) yield return null;
247
230
  ShowAdRoutineCompleted(context.isSuccess);
248
231
  }
232
+
233
+ private IEnumerator WaitForMediationCallback()
234
+ {
235
+ while (context != null && !context.potentiallyCompleted)
236
+ {
237
+ yield return null;
238
+ }
239
+ // wait 1 frame in case hasReward callback after onClose
240
+ if (context != null && !context.hasReward && adType == AdType.VideoReward && !context.hasFailedOrCancelled) yield return null;
241
+ }
242
+
243
+ private IEnumerator HandleAdActivityKilledSilently()
244
+ {
245
+ bool hasOutOfFocus = false;
246
+ bool hasFocusAgain = false;
247
+ Action<bool> onApplicationFocusCallback = focus =>
248
+ {
249
+ if (focus)
250
+ {
251
+ hasFocusAgain = true;
252
+ }
253
+ else
254
+ {
255
+ hasOutOfFocus = true;
256
+ }
257
+ };
258
+ unityCallbacks.OnApplicationFocus += onApplicationFocusCallback;
259
+ int counter = 0;
260
+ while (context != null && !context.potentiallyCompleted)
261
+ {
262
+ if (hasFocusAgain && hasOutOfFocus)
263
+ {
264
+ // Start counting frames only after closed the ad
265
+ counter++;
266
+ }
267
+ if (counter > MAX_FRAMES_WAIT_FOR_CALLBACK)
268
+ {
269
+ // Timeout reached, force close the ad
270
+ LogError("Force close the ad");
271
+ StopShowAd();
272
+ break;
273
+ }
274
+ yield return null;
275
+ }
276
+ unityCallbacks.OnApplicationFocus -= onApplicationFocusCallback;
277
+ }
249
278
 
250
279
  private void EndShowAdRoutineWithFailure(AdShowReadyStatus status)
251
280
  {
@@ -280,40 +309,8 @@ namespace Amanotes.Core.Internal
280
309
  Log("[Ad] WaitForAd success after " + counter + " | timeout = " + timeout + " secs");
281
310
  break;
282
311
  }
283
- }
284
-
285
- private IEnumerator WaitForMediationCallback()
286
- {
287
- #if UNITY_EDITOR
288
- while (!context.hasClosed) yield return null;
289
- yield break;
290
- #endif
291
- while (!isFocus) yield return null;
292
- var wait4CallbackCounter = 0;
293
- while (!context.potentiallyCompleted && wait4CallbackCounter <= MAX_FRAMES_WAIT_FOR_CALLBACK)
294
- {
295
- wait4CallbackCounter++;
296
- yield return null;
297
- }
298
- Log($"[Ad] Waiting for potentially completed callback: {wait4CallbackCounter} frames");
299
-
300
- if (!context.hasClosed) yield return WaitForAdClosedCallback();
301
- }
302
-
303
- private IEnumerator WaitForAdClosedCallback()
304
- {
305
- int counter = 0;
306
- while (!context.hasClosed && counter <= MAX_FRAMES_WAIT_FOR_CALLBACK)
307
- {
308
- counter++;
309
- yield return null;
310
- }
311
- Log($"[Ad] Waiting for ad closed callback: {counter} frames");
312
- if (context.hasClosed) yield break;
313
- LogWarning("[Ad] Force close ad (mediation missing OnAdClose callback)");
314
- OnAdClosed();
315
- }
316
-
312
+ }
313
+
317
314
  private void ShowAdRoutineCompleted(bool isSuccess)
318
315
  {
319
316
  if (_loadState == LoadAdsState.Ready)
@@ -35,7 +35,7 @@ namespace Amanotes.Core.Internal
35
35
  }
36
36
 
37
37
  public bool hasFailedOrCancelled => (adCallback & (AdCallback.Fail | AdCallback.Cancel)) != 0;
38
- public bool potentiallyCompleted => (adCallback & (AdCallback.Close | AdCallback.Fail | AdCallback.Reward | AdCallback.Cancel)) != 0;
38
+ public bool potentiallyCompleted => (adCallback & (AdCallback.Close | AdCallback.Fail | AdCallback.Cancel)) != 0;
39
39
  public bool hasReward => (adCallback & AdCallback.Reward) != 0;
40
40
  public bool hasClosed => (adCallback & AdCallback.Close) != 0;
41
41
  public bool hasClicked => (adCallback & AdCallback.Click) != 0;
@@ -197,6 +197,7 @@ namespace Amanotes.Core
197
197
  var flag = IntegrityFlag.Ok;
198
198
 
199
199
  if (funnelEvents != null)
200
+ {
200
201
  foreach (string e in funnelEvents)
201
202
  {
202
203
  if (localData.funnelSignatures.Contains(e)) continue;
@@ -204,6 +205,7 @@ namespace Amanotes.Core
204
205
  flag |= IntegrityFlag.NewFunnel;
205
206
  localData.AddFunnelSignature(e);
206
207
  }
208
+ }
207
209
 
208
210
  if (eventCountMap != null)
209
211
  {
@@ -416,7 +418,11 @@ namespace Amanotes.Core
416
418
 
417
419
  while (eventQueue.TryDequeue(out var eventData))
418
420
  {
419
- if (eventData.isLoggedImmediately) continue;
421
+ if (eventData.isLoggedImmediately)
422
+ {
423
+ epPool.Return(eventData);
424
+ continue;
425
+ }
420
426
  if (Config.analytics.immediatelyLoggedEvents.Contains(eventData.eventName)){
421
427
  GDKUtils.ThrowExceptionIfEditor($"This event '{eventData.eventName}' must be sent immediately by AmaGDK.Analytics.LogEvent(eventName).LogImmediately()");
422
428
  }
@@ -477,7 +483,6 @@ namespace Amanotes.Core
477
483
  internal static void LogEventImmediately(EventParams eventParams)
478
484
  {
479
485
  LogEventActually(eventParams);
480
- epPool.Return(eventParams);
481
486
  sessionStat?.Save();
482
487
  localData.SaveIfDirty();
483
488
  }
@@ -485,25 +490,23 @@ namespace Amanotes.Core
485
490
  internal static void UpdateAccumulatedCount(EventParams eventData, int countInSession, ref int totalCount)
486
491
  {
487
492
  var ACCUMULATED_COUNT = "accumulated_count";
488
- var countByGDK = eventData.withinSession ? countInSession : totalCount;
489
-
490
- if (!eventData.parameters.ContainsKey(ACCUMULATED_COUNT))
493
+ int countByGDK = eventData.withinSession ? countInSession : totalCount;
494
+ if (!eventData.parameters.TryGetValue(ACCUMULATED_COUNT, out object countByGame))
491
495
  {
492
496
  eventData.AddParam(ACCUMULATED_COUNT, countByGDK);
493
497
  return;
494
498
  }
495
499
 
496
- int.TryParse(eventData.parameters[ACCUMULATED_COUNT].ToString(), out int oriAccCount);
497
- if (oriAccCount != countByGDK)
500
+ int.TryParse(countByGame.ToString(), out int oriAccCount);
501
+ if (oriAccCount == countByGDK) return;
502
+
503
+ // Log($"[Analytics] event <{eventData.eventName}>, game count: {oriAccCount}, AmaGDK count: {countByGDK}");
504
+ if (Config.analytics.migrateAccumulatedCount && !eventData.withinSession)
498
505
  {
499
- // Log($"[Analytics] event <{eventData.eventName}>, game count: {oriAccCount}, AmaGDK count: {countByGDK}");
500
- if (Config.analytics.migrateAccumulatedCount && !eventData.withinSession)
501
- {
502
- Log($"[Analytics] Update event count of event <{eventData.eventName}> from {countByGDK} to {oriAccCount}");
503
- eventData.detail.totalCount = oriAccCount;
504
- totalCount = oriAccCount;
505
- localData._dirty = true;
506
- }
506
+ Log($"[Analytics] Update event count of event <{eventData.eventName}> from {countByGDK} to {oriAccCount}");
507
+ eventData.detail.totalCount = oriAccCount;
508
+ totalCount = oriAccCount;
509
+ localData._dirty = true;
507
510
  }
508
511
  }
509
512
 
@@ -143,7 +143,7 @@ namespace Amanotes.Core
143
143
  internal static bool InitModule()
144
144
  {
145
145
  if (allConsentChecked) return true;
146
- if (!_config.consent.autoGetConsent) return true;
146
+ if (!_config.autoGetConsent) return true;
147
147
  RequestAllConsents(null);
148
148
  return true;
149
149
  }
@@ -247,15 +247,10 @@ namespace Amanotes.Core
247
247
 
248
248
  namespace Amanotes.Core.Internal
249
249
  {
250
- [Serializable]
251
- public class ConsentConfig
250
+ public partial class ConfigAsset
252
251
  {
252
+ [SerializeField]
253
253
  [Tooltip("Auto pop-up ATT and CMP form")]
254
254
  public bool autoGetConsent = true;
255
255
  }
256
-
257
- public partial class ConfigAsset
258
- {
259
- [SerializeField] public ConsentConfig consent;
260
- }
261
256
  }
@@ -76,7 +76,7 @@ namespace Amanotes.Core.Internal
76
76
 
77
77
  public static void DelayCall(float seconds, Action action)
78
78
  {
79
- DoOnMainThread(() => StartCoroutine(DelayCallRoutine(seconds, action)));
79
+ StartCoroutine(DelayCallRoutine(seconds, action));
80
80
  }
81
81
 
82
82
  public static IEnumerator Timeout(float timeoutInSecs, Func<bool> completeCheckFunc)
@@ -1,5 +1,6 @@
1
1
  using System;
2
2
  using System.Collections.Generic;
3
+ using System.Globalization;
3
4
  using System.IO;
4
5
  using System.Text;
5
6
  using UnityEngine;
@@ -76,11 +77,20 @@ namespace Amanotes.Core
76
77
  {
77
78
  foreach (var c in embed.overrideConfig)
78
79
  if (c.key == key)
79
- return (T)Convert.ChangeType(c.value, typeof(T));
80
+ return (T)Convert.ChangeType(c.value, typeof(T), CultureInfo.InvariantCulture);
80
81
  }
81
82
  #endif
82
83
  if (DictConfig.ContainsKey(key))
83
- return (T)Convert.ChangeType(DictConfig[key], typeof(T));
84
+ {
85
+ try
86
+ {
87
+ return (T)Convert.ChangeType(DictConfig[key], typeof(T), CultureInfo.InvariantCulture);
88
+ }
89
+ catch (Exception e)
90
+ {
91
+ LogError($"[RemoteConfig] Convert failed with key: '{key}', value: '{DictConfig[key]}'.\nError: {e}");
92
+ }
93
+ }
84
94
  return defaultValue;
85
95
  }
86
96