Hi, I would like to know this as well.
I’m using version 2.2.1 for the core (the one from Package Manager), and version 2.2.5 for the package (the one from Services). Using them on Unity 2019.2.21f1.
First purchase of a subscription has no issue, which I use
_storeController.InitiatePurchase(product)
to purchase.
When I detected that I have an existing subscription from the same group, I would then handle it with HandleSubscriptionUpgrade
.
I tried 3 various methods, but none of them worked.
- calling
SubscriptionManager.UpdateSubscriptionInAppleStore
and do nothing with the appStoreUpdateCallback
protected override void HandleSubscriptionUpgrade(Product oldProduct, Product newProduct)
{
SubscriptionManager.UpdateSubscriptionInAppleStore(newProduct, null,
(newProductArg, unknownArg) => Debug.Logger.Write($"ZR SUB: {newProductArg.definition.id}, {unknownArg}"));
}
It returned the appleStoreUpdateCallback, with only newProductArg.
A native black transparent screen just stuck there, and I could no longer interact with my app.
I could see that my app was not frozen though.
Other than the native black screen, there was no native UI that show up like how it would be when you called _storeController.InitiatePurchase
getProductId: (omitted).ads.plan1,
getCancelDate: 0001/01/01 0:00:00
getExpireDate: 2020/12/17 9:04:00
getPurchaseDate: 2020/12/17 8:59:00
getRemainingTime: 00:04:43.9027980
isAutoRenewing: True
isCancelled: False
isExpired: False
isFreeTrial: False
isSubscribed: True
UnityIAPWrapper:HandleSubscriptions Old Subscription ((omitted).ads.plan1, True)
UnityIAPWrapper:HandleSubscriptions New Subscription ((omitted).ads.plan3, False)
ZR SUB: (omitted).ads.plan3,
- calling
SubscriptionManager.UpdateSubscriptionInAppleStore
and then call _storeController.InitiatePurchase(product)
during the appleStoreUpdateCallback
protected override void HandleSubscriptionUpgrade(Product oldProduct, Product newProduct)
{
SubscriptionManager.UpdateSubscriptionInAppleStore(newProduct, null, (newProductArg, unknownArg) =>
_storeController.InitiatePurchase(newProductArg));
}
This would return me error saying its a duplicate transaction.
The transaction ID is indeed the same as the old subscription purchased.
The new subscription was never succeeded.
And I’m not sure why is there a google message at the bottom.
getProductId: (omitted).ads.plan1,
getCancelDate: 0001/01/01 0:00:00
getExpireDate: 2020/12/17 8:37:23
getPurchaseDate: 2020/12/17 8:32:23
getRemainingTime: 00:04:31.3692750
isAutoRenewing: True
isCancelled: False
isExpired: False
isFreeTrial: False
isSubscribed: True
UnityIAPWrapper:HandleSubscriptions Old Subscription ((omitted).ads.plan1, True)
UnityIAPWrapper:HandleSubscriptions New Subscription ((omitted).ads.plan3, False)
2020-12-17 17:32:51.631714+0900 sikaq[5706:4385522] UnityIAP: PurchaseProduct: (omitted).ads.plan3
purchase({0}): (omitted).ads.plan3
2020-12-17 17:32:51.647538+0900 sikaq[5706:4385522] UnityIAP: UpdatedTransactions
…
(omitted)
…
2020-12-17 17:33:33.943237+0900 sikaq[5706:4385522] UnityIAP: UpdatedTransactions
2020-12-17 17:33:33.943452+0900 sikaq[5706:4385522] UnityIAP: DuplicateTransaction error with product (omitted).ads.plan3 and transactionId 1000000**(omitted)**
2020-12-17 17:33:33.944888+0900 sikaq[5706:4388132] - [I-ACS023141] Purchase is a duplicate and will not be reported. Product ID: (omitted).ads.plan3
onPurchaseFailedEvent({0}): productId:(omitted).ads.plan3 message:smile:uplicate transaction occurred
Failed to purchase (omitted).ads.plan3
Error: DuplicateTransaction
- call
_storeController.InitiatePurchase(product)
without going through SubscriptionManager.UpdateSubscriptionInAppleStore
protected override void HandleSubscriptionUpgrade(Product oldProduct, Product newProduct)
{
_storeController.InitiatePurchase(newProduct);
}
This resulted the same as method 2.
getProductId: (omitted).ads.plan1,
getCancelDate: 0001/01/01 0:00:00
getExpireDate: 2020/12/17 8:10:13
getPurchaseDate: 2020/12/17 8:05:13
getRemainingTime: 00:04:29.6287660
isAutoRenewing: True
isCancelled: False
isExpired: False
isFreeTrial: False
isSubscribed: True
UnityIAPWrapper:HandleSubscriptions Old Subscription ((omitted).ads.plan1, True)
UnityIAPWrapper:HandleSubscriptions New Subscription ((omitted).ads.plan3, False)
2020-12-17 17:05:43.372177+0900 sikaq[5660:4376061] UnityIAP: PurchaseProduct: (omitted).ads.plan3
purchase({0}): (omitted).ads.plan3
2020-12-17 17:05:43.388351+0900 sikaq[5660:4376061] UnityIAP: UpdatedTransactions
…
(omitted)
…
2020-12-17 17:06:22.099442+0900 sikaq[5660:4376061] UnityIAP: UpdatedTransactions
2020-12-17 17:06:22.099597+0900 sikaq[5660:4376061] UnityIAP: DuplicateTransaction error with product (omitted).ads.plan3 and transactionId 1000000**(omitted)**
2020-12-17 17:06:22.100925+0900 sikaq[5660:4377823] - [I-ACS023141] Purchase is a duplicate and will not be reported. Product ID: (omitted).ads.plan3
onPurchaseFailedEvent({0}): productId:(omitted).ads.plan3 message:smile:uplicate transaction occurred
Failed to purchase (omitted).ads.plan3
Error: DuplicateTransaction