RevenueCat / purchases-ios

In-app purchases and subscriptions made easy. Support for iOS, watchOS, tvOS, macOS, and visionOS.
https://www.revenuecat.com/
MIT License
2.36k stars 319 forks source link

in-app purchases handling on SK2 #4363

Open morisgateno-appsflyer opened 1 month ago

morisgateno-appsflyer commented 1 month ago

Hi.

The below function seems not to handle the consumable purchase. https://github.com/RevenueCat/purchases-ios/blob/7b1d0b3044b2fce6c334931adb5d9c0ee3a7fd2d/Sources/Purchasing/StoreKit2/StoreKit2TransactionListener.swift#L121

On the other hand, when doing observerMode = true, the purchase is handled on: https://github.com/RevenueCat/purchases-ios/blob/7b1d0b3044b2fce6c334931adb5d9c0ee3a7fd2d/Sources/Purchasing/StoreKit2/Observer%20Mode/StoreKit2ObserverModePurchaseDetector.swift#L61

So technically when not observing the the consumables are not observed?

Thanks. Moris.

RCGitBot commented 1 month ago

👀 We've just linked this issue to our internal tracker and notified the team. Thank you for reporting, we're checking this out!

fire-at-will commented 1 month ago

Hi @morisgateno-appsflyer, thanks for filing this ticket!

Would you mind providing some additional info about the issue you're seeing so we can get a better understanding of what's going on?

Thanks!

morisgateno-appsflyer commented 1 month ago

I want to debug what happens to a purchase observer after I purchase a consumable product. StoreKit2TransactionListener class seems to catch only subscriptions and non-consumables.

I see you use Transaction.update which actually make sense it will not catch consumable in-apps.

How can I catch the consumable in-apps if so?

What is the StoreKit2ObserverModePurchaseDetector?

Thanks. Moris.