com.amanotes.gdk 0.2.70 → 0.2.72
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 +113 -87
- package/Editor/AmaGDKEditor.cs +1 -1
- package/Editor/EmbedRemoteConfigAssetInspector.cs +1 -1
- package/Editor/Extra/GDKCIBuildCommand.cs +57 -16
- package/Extra/AmaGDKInstaller.unitypackage +0 -0
- package/Extra/CheckDiskSpace.unitypackage +0 -0
- package/Extra/Consent.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/Ad/AdExtension.cs +2 -1
- package/Runtime/Ad/AdLogic.cs +1 -1
- package/Runtime/Ad/AdModuleConfig.cs +19 -4
- package/Runtime/Ad/AmaGDK.Ads.cs +20 -8
- package/Runtime/AmaGDK.Adapters.cs +1 -1
- package/Runtime/AmaGDK.Analytics.cs +37 -35
- package/Runtime/AmaGDK.Config.cs +1 -7
- package/Runtime/AmaGDK.Consent.cs +9 -8
- package/Runtime/AmaGDK.Context.cs +1 -1
- package/Runtime/AmaGDK.Device.cs +2 -1
- package/Runtime/AmaGDK.IAP.cs +1 -1
- package/Runtime/AmaGDK.RemoteConfig.cs +1 -1
- package/Runtime/AmaGDK.Singleton.cs +1 -1
- package/Runtime/AmaGDK.UserProfile.cs +12 -11
- package/Runtime/AmaGDK.asmdef +1 -1
- package/Runtime/AmaGDK.cs +6 -6
- package/Runtime/AnalyticQualityAsset.cs +1 -1
- package/Runtime/AudioToolkit/AmaGDK.Audio.cs +3 -2
- package/Runtime/Core/GDKDebug.cs +97 -0
- package/Runtime/Core/GDKDebug.cs.meta +3 -0
- package/Runtime/Core/GDKPool.cs +1 -0
- package/Runtime/Core/GDKRoutine.cs +3 -1
- package/Runtime/Core/GDKSemVer.cs +1 -1
- package/Runtime/Core/GDKString.cs +197 -0
- package/Runtime/Core/GDKString.cs.meta +3 -0
- package/Runtime/EmbedRemoteConfigAsset.cs +2 -1
- package/Runtime/Fps/AmaFPS.Utils.cs +2 -2
- package/Runtime/Fps/AmaFPS.cs +1 -1
- package/Runtime/Fps/AmaFPSVisualizer.cs +1 -1
- package/Runtime/Fps/FrameRecorder.cs +1 -1
- package/Runtime/GDKAudio/GDKAudio.cs +308 -0
- package/Runtime/GDKAudio/GDKAudio.cs.meta +3 -0
- package/Runtime/GDKAudio/Plugins/Android/atensor-release.aar +0 -0
- package/Runtime/GDKAudio/Plugins/Android/atensor-release.aar.meta +32 -0
- package/Runtime/GDKAudio/Plugins/Android.meta +3 -0
- package/Runtime/GDKAudio/Plugins/iOS/libatensor.a +0 -0
- package/Runtime/GDKAudio/Plugins/iOS/libatensor.a.meta +68 -0
- package/Runtime/GDKAudio/Plugins/iOS/libcrypto.a +0 -0
- package/Runtime/GDKAudio/Plugins/iOS/libcrypto.a.meta +68 -0
- package/Runtime/GDKAudio/Plugins/iOS/libssl.a +0 -0
- package/Runtime/GDKAudio/Plugins/iOS/libssl.a.meta +68 -0
- package/Runtime/GDKAudio/Plugins/iOS.meta +8 -0
- package/Runtime/GDKAudio/Plugins/macOS/libatensor.dylib +0 -0
- package/Runtime/GDKAudio/Plugins/macOS/libatensor.dylib.meta +81 -0
- package/Runtime/GDKAudio/Plugins/macOS.meta +8 -0
- package/Runtime/GDKAudio/Plugins.meta +8 -0
- package/Runtime/GDKAudio.meta +3 -0
- package/Runtime/Internal/AmaGDK.Internal.cs +22 -33
- package/Runtime/Internal/AmaGDK.Utils.cs +1 -1
- package/Runtime/Internal/AmaGDK.WebUtils.cs +1 -1
- package/Runtime/Internal/ForceQuitMonitor.cs +7 -2
- package/Runtime/Internal/GDKGeoLocationcs.cs +2 -1
- package/Runtime/Internal/GDKServerTime.cs +2 -1
- package/Runtime/Klavar/KlavarContainer.cs +4 -4
- package/Runtime/UserProfile/Plugins/Android/AdvertisingIdFetcher.cs +1 -1
- package/Runtime/Utils/GDKUtils.cs +35 -4
- package/package.json +1 -1
|
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
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
using Amanotes.Core.Internal;
|
|
2
2
|
using System;
|
|
3
|
+
using static Amanotes.Core.GDKDebug;
|
|
3
4
|
namespace Amanotes.Core
|
|
4
5
|
{
|
|
5
6
|
public static class AdExtension
|
|
@@ -105,7 +106,7 @@ namespace Amanotes.Core
|
|
|
105
106
|
bool isValid = (ad != null);
|
|
106
107
|
if (!isValid)
|
|
107
108
|
{
|
|
108
|
-
|
|
109
|
+
LogWarning("Something wrong:: no AdShowContext");
|
|
109
110
|
}
|
|
110
111
|
return isValid;
|
|
111
112
|
}
|
package/Runtime/Ad/AdLogic.cs
CHANGED
|
@@ -1,8 +1,20 @@
|
|
|
1
|
-
using System;
|
|
1
|
+
using System;
|
|
2
2
|
using UnityEngine;
|
|
3
3
|
|
|
4
4
|
namespace Amanotes.Core.Internal
|
|
5
5
|
{
|
|
6
|
+
[Serializable] public class AdCapping
|
|
7
|
+
{
|
|
8
|
+
[Tooltip("Capping time (in seconds, default = 0s) since App Open.")]
|
|
9
|
+
public float sinceAppOpen = 0;
|
|
10
|
+
|
|
11
|
+
[Tooltip("Capping time (in seconds, default = 15s) calculated since last interstitial closed.")]
|
|
12
|
+
public float sinceLastInterstitial = 15;
|
|
13
|
+
|
|
14
|
+
[Tooltip("Capping time (in seconds, default = 10s) calculated since last video reward closed.")]
|
|
15
|
+
public float sinceLastVideoReward = 10;
|
|
16
|
+
}
|
|
17
|
+
|
|
6
18
|
[Serializable] public class AdModuleConfig
|
|
7
19
|
{
|
|
8
20
|
[Tooltip("Automatically retry requesting ad if an ad failed to response in this amount of time (in secs)")]
|
|
@@ -12,11 +24,14 @@ namespace Amanotes.Core.Internal
|
|
|
12
24
|
public int adShowTimeoutInSecs = 5;
|
|
13
25
|
|
|
14
26
|
[Tooltip("When an ad is not ready to show, verify that there is an internet connection by ping the internet check URL .\nIf there is no internet connection, we will not need to wait for adShowTimeout secs")]
|
|
15
|
-
|
|
16
|
-
|
|
27
|
+
public bool checkInternet = true;
|
|
28
|
+
|
|
17
29
|
[NonSerialized] public bool enableInterstitial = true;
|
|
18
30
|
[NonSerialized] public bool enableRewarded = true;
|
|
19
|
-
|
|
31
|
+
[NonSerialized] public bool enableBanner = true;
|
|
32
|
+
|
|
33
|
+
[Tooltip("Capping configuration for Interstitial\n\n - All the conditions below must be satisfied for interstitial to show")]
|
|
34
|
+
public AdCapping interstitialCapping;
|
|
20
35
|
|
|
21
36
|
[Tooltip("Before showing an ad: set AudioListener.volume to 0\nAfter the ad is closed: restore the previously saved AudioListener.volume")]
|
|
22
37
|
public bool autoMute = true;
|
package/Runtime/Ad/AmaGDK.Ads.cs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
using System;
|
|
1
|
+
using System;
|
|
2
2
|
using System.Collections;
|
|
3
3
|
using System.Collections.Generic;
|
|
4
4
|
using UnityEngine;
|
|
5
5
|
using Amanotes.Core.Internal;
|
|
6
6
|
|
|
7
|
-
using static Amanotes.Core.
|
|
7
|
+
using static Amanotes.Core.GDKDebug;
|
|
8
8
|
using static Amanotes.Core.AmaGDK;
|
|
9
9
|
|
|
10
10
|
namespace Amanotes.Core
|
|
@@ -46,7 +46,12 @@ namespace Amanotes.Core
|
|
|
46
46
|
|
|
47
47
|
// persistent
|
|
48
48
|
public int successTotal;
|
|
49
|
-
|
|
49
|
+
public int failedTotal;
|
|
50
|
+
|
|
51
|
+
internal bool IsCapped(float cappingTime)
|
|
52
|
+
{
|
|
53
|
+
return (successTotal > 0) && (Time.realtimeSinceStartup - lastSuccessTime < cappingTime);
|
|
54
|
+
}
|
|
50
55
|
}
|
|
51
56
|
|
|
52
57
|
[Serializable]
|
|
@@ -301,11 +306,18 @@ namespace Amanotes.Core
|
|
|
301
306
|
/// <param name="interstitialCappingTime"></param>
|
|
302
307
|
/// <param name="rewardedVideoCappingTime"></param>
|
|
303
308
|
/// <returns></returns>
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
+
public static bool IsCapped(float? interstitialCappingTime = null, float? rewardedVideoCappingTime = null)
|
|
310
|
+
{
|
|
311
|
+
var config = Config.ad.interstitialCapping;
|
|
312
|
+
|
|
313
|
+
// cap by interstitial
|
|
314
|
+
if (localData.interstitial.IsCapped(interstitialCappingTime ?? config.sinceLastInterstitial)) return true;
|
|
315
|
+
|
|
316
|
+
// cap by rewarded video
|
|
317
|
+
if (localData.reward.IsCapped(rewardedVideoCappingTime ?? config.sinceLastVideoReward)) return true;
|
|
318
|
+
|
|
319
|
+
// cap by app Open
|
|
320
|
+
return Time.realtimeSinceStartup < config.sinceAppOpen;
|
|
309
321
|
}
|
|
310
322
|
|
|
311
323
|
public static int TimeSinceLastInterstitialSucceed => localData.TimeSinceLastShowSuccess(AdType.Interstitial);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
using System;
|
|
1
|
+
using System;
|
|
2
2
|
using System.Collections.Concurrent;
|
|
3
3
|
using System.Collections.Generic;
|
|
4
4
|
using System.Text;
|
|
@@ -6,7 +6,7 @@ using Amanotes.Core.Internal;
|
|
|
6
6
|
using UnityEngine;
|
|
7
7
|
using UnityEngine.Profiling;
|
|
8
8
|
using static Amanotes.Core.AmaGDK.Analytics;
|
|
9
|
-
using static Amanotes.Core.
|
|
9
|
+
using static Amanotes.Core.GDKDebug;
|
|
10
10
|
|
|
11
11
|
namespace Amanotes.Core
|
|
12
12
|
{
|
|
@@ -15,6 +15,8 @@ namespace Amanotes.Core
|
|
|
15
15
|
//PUBLIC APIS
|
|
16
16
|
public static partial class Analytics
|
|
17
17
|
{
|
|
18
|
+
public static event Action<string, Dictionary<string, object>> OnEventSent;
|
|
19
|
+
|
|
18
20
|
public static bool HasMigrated => localData.migrationLog.count > 0;
|
|
19
21
|
|
|
20
22
|
public static bool enableAnalyticsLog
|
|
@@ -412,10 +414,11 @@ namespace Amanotes.Core
|
|
|
412
414
|
while (eventQueue.TryDequeue(out var eventData))
|
|
413
415
|
{
|
|
414
416
|
if (eventData.isLoggedImmediately) continue;
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
417
|
+
if (Config.analytics.immediatelyLoggedEvents.Contains(eventData.eventName)){
|
|
418
|
+
Utils.ThrowExceptionIfEditor($"This event '{eventData.eventName}' must be sent immediately by AmaGDK.Analytics.LogEvent(eventName).LogImmediately()");
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
LogEventActually(eventData);
|
|
419
422
|
epPool.Return(eventData);
|
|
420
423
|
}
|
|
421
424
|
|
|
@@ -424,10 +427,10 @@ namespace Amanotes.Core
|
|
|
424
427
|
Profiler.EndSample();
|
|
425
428
|
}
|
|
426
429
|
|
|
427
|
-
|
|
430
|
+
internal static void LogEventActually(EventParams eventParams)
|
|
428
431
|
{
|
|
429
|
-
|
|
430
|
-
if (!ShouldSendEvent(eventParams)) return
|
|
432
|
+
if (eventParams == null) return;
|
|
433
|
+
if (!ShouldSendEvent(eventParams)) return;
|
|
431
434
|
var (countInSession, totalCount) = localData.IncreaseCounter(eventParams);
|
|
432
435
|
if (eventParams.accumulated || eventParams.parameters.ContainsKey("accumulated_count"))
|
|
433
436
|
{
|
|
@@ -440,11 +443,11 @@ namespace Amanotes.Core
|
|
|
440
443
|
|
|
441
444
|
if (config.showAnalyticsLog)
|
|
442
445
|
{
|
|
443
|
-
|
|
446
|
+
ForceLog($"AmaGDK [Analytics] Event <{eventNameToSend}> (in session: {countInSession}, total: {totalCount})\n{JsonUtils.DictionaryToJson(eventParams.parameters, true)}");
|
|
444
447
|
}
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
+
|
|
449
|
+
config.quality.CheckEventQuality(eventParams.eventName, eventParams.parameters);
|
|
450
|
+
|
|
448
451
|
var inUseAdapterIDs = config.enableEventStat ? new List<string>(listAdapters.Count) : null;
|
|
449
452
|
foreach (AnalyticsAdapter m in listAdapters)
|
|
450
453
|
{
|
|
@@ -463,15 +466,14 @@ namespace Amanotes.Core
|
|
|
463
466
|
m.LogEvent(eventNameToSend, eventParams.parameters);
|
|
464
467
|
inUseAdapterIDs?.Add(m.adapterId);
|
|
465
468
|
}
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
+
|
|
470
|
+
GDKUtils.SafeInvoke(OnEventSent, eventNameToSend, eventParams.parameters);
|
|
471
|
+
sessionStat?.OnEventSent(eventNameToSend, eventParams.parameters, inUseAdapterIDs);
|
|
469
472
|
}
|
|
470
|
-
|
|
473
|
+
|
|
471
474
|
internal static void LogEventImmediately(EventParams eventParams)
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
sessionStat?.Add(eventNameToSend, eventParams, inUseAdapterIDs);
|
|
475
|
+
{
|
|
476
|
+
LogEventActually(eventParams);
|
|
475
477
|
epPool.Return(eventParams);
|
|
476
478
|
sessionStat?.Save();
|
|
477
479
|
localData.SaveIfDirty();
|
|
@@ -688,20 +690,22 @@ namespace Amanotes.Core
|
|
|
688
690
|
}
|
|
689
691
|
|
|
690
692
|
[Serializable]
|
|
691
|
-
|
|
693
|
+
internal class EventStat
|
|
692
694
|
{
|
|
693
695
|
public string eventNameToSend;
|
|
696
|
+
public Dictionary<string, object> eventParams;
|
|
697
|
+
internal string eventParamsInJSON;
|
|
694
698
|
public List<string> adapters;
|
|
695
|
-
public string parameters;
|
|
696
699
|
|
|
697
|
-
public EventStat(string eventNameToSend,
|
|
700
|
+
public EventStat(string eventNameToSend, Dictionary<string, object> eventParams, List<string> adapterIDs)
|
|
698
701
|
{
|
|
699
702
|
this.eventNameToSend = eventNameToSend;
|
|
700
|
-
|
|
703
|
+
this.eventParams = eventParams;
|
|
704
|
+
eventParamsInJSON = JsonUtils.DictionaryToJson(eventParams);
|
|
701
705
|
adapters = adapterIDs;
|
|
702
706
|
}
|
|
703
707
|
|
|
704
|
-
|
|
708
|
+
internal void AppendAsTSV(StringBuilder sb)
|
|
705
709
|
{
|
|
706
710
|
sb.Append(eventNameToSend);
|
|
707
711
|
sb.Append("\t");
|
|
@@ -711,7 +715,7 @@ namespace Amanotes.Core
|
|
|
711
715
|
if (i < adapters.Count - 1) sb.Append(",");
|
|
712
716
|
}
|
|
713
717
|
sb.Append("\t");
|
|
714
|
-
sb.
|
|
718
|
+
sb.AppendLine(eventParamsInJSON);
|
|
715
719
|
}
|
|
716
720
|
}
|
|
717
721
|
|
|
@@ -866,15 +870,13 @@ namespace Amanotes.Core
|
|
|
866
870
|
private bool isFirstSave = true;
|
|
867
871
|
private StringBuilder contents = new StringBuilder(8192);
|
|
868
872
|
private readonly ConcurrentQueue<EventStat> lastFrameEventStats = new ConcurrentQueue<EventStat>();
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
}
|
|
877
|
-
|
|
873
|
+
internal readonly ConcurrentQueue<EventStat> savedEventStatsInLastFrame = new ConcurrentQueue<EventStat>();
|
|
874
|
+
|
|
875
|
+
internal void OnEventSent(string eventName, Dictionary<string, object> eventParams, List<string> inUseAdapterIDs)
|
|
876
|
+
{
|
|
877
|
+
lastFrameEventStats.Enqueue(new EventStat(eventName, eventParams, inUseAdapterIDs));
|
|
878
|
+
}
|
|
879
|
+
|
|
878
880
|
internal void Save()
|
|
879
881
|
{
|
|
880
882
|
contents.Clear();
|
package/Runtime/AmaGDK.Config.cs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
using System;
|
|
2
2
|
using Amanotes.Core.Internal;
|
|
3
3
|
using UnityEngine;
|
|
4
|
+
using static Amanotes.Core.GDKDebug;
|
|
4
5
|
|
|
5
6
|
namespace Amanotes.Core
|
|
6
7
|
{
|
|
@@ -15,7 +16,7 @@ namespace Amanotes.Core
|
|
|
15
16
|
|
|
16
17
|
if (_onGoingRequestAllConsents)
|
|
17
18
|
{
|
|
18
|
-
|
|
19
|
+
LogWarning($"[Consent] RequestAllConsents is called multiple times.");
|
|
19
20
|
return;
|
|
20
21
|
}
|
|
21
22
|
|
|
@@ -49,7 +50,7 @@ namespace Amanotes.Core
|
|
|
49
50
|
get
|
|
50
51
|
{
|
|
51
52
|
if (checkedATT) return allowedATT;
|
|
52
|
-
|
|
53
|
+
LogWarning("[Consent] ATT has not completed yet");
|
|
53
54
|
return false;
|
|
54
55
|
}
|
|
55
56
|
}
|
|
@@ -85,7 +86,7 @@ namespace Amanotes.Core
|
|
|
85
86
|
|
|
86
87
|
if (!ConsentHook.IsRequiredCMP.HasValue)
|
|
87
88
|
{
|
|
88
|
-
|
|
89
|
+
LogWarningOnce("[Consent] CMP is not available or not ready");
|
|
89
90
|
return false;
|
|
90
91
|
}
|
|
91
92
|
|
|
@@ -169,7 +170,7 @@ namespace Amanotes.Core
|
|
|
169
170
|
var tmpAction = _onConsentComplete;
|
|
170
171
|
_onConsentComplete = null;
|
|
171
172
|
tmpAction?.Invoke();
|
|
172
|
-
|
|
173
|
+
Log("[Consent] End consent checking");
|
|
173
174
|
}
|
|
174
175
|
}
|
|
175
176
|
}
|
|
@@ -192,7 +193,7 @@ namespace Amanotes.Core
|
|
|
192
193
|
{
|
|
193
194
|
if (_tryToShowCMP != null) return _tryToShowCMP;
|
|
194
195
|
|
|
195
|
-
|
|
196
|
+
LogWarning("[Consent] ConsentHook.TryToShowCMP is null");
|
|
196
197
|
_tryToShowCMP = callback => callback(false);
|
|
197
198
|
return _tryToShowCMP;
|
|
198
199
|
}
|
|
@@ -206,7 +207,7 @@ namespace Amanotes.Core
|
|
|
206
207
|
{
|
|
207
208
|
if (_forceShowCMP != null) return _forceShowCMP;
|
|
208
209
|
|
|
209
|
-
|
|
210
|
+
LogWarning("[Consent] ConsentHook.ForceShowCMP is null");
|
|
210
211
|
_forceShowCMP = callback => callback(false);
|
|
211
212
|
return _forceShowCMP;
|
|
212
213
|
}
|
|
@@ -220,7 +221,7 @@ namespace Amanotes.Core
|
|
|
220
221
|
{
|
|
221
222
|
if (_setNotRequiredCMP != null) return _setNotRequiredCMP;
|
|
222
223
|
|
|
223
|
-
|
|
224
|
+
LogWarning("[Consent] ConsentHook.SetNotRequiredCMP is null");
|
|
224
225
|
_setNotRequiredCMP = callback => callback(false);
|
|
225
226
|
return _setNotRequiredCMP;
|
|
226
227
|
}
|
|
@@ -234,7 +235,7 @@ namespace Amanotes.Core
|
|
|
234
235
|
{
|
|
235
236
|
if (_attRequest != null) return _attRequest;
|
|
236
237
|
|
|
237
|
-
|
|
238
|
+
LogWarning("[Consent] ConsentHook.ATTRequest is null");
|
|
238
239
|
_attRequest = callback => callback(false);
|
|
239
240
|
return _attRequest;
|
|
240
241
|
}
|
package/Runtime/AmaGDK.Device.cs
CHANGED
|
@@ -2,6 +2,7 @@ using System;
|
|
|
2
2
|
using System.Text;
|
|
3
3
|
using Amanotes.Core.Internal;
|
|
4
4
|
using UnityEngine;
|
|
5
|
+
using static Amanotes.Core.GDKDebug;
|
|
5
6
|
|
|
6
7
|
namespace Amanotes.Core
|
|
7
8
|
{
|
|
@@ -74,7 +75,7 @@ namespace Amanotes.Core.Internal
|
|
|
74
75
|
stringBuilder.AppendLine("processorCount: " + SystemInfo.processorCount);
|
|
75
76
|
stringBuilder.AppendLine("processorFrequency: " + SystemInfo.processorFrequency);
|
|
76
77
|
stringBuilder.AppendLine("graphicsMemorySize: " + SystemInfo.graphicsMemorySize);
|
|
77
|
-
|
|
78
|
+
Log(GDKPool.ReturnString(stringBuilder));
|
|
78
79
|
}
|
|
79
80
|
|
|
80
81
|
return result;
|
package/Runtime/AmaGDK.IAP.cs
CHANGED
|
@@ -3,6 +3,7 @@ using System.Text.RegularExpressions;
|
|
|
3
3
|
using Amanotes.Core.Internal;
|
|
4
4
|
using System.Collections.Generic;
|
|
5
5
|
using UnityEngine;
|
|
6
|
+
using static Amanotes.Core.GDKDebug;
|
|
6
7
|
|
|
7
8
|
namespace Amanotes.Core
|
|
8
9
|
{
|
|
@@ -70,7 +71,7 @@ namespace Amanotes.Core
|
|
|
70
71
|
{
|
|
71
72
|
if (_userId == value) return;
|
|
72
73
|
_userId = value;
|
|
73
|
-
|
|
74
|
+
Log($"GDK UserID Updated: {_userId}");
|
|
74
75
|
dispatcher.Dispatch(Event.GDK_USER_ID_UPDATED, _userId);
|
|
75
76
|
_dirty = true;
|
|
76
77
|
if (isReady) SendMapUserId();
|
|
@@ -84,7 +85,7 @@ namespace Amanotes.Core
|
|
|
84
85
|
{
|
|
85
86
|
if (!ValidateId(value, ALPHANUMERIC_HYPHEN_PATTERN))
|
|
86
87
|
{
|
|
87
|
-
|
|
88
|
+
LogError($"[UserProfile] Wrong format for GAId. Value: {value}");
|
|
88
89
|
return;
|
|
89
90
|
}
|
|
90
91
|
_gaid = value;
|
|
@@ -99,7 +100,7 @@ namespace Amanotes.Core
|
|
|
99
100
|
{
|
|
100
101
|
if (!ValidateId(value, ALPHANUMERIC_HYPHEN_PATTERN))
|
|
101
102
|
{
|
|
102
|
-
|
|
103
|
+
LogError($"[UserProfile] Wrong format for IDFA. Value: {value}");
|
|
103
104
|
return;
|
|
104
105
|
}
|
|
105
106
|
_idfa = value;
|
|
@@ -114,7 +115,7 @@ namespace Amanotes.Core
|
|
|
114
115
|
{
|
|
115
116
|
if (!ValidateId(value, ALPHANUMERIC_HYPHEN_PATTERN))
|
|
116
117
|
{
|
|
117
|
-
|
|
118
|
+
LogError($"[UserProfile] Wrong format for IDFV. Value: {value}");
|
|
118
119
|
return;
|
|
119
120
|
}
|
|
120
121
|
_idfv = value;
|
|
@@ -129,7 +130,7 @@ namespace Amanotes.Core
|
|
|
129
130
|
{
|
|
130
131
|
if (!ValidateId(value, ALPHANUMERIC_PATTERN))
|
|
131
132
|
{
|
|
132
|
-
|
|
133
|
+
LogError($"[UserProfile] Wrong format for AndroidId. Value: {value}");
|
|
133
134
|
return;
|
|
134
135
|
}
|
|
135
136
|
_androidId = value;
|
|
@@ -144,7 +145,7 @@ namespace Amanotes.Core
|
|
|
144
145
|
{
|
|
145
146
|
if (!ValidateId(value, ALPHANUMERIC_PATTERN))
|
|
146
147
|
{
|
|
147
|
-
|
|
148
|
+
LogError($"[UserProfile] Wrong format for PseudoId. Value: {value}");
|
|
148
149
|
return;
|
|
149
150
|
}
|
|
150
151
|
_pseudoId = value;
|
|
@@ -163,7 +164,7 @@ namespace Amanotes.Core
|
|
|
163
164
|
#endif
|
|
164
165
|
if (!ValidateId(value, pattern))
|
|
165
166
|
{
|
|
166
|
-
|
|
167
|
+
LogError($"[UserProfile] Wrong format for AmaDeviceId. Value: {value}");
|
|
167
168
|
return;
|
|
168
169
|
}
|
|
169
170
|
_amaDeviceId = value;
|
|
@@ -179,7 +180,7 @@ namespace Amanotes.Core
|
|
|
179
180
|
{
|
|
180
181
|
if (!Application.isEditor && !ValidateId(value, NUMERIC_HYPHEN_PATTERN))
|
|
181
182
|
{
|
|
182
|
-
|
|
183
|
+
LogError($"[UserProfile] Wrong format for AppsFlyerId. Value: {value}");
|
|
183
184
|
return;
|
|
184
185
|
}
|
|
185
186
|
_appsFlyerId = value;
|
|
@@ -194,7 +195,7 @@ namespace Amanotes.Core
|
|
|
194
195
|
{
|
|
195
196
|
if (!ValidateId(value, ALPHANUMERIC_PATTERN))
|
|
196
197
|
{
|
|
197
|
-
|
|
198
|
+
LogError($"[UserProfile] Wrong format for InstallationId. Value: {value}");
|
|
198
199
|
return;
|
|
199
200
|
}
|
|
200
201
|
_installationId = value;
|
|
@@ -325,7 +326,7 @@ namespace Amanotes.Core
|
|
|
325
326
|
{
|
|
326
327
|
// Always get the latest advertising id
|
|
327
328
|
GetAdvertisingId();
|
|
328
|
-
|
|
329
|
+
Log($"[UserProfile] user_id: {_userId}");
|
|
329
330
|
GDKUtils.OnFrameUpdate(SaveIfDirty);
|
|
330
331
|
|
|
331
332
|
var adsId = Application.platform == RuntimePlatform.Android ? GAId : IDFA;
|
|
@@ -394,7 +395,7 @@ namespace Amanotes.Core
|
|
|
394
395
|
AmaDeviceId = SystemInfo.deviceUniqueIdentifier;
|
|
395
396
|
break;
|
|
396
397
|
}
|
|
397
|
-
|
|
398
|
+
Log($"[UserProfile] Generate ama_device_id: {_amaDeviceId}");
|
|
398
399
|
Save();
|
|
399
400
|
}
|
|
400
401
|
|
package/Runtime/AmaGDK.asmdef
CHANGED
package/Runtime/AmaGDK.cs
CHANGED
|
@@ -9,7 +9,7 @@ using Amanotes.Core.Internal;
|
|
|
9
9
|
using System.Linq;
|
|
10
10
|
using UnityEngine;
|
|
11
11
|
using UnityEngine.Profiling;
|
|
12
|
-
using static Amanotes.Core.
|
|
12
|
+
using static Amanotes.Core.GDKDebug;
|
|
13
13
|
using static Amanotes.Core.Internal.Messsage;
|
|
14
14
|
using Debug = UnityEngine.Debug;
|
|
15
15
|
|
|
@@ -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.
|
|
20
|
+
public const string VERSION = "0.2.72";
|
|
21
21
|
|
|
22
22
|
internal static Status _status = Status.None;
|
|
23
23
|
private static ConfigAsset _config = null;
|
|
@@ -47,7 +47,7 @@ namespace Amanotes.Core
|
|
|
47
47
|
{
|
|
48
48
|
if (_config != null) return _config;
|
|
49
49
|
_config = Resources.Load<ConfigAsset>("AmaGDKConfig");
|
|
50
|
-
|
|
50
|
+
GDKDebug.logLevel = _config.common.logLevel;
|
|
51
51
|
return _config;
|
|
52
52
|
}
|
|
53
53
|
}
|
|
@@ -210,7 +210,7 @@ namespace Amanotes.Core
|
|
|
210
210
|
LogEvent_GDKInit(Mathf.RoundToInt(initDuration));
|
|
211
211
|
|
|
212
212
|
sb.Append($"\nMapping UserId: {User.UserId}\n");
|
|
213
|
-
|
|
213
|
+
ForceLog($"AmaGDK v{VERSION} | {READY} in {initDuration:#0.00}s\n\n{sb}");
|
|
214
214
|
GDKPool.Return(sb);
|
|
215
215
|
}
|
|
216
216
|
|
|
@@ -265,8 +265,8 @@ namespace Amanotes.Core
|
|
|
265
265
|
|
|
266
266
|
public static LogLevel logLevel
|
|
267
267
|
{
|
|
268
|
-
get => Config.common.logLevel;
|
|
269
|
-
set =>
|
|
268
|
+
get => _config == null ? Config.common.logLevel : GDKDebug.logLevel;
|
|
269
|
+
set => GDKDebug.logLevel = value;
|
|
270
270
|
}
|
|
271
271
|
|
|
272
272
|
public static void Init(Action onReady = null)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
using UnityEngine;
|
|
2
2
|
using System;
|
|
3
3
|
using Amanotes.Core.Internal;
|
|
4
|
+
using static Amanotes.Core.GDKDebug;
|
|
4
5
|
|
|
5
6
|
namespace Amanotes.Core.Internal
|
|
6
7
|
{
|
|
@@ -69,7 +70,7 @@ namespace Amanotes.Core
|
|
|
69
70
|
|
|
70
71
|
if (onAudioDeviceChange == null)
|
|
71
72
|
{
|
|
72
|
-
|
|
73
|
+
LogWarning("Cannot add a null callback!");
|
|
73
74
|
return;
|
|
74
75
|
}
|
|
75
76
|
|
|
@@ -111,7 +112,7 @@ namespace Amanotes.Core
|
|
|
111
112
|
{
|
|
112
113
|
if (_audioDeviceDetector == null)
|
|
113
114
|
{
|
|
114
|
-
|
|
115
|
+
LogWarning("AmaGDK | [Audio] Module has not been initialized!");
|
|
115
116
|
return NO_DEVICE;
|
|
116
117
|
}
|
|
117
118
|
|