com.amanotes.gdk 0.2.45-1 → 0.2.45-2

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,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.2.45-2 - 2024-01-31]
4
+ - [Fix] Get advertising ID on main thread
5
+
3
6
  ## [0.2.45-1 - 2024-01-16]
4
7
  - [Fix] Purchase product in Editor
5
8
 
@@ -242,35 +242,38 @@ namespace Amanotes.Core
242
242
  {
243
243
  AdvertisingIdFetcher.RequestAdvertisingId(advertisingId =>
244
244
  {
245
- SetAdvertisingID(advertisingId);
246
- switch (Application.platform)
245
+ GDKUtils.DelayCall(0f, () =>
247
246
  {
248
- case RuntimePlatform.IPhonePlayer:
249
- string v = KeyChain.GetKeyChain(AMA_DEVICE_ID_KEY);
250
- if (string.IsNullOrEmpty(v))
251
- {
252
- v = Guid.NewGuid().ToString();
253
- KeyChain.SetKeyChain(AMA_DEVICE_ID_KEY, v);
254
- }
255
- AmaDeviceId = v;
256
- break;
247
+ SetAdvertisingID(advertisingId);
248
+ switch (Application.platform)
249
+ {
250
+ case RuntimePlatform.IPhonePlayer:
251
+ string v = KeyChain.GetKeyChain(AMA_DEVICE_ID_KEY);
252
+ if (string.IsNullOrEmpty(v))
253
+ {
254
+ v = Guid.NewGuid().ToString();
255
+ KeyChain.SetKeyChain(AMA_DEVICE_ID_KEY, v);
256
+ }
257
+ AmaDeviceId = v;
258
+ break;
257
259
 
258
- case RuntimePlatform.Android:
259
- string cachedAmaDeviceId = PlayerPrefs.GetString(AMA_DEVICE_ID_KEY);
260
- if (string.IsNullOrEmpty(cachedAmaDeviceId))
261
- {
262
- cachedAmaDeviceId = SystemInfo.deviceUniqueIdentifier;
263
- PlayerPrefs.SetString(AMA_DEVICE_ID_KEY, cachedAmaDeviceId);
264
- }
265
- AmaDeviceId = cachedAmaDeviceId;
266
- break;
260
+ case RuntimePlatform.Android:
261
+ string cachedAmaDeviceId = PlayerPrefs.GetString(AMA_DEVICE_ID_KEY);
262
+ if (string.IsNullOrEmpty(cachedAmaDeviceId))
263
+ {
264
+ cachedAmaDeviceId = SystemInfo.deviceUniqueIdentifier;
265
+ PlayerPrefs.SetString(AMA_DEVICE_ID_KEY, cachedAmaDeviceId);
266
+ }
267
+ AmaDeviceId = cachedAmaDeviceId;
268
+ break;
267
269
 
268
- default:
269
- AmaDeviceId = SystemInfo.deviceUniqueIdentifier;
270
- break;
271
- }
272
- Logging.Log($"Generate AmaDeviceId completed: {_amaDeviceId}");
273
- User.Save();
270
+ default:
271
+ AmaDeviceId = SystemInfo.deviceUniqueIdentifier;
272
+ break;
273
+ }
274
+ Logging.Log($"Generate AmaDeviceId completed: {_amaDeviceId}");
275
+ User.Save();
276
+ });
274
277
  });
275
278
  }
276
279
 
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.45-1";
18
+ public const string VERSION = "0.2.45-2";
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.45-1",
3
+ "version": "0.2.45-2",
4
4
  "displayName": "AmaGDK",
5
5
  "description": "Amanotes Game Development Kit",
6
6
  "unity": "2019.4",