update: 添加日志
parent
7dd2215f29
commit
ad5b1d3149
|
|
@ -584,7 +584,7 @@ namespace Guru
|
|||
|
||||
if (_validator == null)
|
||||
{
|
||||
LogE("[IAP] --- Validator is null. Report Order failed.");
|
||||
LogE($"{Tag} --- Validator is null. Report Order failed.");
|
||||
Crashlytics.LogException(new Exception($"IAPService can not report order because Validator is null!"));
|
||||
return;
|
||||
}
|
||||
|
|
@ -600,12 +600,15 @@ namespace Guru
|
|||
var result = _validator.Validate(args.purchasedProduct.receipt);
|
||||
string productID = orderType == 0 ? args.purchasedProduct.definition.id : "";
|
||||
string subscriptionID = orderType == 1 ? args.purchasedProduct.definition.id : "";
|
||||
|
||||
LogI($"{Tag} --- Report Android IAP Order -> orderType:{orderType} productID:{productID} blevel:{blevel}");
|
||||
|
||||
foreach (var productReceipt in result)
|
||||
{
|
||||
if (productReceipt is GooglePlayReceipt google)
|
||||
{
|
||||
new GoogleOrderRequest(orderType, productID, subscriptionID, google.purchaseToken, blevel)
|
||||
.SetTimeOut(3).Send();
|
||||
Debug.Log($"{Tag} --- Report Android IAP Order -> orderType:{orderType} productID:{productID} blevel:{blevel}");
|
||||
new GoogleOrderRequest(orderType, productID, subscriptionID, google.purchaseToken, blevel).Send();
|
||||
}
|
||||
}
|
||||
#elif UNITY_IOS
|
||||
|
|
@ -619,6 +622,7 @@ namespace Guru
|
|||
}
|
||||
AddReceipt(receipt);
|
||||
new AppleOrderRequest(orderType, args.purchasedProduct.definition.id, receipt,blevel).Send();
|
||||
Debug.Log($"{Tag} --- Report iOS IAP Order -> orderType:{orderType} productID:{args.purchasedProduct.definition.id} blevel:{blevel}");
|
||||
#endif
|
||||
}
|
||||
catch (Exception e)
|
||||
|
|
|
|||
Loading…
Reference in New Issue