CAT-1509: Update SDK to reflect new SK2 Observer Mode Changes
Motivation
In light of https://github.com/RevenueCat/purchases-ios/pull/3853, we no longer require developers to call handleObserverModePurchase() when using Observer Mode with StoreKit2. To reflect these changes, a few changes needed to be made to the SDK's interface.
Changes:
- Obsoleted
configure(apiKey:appUserID:observerMode:storeKitVersion): this function was obsoleted since the basicconfigurefunctions should be as simple as possible. If a developer needs to use Observer Mode with StoreKit 1, they can use the Configuration.Builder's.with(observerMode:storeKitVersion)function. This function was only used in the 5.0 betas, so this won't be a breaking change for developers upgrading from 4.x versions. - Un-obsoleted the
configure(apiKey:appUserID:observerMode)function and changed it to use the.defaultStoreKitVersion (which currently uses StoreKit 2) - Removed the warning log that appears when a developer uses StoreKit 2 with observer mode, instructing them to call
handleObserverModePurchase()after making a purchase. - Updated documentation to reflect these changes, including the Version 5 migration guide.
- Updated the tests to reflect these changes
Other Notes
This PR should only be merged if https://github.com/RevenueCat/purchases-ios/pull/3853 is also merged.
Sorry to keep going back and forth on this, but I'm confused:
Un-obsoleted the configure(apiKey:appUserID:observerMode) function and changed it to use the .default StoreKitVersion (which currently uses StoreKit 2)
Would this lead to the worst-case scenario? We need to know the version in order to set up the observing code, and if we default to SK2 then we're assuming that the customer's implementation is also SK2, which the vast majority of the time will be wrong.
Also we would make that API not breaking, which in turn means they wouldn't even know about it, right?
Shouldn't we be forcing anyone who's using observer mode to tell us which version to use?
@aboedo You're totally right! I've updated the PR to leave the observer mode configure functions/builders alone and just update the documentation and log messages 😄