com.amanotes.gdk 0.2.46-1 → 0.2.46-3

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 CHANGED
@@ -1,7 +1,11 @@
1
1
  # Changelog
2
2
 
3
- ## [0.2.46-1 - 2024-01-18]
3
+ ## [0.2.46-3 - 2024-01-31]
4
+ - Resolve early log events
5
+
6
+ ## [0.2.46-2 - 2024-01-18]
4
7
  - Update UserId every session
8
+ - Migrate accumulated_count gradually
5
9
 
6
10
  ## [0.2.46 - 2023-12-19]
7
11
  - Cleaner UI interface for AmaGDK Inspector
@@ -1,4 +1,5 @@
1
1
  using System;
2
+ using System.Collections;
2
3
  using System.Collections.Generic;
3
4
  using System.Text;
4
5
  using Amanotes.Core.Internal;
@@ -261,11 +262,17 @@ namespace Amanotes.Core
261
262
  if (listAdapters.Count != 0)
262
263
  primaryAdapter = listAdapters.Find(a => a.adapterId == AdapterID.FIREBASE_ANALYTICS) ?? listAdapters[0];
263
264
 
265
+ _instance.StartCoroutine(RegisterGDKUpdate());
266
+ }
267
+
268
+ static IEnumerator RegisterGDKUpdate()
269
+ {
270
+ yield return new WaitUntil(() => primaryAdapter.IsReady);
264
271
  onFrameUpdate -= ProcessEventQueue;
265
272
  onFrameUpdate += ProcessEventQueue;
266
273
 
267
274
  onFrameUpdate -= ProcessActionQueue;
268
- onFrameUpdate += ProcessActionQueue;
275
+ onFrameUpdate += ProcessActionQueue;
269
276
  }
270
277
 
271
278
  internal static void ProcessEventQueue()
@@ -14,18 +14,8 @@ namespace Amanotes.Core
14
14
  [Serializable]
15
15
  public partial class UserProfile : IJsonFile
16
16
  {
17
- private const string FILE_NAME = nameof(UserProfile);
18
- [NonSerialized] internal bool _dirty;
19
-
20
17
  private void Save()
21
18
  {
22
- GDKFileUtils.Save(FILE_NAME, JsonUtility.ToJson(this));
23
- }
24
-
25
- internal void SaveIfDirty()
26
- {
27
- if (!_dirty) return;
28
- _dirty = false;
29
19
  this.SaveJsonToFile();
30
20
  }
31
21
  }
@@ -116,63 +106,8 @@ namespace Amanotes.Core
116
106
  get => _installationId;
117
107
  set => _installationId = ValidateId(value, ALPHANUMERIC_PATTERN);
118
108
  }
119
- }
120
-
121
- public partial class UserProfile //INTERNAL
122
- {
123
- [SerializeField]
124
- private string _userId;
125
- [SerializeField]
126
- private string _gaid;
127
- [SerializeField]
128
- private string _idfa;
129
- [SerializeField]
130
- private string _idfv;
131
- [SerializeField]
132
- private string _androidId;
133
- [SerializeField]
134
- private string _pseudoId;
135
- [SerializeField]
136
- private string _amaDeviceId;
137
- [SerializeField]
138
- private string _appsFlyerId;
139
- [SerializeField]
140
- private string _installationId;
141
-
142
- private const string ALPHANUMERIC_HYPHEN_PATTERN = @"^(?=.*\d)(?=.*[a-zA-Z])(?=.*-).+$";
143
- private const string ALPHANUMERIC_PATTERN = @"^(?=.*\d)(?=.*[a-zA-Z])[a-zA-Z\d]+$";
144
- private const string NUMERIC_HYPHEN_PATTERN = @"^(?=.*\d)(?=.*-)[\d-]+$";
145
109
 
146
- private const string AMA_DEVICE_ID_KEY = "ama_device_id";
147
- private const float TIME_OUT = 5f;
148
- private const float WAIT_TIME = 0.5f;
149
- private WaitForSecondsRealtime waitForDuration = new WaitForSecondsRealtime(WAIT_TIME);
150
-
151
- internal IEnumerator Init()
152
- {
153
- User.LoadJsonFromFile();
154
-
155
- #if UNITY_ANDROID
156
- AndroidId = SystemInfo.deviceUniqueIdentifier;
157
- #elif UNITY_IOS
158
- IDFV = SystemInfo.deviceUniqueIdentifier;
159
- #endif
160
-
161
- // Always get the latest advertising id
162
- GetAdvertisingId();
163
-
164
- float time = 0;
165
- while (!User.IsAmaDeviceIdExist())
166
- {
167
- yield return waitForDuration;
168
- time += WAIT_TIME;
169
- if (time <= TIME_OUT) continue;
170
- Logging.LogWarning($"| UserProfile <init> timeout: {TIME_OUT} (ama_device_id not exist)");
171
- break;
172
- }
173
- }
174
-
175
- internal void UpdateUserId()
110
+ public void UpdateUserId()
176
111
  {
177
112
  #if UNITY_ANDROID
178
113
  if (!string.IsNullOrWhiteSpace(_gaid))
@@ -228,7 +163,62 @@ namespace Amanotes.Core
228
163
  return;
229
164
  }
230
165
  }
166
+ }
167
+
168
+ public partial class UserProfile //INTERNAL
169
+ {
170
+ [SerializeField]
171
+ private string _userId;
172
+ [SerializeField]
173
+ private string _gaid;
174
+ [SerializeField]
175
+ private string _idfa;
176
+ [SerializeField]
177
+ private string _idfv;
178
+ [SerializeField]
179
+ private string _androidId;
180
+ [SerializeField]
181
+ private string _pseudoId;
182
+ [SerializeField]
183
+ private string _amaDeviceId;
184
+ [SerializeField]
185
+ private string _appsFlyerId;
186
+ [SerializeField]
187
+ private string _installationId;
188
+
189
+ private const string ALPHANUMERIC_HYPHEN_PATTERN = @"^(?=.*\d)(?=.*[a-zA-Z])(?=.*-).+$";
190
+ private const string ALPHANUMERIC_PATTERN = @"^(?=.*\d)(?=.*[a-zA-Z])[a-zA-Z\d]+$";
191
+ private const string NUMERIC_HYPHEN_PATTERN = @"^(?=.*\d)(?=.*-)[\d-]+$";
231
192
 
193
+ private const string AMA_DEVICE_ID_KEY = "ama_device_id";
194
+ private const float TIME_OUT = 5f;
195
+ private const float WAIT_TIME = 0.5f;
196
+ private WaitForSecondsRealtime waitForDuration = new WaitForSecondsRealtime(WAIT_TIME);
197
+
198
+ internal IEnumerator Init()
199
+ {
200
+ User.LoadJsonFromFile();
201
+
202
+ #if UNITY_ANDROID
203
+ AndroidId = SystemInfo.deviceUniqueIdentifier;
204
+ #elif UNITY_IOS
205
+ IDFV = SystemInfo.deviceUniqueIdentifier;
206
+ #endif
207
+
208
+ // Always get the latest advertising id
209
+ GetAdvertisingId();
210
+
211
+ float time = 0;
212
+ while (!User.IsAmaDeviceIdExist())
213
+ {
214
+ yield return waitForDuration;
215
+ time += WAIT_TIME;
216
+ if (time <= TIME_OUT) continue;
217
+ Logging.LogWarning($"| UserProfile <init> timeout: {TIME_OUT} (ama_device_id not exist)");
218
+ break;
219
+ }
220
+ }
221
+
232
222
  private bool IsAmaDeviceIdExist()
233
223
  {
234
224
  if (!string.IsNullOrEmpty(_amaDeviceId))
package/Runtime/AmaGDK.cs CHANGED
@@ -15,7 +15,7 @@ namespace Amanotes.Core
15
15
  {
16
16
  public partial class AmaGDK : MonoBehaviour
17
17
  {
18
- public const string VERSION = "0.2.46-1";
18
+ public const string VERSION = "0.2.46-3";
19
19
 
20
20
  internal static AmaGDK _instance;
21
21
  internal static Status _status = Status.None;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "com.amanotes.gdk",
3
- "version": "0.2.46-1",
3
+ "version": "0.2.46-3",
4
4
  "displayName": "AmaGDK",
5
5
  "description": "Amanotes Game Development Kit",
6
6
  "unity": "2019.4",