Post

Replies

Boosts

Views

Activity

Reply to How to know when user upgrades/downgraded/crossgrades their subscription on the client
I tried some digging into it, to get the information about downgrade from purchase history, but with no luck. Steps to reproduce: do purchase of subscription A level 1 (monthly = 5mins) do purchase of subscription B level 2 (monthly) look into Transaction.all note: only print last 5 transactions otherwise log will become long and unreadable for await result in Transaction.all { do { counter += 1 let transaction = try checkVerified(result) if counter < 5 { print("Original Transaction Identifier: \(transaction.id)") print("Product Identifier: \(transaction.productID)") print("purchaseDate: \(transaction.purchaseDate)") print("-------------------------------------") } when I try to purchase subscription B twice, the error already-purchased occurs, so StoreKit somehow has to know it is already purchased. Can it be only Sandbox/development thing? Is there any other API I'm missing? Any other ideas?
Sep ’23
Reply to How to know when user upgrades/downgraded/crossgrades their subscription on the client
Well...we also have the 2x2 setup - two plans, basic and pro, with two periods: monthly and annual. We obtained information about changing subscription types on the client side by implementing our logic. Using RenewalInfo, we can retrieve autoRenewPreference, which represents the next subscription product ID. When a change occurs, we compare it to the new ID, and then it's a matter of implementing an if-else code structure to cover all possible states (DOWNGRADE, UPGRADE, CROSSGRADE, and NO_INFO). Like this (but more complex): if ((isCurrentMonthly && isNextAnnual) || (isCurrentAnnual && isNextMonthly)) { return ChangeSubscriptionType.CROSSGRADE } Disclaimer: Don't know if it's the best solution, but it's 100% working for us ;).
Dec ’23