bizz84 / SwiftyStoreKit

Lightweight In App Purchases Swift framework for iOS 8.0+, tvOS 9.0+ and macOS 10.10+ ⛺
MIT License
6.56k stars 796 forks source link

Purchase function returns success without purchasing product #657

Open tejaskdubal opened 2 years ago

tejaskdubal commented 2 years ago

Bug Report

Calling SwiftyStoreKit.purchaseProduct does not show purchase dialog It return callback with success with old transaction details

To Reproduce Steps to reproduce the behaviour:

  1. Existing subscription status is EXPIRED
  2. User try to buy a new subscription
  3. Call SwiftyStoreKit.purchaseProduct
  4. callback return success with old transaction details without showing purchase dialog

Expected behaviour After calling SwiftyStoreKit.purchaseProduct app should display purchase dialog

Platform Information

Additional context

Very in-consistent issue reproduced for some of the users

Niraj91 commented 2 years ago

@tejaskdubal I have the same issue, did find any solutions?

MrPans commented 3 months ago

Same issue with you. SwiftyStoreKit will implement paymentQueue(_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction]) and handle transactions. In my case, it found a transaction with .restored state, but send it to paymentsController. It may be should send to restorePurchasesController?

image

My solution is use original SKPayment API to fix this problem.

DanielZanchi commented 2 months ago

same issue for me. Did this happen for you also in production? I'm experiencing this in testflight at the moment with only one device