SwiftyStoreKit icon indicating copy to clipboard operation
SwiftyStoreKit copied to clipboard

Autorenewable subsciption in group cause some issue iOS

Open StackHelp opened this issue 5 years ago • 3 comments

Platform

  • [x] iOS

In-app purchase type

  • [x] Auto-Renewable Subscription

Environment

  • [x] Sandbox

Version

0.14.1

Related issues

ℹ Please replace this with references to similar issues (either open or already closed).

Report

Issue summary

I have 3 products in the same group and try to use auto-renewable subscriptions with it. FIrst I subscribe to a basic product and after some time tried to subscribe standard package and both gonna subscribe.

What did you expect to happen

I think the latest subscription should stand and all other subscriptions gonna canceled automatically.

What happened instead

Instead, I got 2 products here in subscribe list to the same group. I don't think so this should happen.

Here is response data

      kr.co.starterPackage is valid until 2019-03-09 08:06:30 +0000
      DATA ---- Optional("Product Purchased")

      The user has never purchased kr.co.proPackage
      DATA ---- Optional("Product Not Purchased")

      kr.co.standardPackage is valid until 2019-03-09 08:07:04 +0000
      DATA ---- Optional("Product Purchased")

Basically, I want to know which one is active subscription right now.

StackHelp avatar Mar 09 '19 08:03 StackHelp

They would both be active. For example, if you are on a monthly sub and then upgrade to yearly, you still get the rest of the month + 1 year.

What really matters is the new expiration date. The example below gets you the latest expiration date from multiple product ids. So in your case it would return the standardPackage expiration date.

let purchaseResult = SwiftyStoreKit.verifySubscriptions(productIds: productIds, inReceipt: receipt)
switch purchaseResult {
case .purchased(let expiryDate, let items):
print("\(productIds) are valid until \(expiryDate)\n\(items)\n")

ArturoLee avatar Mar 14 '19 15:03 ArturoLee

@ArturoLee I have 3 monthly packages for a different purpose here. I do handle it with latest subscription date right now. Thanks

StackHelp avatar Mar 15 '19 03:03 StackHelp

Have same question here. I set my products into same group and also all of them have same level. As I have put my products into same level it should follow downgrade system. But I can see that expiration date for both product is parallel not sequential(which it should be). I would like to know if user will be charged for both purchase.

sz-ashik440 avatar Mar 22 '21 14:03 sz-ashik440