com.amanotes.gdk 0.2.44 → 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 +9 -0
- package/Extra/AmaGDKInstaller.unitypackage +0 -0
- package/Extra/AmaGDKProject.unitypackage +0 -0
- package/Packages/AmaGDKConfig.unitypackage +0 -0
- package/Packages/AmaGDKExample.unitypackage +0 -0
- package/Packages/AmaGDKTest.unitypackage +0 -0
- package/Packages/AppsFlyerAdapter_v6.5.4.unitypackage +0 -0
- package/Packages/FirebaseAnalyticsAdapter_v9.1.0.unitypackage +0 -0
- package/Packages/FirebaseRemoteConfigAdapter_v9.1.0.unitypackage +0 -0
- package/Packages/IronSourceAdapter_v7.5.2.unitypackage +0 -0
- package/Packages/RevenueCatAdapter_v6.0.0.unitypackage +0 -0
- package/Runtime/AmaGDK.IAP.cs +23 -18
- package/Runtime/AmaGDK.UserProfile.cs +30 -27
- package/Runtime/AmaGDK.cs +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.2.45-2 - 2024-01-31]
|
|
4
|
+
- [Fix] Get advertising ID on main thread
|
|
5
|
+
|
|
6
|
+
## [0.2.45-1 - 2024-01-16]
|
|
7
|
+
- [Fix] Purchase product in Editor
|
|
8
|
+
|
|
9
|
+
## [0.2.45 - 2023-12-13]
|
|
10
|
+
- [Fix] Able to assign ama_device_id in Editor
|
|
11
|
+
|
|
3
12
|
## [0.2.44 - 2023-12-08]
|
|
4
13
|
- [Fix] Auto log Ad events
|
|
5
14
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/Runtime/AmaGDK.IAP.cs
CHANGED
|
@@ -38,13 +38,30 @@ namespace Amanotes.Core
|
|
|
38
38
|
public static IPurchaseBuilder Purchase(string productId)
|
|
39
39
|
{
|
|
40
40
|
var result = new PurchaseContext();
|
|
41
|
-
|
|
41
|
+
ExecuteInNextFrame(() =>
|
|
42
42
|
{
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
#if UNITY_EDITOR
|
|
44
|
+
if (AdapterConfig.allPurchaseSuccessInEditor)
|
|
45
|
+
{
|
|
46
|
+
PurchaseSuccess s = new PurchaseSuccess
|
|
47
|
+
{
|
|
48
|
+
productIds = new[] { productId },
|
|
49
|
+
isSandbox = true
|
|
50
|
+
};
|
|
51
|
+
result.onSuccess?.Invoke(s);
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
#endif
|
|
55
|
+
|
|
56
|
+
if (!dicProducts.ContainsKey(productId))
|
|
57
|
+
{
|
|
58
|
+
LogWarning($"[IAP] Product {productId} is not found");
|
|
59
|
+
result.onFail?.Invoke(new PurchaseError($"Product {productId} is not found"));
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
result.Purchase(dicProducts[productId]);
|
|
64
|
+
});
|
|
48
65
|
return result;
|
|
49
66
|
}
|
|
50
67
|
|
|
@@ -516,18 +533,6 @@ namespace Amanotes.Core.Internal
|
|
|
516
533
|
|
|
517
534
|
public void Purchase(ProductInfo productInfo)
|
|
518
535
|
{
|
|
519
|
-
#if UNITY_EDITOR
|
|
520
|
-
if (AdapterConfig.allPurchaseSuccessInEditor)
|
|
521
|
-
{
|
|
522
|
-
DoOnSuccess(new PurchaseSuccess
|
|
523
|
-
{
|
|
524
|
-
productIds = new[] { productInfo.id },
|
|
525
|
-
isSandbox = true
|
|
526
|
-
});
|
|
527
|
-
return;
|
|
528
|
-
}
|
|
529
|
-
#endif
|
|
530
|
-
|
|
531
536
|
if (!string.IsNullOrWhiteSpace(discountId))
|
|
532
537
|
{
|
|
533
538
|
AmaGDK.IAP.Adapter?.PurchaseDiscount(productInfo, discountId, DoOnSuccess, DoOnFail);
|
|
@@ -76,7 +76,7 @@ namespace Amanotes.Core
|
|
|
76
76
|
set => _pseudoId = ValidateId(value, ALPHANUMERIC_PATTERN);
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
#if UNITY_ANDROID
|
|
79
|
+
#if UNITY_ANDROID && !UNITY_EDITOR
|
|
80
80
|
public string AmaDeviceId
|
|
81
81
|
{
|
|
82
82
|
get => _amaDeviceId;
|
|
@@ -242,35 +242,38 @@ namespace Amanotes.Core
|
|
|
242
242
|
{
|
|
243
243
|
AdvertisingIdFetcher.RequestAdvertisingId(advertisingId =>
|
|
244
244
|
{
|
|
245
|
-
|
|
246
|
-
switch (Application.platform)
|
|
245
|
+
GDKUtils.DelayCall(0f, () =>
|
|
247
246
|
{
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
v =
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
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
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
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
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
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