adaptyteam / AdaptySDK-iOS

iOS SDK for growing mobile in-app purchases
https://docs.adapty.io/docs/quickstart
MIT License
378 stars 38 forks source link

Add StoreKit 2 `Product` to `AdaptyPaywallProduct` #72

Closed RobertDresler closed 1 week ago

RobertDresler commented 10 months ago

Currently there is just SKProduct in AdaptyPaywallProduct. We want to use StoreKit 2 Product instead. I checked that there is already logic (fetchSK2Products and fetchSK2ProductsInSameOrder methods) for fetching and caching StoreKit 2 Products, so is it possible to add it to AdaptyPaywallProduct?

RobertDresler commented 10 months ago

I created PR implementing my solution (https://github.com/adaptyteam/AdaptySDK-iOS/pull/73). Maybe it would be better to fetch products from both StoreKit versions simultaneously.

x401om commented 9 months ago

Hey @RobertDresler!

Apologies for the delayed response.

Thanks a lot for the issue and the PR. We've taken a good look at what you're suggesting, but unfortunately, we can't merge your PR at the moment. The thing is, the proposed solution might lead to very slow performance of functions since requests to SK1 and SK2 could take a significant amount of time.

If you keep an eye on our updates, you'll see that we're gradually adding support for Store Kit 2 features as needed. However, our main purchase flow still operates through Store Kit 1. I suppose that in the foreseeable future, we might fully transition to the new system, but that would require some pretty serious architectural overhauls within our SDK.

Nevertheless, could you describe why you need access to SK2 product? What's lacking in the existing fields?

RobertDresler commented 9 months ago

@x401om the thing is, we have custom designed paywalls inside our app and we need to format prices and StoreKit 2 just offers much better API for this. I think there should be way to offer working with modern StoreKit 2 Products. There should be at least way to get StoreKit 2 Products for those, who wants it, e.g. by setting StoreKit2Usage.

vladimirDarksy commented 5 months ago

Hey @x401om , any update for this enhancement? Nowadays apple already depreciate StoreKit_V1 with iOS 18.

image

https://developer.apple.com/app-store/whats-new/#subscription-updates

So our company wants to understand if you plan to integrate StoreKit_V2 ? Thanks

x401om commented 5 months ago

Hey, @vladimirDarksy! We are aware of this deprecation, so no worries here. The original StoreKit is still available and will work, but it will not receive any updates. And yes, we have StoreKit 2 support in our roadmap. Hopefully, it will be done even before the iOS 18 release.

x401om commented 1 week ago

Hi @RobertDresler @vladimirDarksy, we’ve released version 3.2.0 with full SK2 support. Now, you can use the sk2Product value from AdaptyProduct.