com.amanotes.gdk 0.2.81-alpha.14 → 0.2.81-alpha.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/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.AdQuality.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/Consent/AmaGDK.Consent.cs +34 -58
- package/package.json +1 -1
- package/Runtime/Consent/GDKPrivacyButton.cs +0 -25
- package/Runtime/Consent/GDKPrivacyButton.cs.meta +0 -3
|
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
|
|
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 = "v0.2.81-alpha.
|
|
30
|
+
public const string VERSION = "v0.2.81-alpha.15";
|
|
31
31
|
|
|
32
32
|
internal static Status _status = Status.None;
|
|
33
33
|
internal static ConfigAsset _config = null;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
using System;
|
|
2
2
|
using Amanotes.Core.Internal;
|
|
3
3
|
using UnityEngine;
|
|
4
|
+
using UnityEngine.Serialization;
|
|
4
5
|
using static Amanotes.Core.GDKDebug;
|
|
5
6
|
|
|
6
7
|
namespace Amanotes.Core
|
|
@@ -10,6 +11,8 @@ namespace Amanotes.Core
|
|
|
10
11
|
public static partial class Consent //Public
|
|
11
12
|
{
|
|
12
13
|
private static readonly GDKTaskTracker _allConsentTaskTracker = new GDKTaskTracker();
|
|
14
|
+
|
|
15
|
+
public static void OnAllConsentsCompleted(Action onComplete) => _allConsentTaskTracker.RegisterOnCompleteCallback(onComplete);
|
|
13
16
|
public static void RequestAllConsents(Action onComplete)
|
|
14
17
|
{
|
|
15
18
|
_allConsentTaskTracker.RegisterOnCompleteCallback(onComplete);
|
|
@@ -72,21 +75,37 @@ namespace Amanotes.Core
|
|
|
72
75
|
onComplete?.Invoke(false);
|
|
73
76
|
return;
|
|
74
77
|
}
|
|
78
|
+
|
|
79
|
+
void RequestATT()
|
|
80
|
+
{
|
|
81
|
+
ConsentHook.ATTRequest(
|
|
82
|
+
isAllowed =>
|
|
83
|
+
{
|
|
84
|
+
data.att = isAllowed ? Status.Allowed : Status.NotAllowed;
|
|
85
|
+
data.SaveJsonToFile(false);
|
|
86
|
+
onComplete?.Invoke(allowedATT);
|
|
87
|
+
}
|
|
88
|
+
);
|
|
89
|
+
}
|
|
75
90
|
|
|
76
|
-
|
|
91
|
+
if (_config.autoGetConsent)
|
|
77
92
|
{
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
93
|
+
// Delay 1s due to iOS issue, ATT popup will not show if we request soon at app launch
|
|
94
|
+
GDKUtils.DelayCall(1f, RequestATT);
|
|
95
|
+
}
|
|
96
|
+
else
|
|
97
|
+
{
|
|
98
|
+
RequestATT();
|
|
99
|
+
}
|
|
82
100
|
}
|
|
83
101
|
}
|
|
84
|
-
|
|
85
102
|
}
|
|
86
103
|
|
|
87
104
|
public static partial class Consent //CMP
|
|
88
105
|
{
|
|
89
|
-
public static
|
|
106
|
+
public static readonly CMPConsent CMP = new CMPConsent();
|
|
107
|
+
|
|
108
|
+
public class CMPConsent
|
|
90
109
|
{
|
|
91
110
|
/// <summary>
|
|
92
111
|
/// Determines if a consent popup should be shown to the user and displays it if required.
|
|
@@ -101,7 +120,7 @@ namespace Amanotes.Core
|
|
|
101
120
|
/// </param>
|
|
102
121
|
/// <param name="onError">Callback invoked with an error message if the consent
|
|
103
122
|
/// form could not be loaded or shown.</param>
|
|
104
|
-
public
|
|
123
|
+
public void ShowConsentFormIfRequired(Action<bool> onComplete, Action<string> onError)
|
|
105
124
|
{
|
|
106
125
|
if (ConsentHook.ShowConsentFormIfRequired == null)
|
|
107
126
|
{
|
|
@@ -112,59 +131,17 @@ namespace Amanotes.Core
|
|
|
112
131
|
if (data.consentAlreadyShown)
|
|
113
132
|
{
|
|
114
133
|
Log("[Consent] Consent form has already been shown");
|
|
115
|
-
onComplete?.Invoke(data.
|
|
134
|
+
onComplete?.Invoke(data.canRequestAds);
|
|
116
135
|
return;
|
|
117
136
|
}
|
|
118
|
-
ConsentHook.ShowConsentFormIfRequired(
|
|
137
|
+
ConsentHook.ShowConsentFormIfRequired(canRequestAds =>
|
|
119
138
|
{
|
|
120
|
-
data.
|
|
139
|
+
data.canRequestAds = canRequestAds;
|
|
121
140
|
data.consentAlreadyShown = true;
|
|
122
141
|
data.SaveJsonToFile(false);
|
|
123
|
-
onComplete?.Invoke(
|
|
142
|
+
onComplete?.Invoke(canRequestAds);
|
|
124
143
|
}, onError);
|
|
125
144
|
}
|
|
126
|
-
|
|
127
|
-
/// <summary>
|
|
128
|
-
/// Forces the consent popup to be shown to the user, regardless of previous
|
|
129
|
-
/// consent status.
|
|
130
|
-
/// </summary>
|
|
131
|
-
/// <param name="onComplete">Callback invoked with a boolean indicating the
|
|
132
|
-
/// ConsentInformation.CanRequestAds() result
|
|
133
|
-
/// </param>
|
|
134
|
-
/// <param name="onError">Callback invoked with an error message if the consent
|
|
135
|
-
/// form could not be loaded or shown.</param>
|
|
136
|
-
public static void ShowPrivacyForm(Action<bool> onComplete, Action<string> onError)
|
|
137
|
-
{
|
|
138
|
-
if (ConsentHook.CheckPrivacyOptionsRequired == null)
|
|
139
|
-
{
|
|
140
|
-
LogWarning("[Consent] ConsentHook.ShowPrivacyForm is not implemented");
|
|
141
|
-
onError?.Invoke("ShowPrivacyForm is not implemented");
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
144
|
-
ConsentHook.ShowPrivacyForm(onComplete, onError);
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
/// <summary>
|
|
148
|
-
/// Determines whether privacy options are required for the current user.
|
|
149
|
-
/// Updates the consent information before returning the result.
|
|
150
|
-
/// </summary>
|
|
151
|
-
/// <param name="onComplete">Callback invoked with `true` if privacy options are required, otherwise `false`.</param>
|
|
152
|
-
public static void CheckPrivacyOptionsRequired(Action<bool> onComplete)
|
|
153
|
-
{
|
|
154
|
-
if (ConsentHook.CheckPrivacyOptionsRequired == null)
|
|
155
|
-
{
|
|
156
|
-
LogWarning("[Consent] ConsentHook.CheckPrivacyOptionsRequired is not implemented");
|
|
157
|
-
onComplete?.Invoke(false);
|
|
158
|
-
return;
|
|
159
|
-
}
|
|
160
|
-
ConsentHook.CheckPrivacyOptionsRequired(onComplete);
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
[Obsolete("Use ShowPrivacyForm instead")]
|
|
164
|
-
public static void ForceShowPopup(Action<bool> onComplete)
|
|
165
|
-
{
|
|
166
|
-
ShowPrivacyForm(onComplete, s => onComplete?.Invoke(false));
|
|
167
|
-
}
|
|
168
145
|
}
|
|
169
146
|
}
|
|
170
147
|
|
|
@@ -177,7 +154,7 @@ namespace Amanotes.Core
|
|
|
177
154
|
internal static bool checkedATT => data.att >= Status.Allowed;
|
|
178
155
|
internal static bool allowedATT => data.att == Status.Allowed;
|
|
179
156
|
|
|
180
|
-
|
|
157
|
+
public enum Status
|
|
181
158
|
{
|
|
182
159
|
None,
|
|
183
160
|
NotRequired,
|
|
@@ -201,14 +178,13 @@ namespace Amanotes.Core
|
|
|
201
178
|
{
|
|
202
179
|
[SerializeField] internal AmaGDK.Consent.Status att;
|
|
203
180
|
[SerializeField] internal bool consentAlreadyShown;
|
|
204
|
-
[
|
|
181
|
+
[FormerlySerializedAs("canShowAds")]
|
|
182
|
+
[SerializeField] internal bool canRequestAds;
|
|
205
183
|
}
|
|
206
184
|
|
|
207
185
|
public static class ConsentHook
|
|
208
186
|
{
|
|
209
187
|
public static Action<Action<bool>, Action<string>> ShowConsentFormIfRequired;
|
|
210
|
-
public static Action<Action<bool>, Action<string>> ShowPrivacyForm;
|
|
211
|
-
public static Action<Action<bool>> CheckPrivacyOptionsRequired;
|
|
212
188
|
public static Action<Action<bool>> ATTRequest;
|
|
213
189
|
}
|
|
214
190
|
}
|
package/package.json
CHANGED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
using System;
|
|
2
|
-
using UnityEngine;
|
|
3
|
-
using UnityEngine.UI;
|
|
4
|
-
namespace Amanotes.Core
|
|
5
|
-
{
|
|
6
|
-
public class GDKPrivacyButton: MonoBehaviour
|
|
7
|
-
{
|
|
8
|
-
public Button button;
|
|
9
|
-
private void Start()
|
|
10
|
-
{
|
|
11
|
-
gameObject.SetActive(false);
|
|
12
|
-
UpdateUI();
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
public void OnButtonClick()
|
|
16
|
-
{
|
|
17
|
-
AmaGDK.Consent.CMP.ShowPrivacyForm(canShowAd => UpdateUI(), GDKDebug.LogWarning);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
private void UpdateUI()
|
|
21
|
-
{
|
|
22
|
-
AmaGDK.Consent.CMP.CheckPrivacyOptionsRequired(required => button.interactable = required);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|