Obsoleted Purchases.createAlias/identify/reset and simplified IdentityManager implementation#974
Conversation
17590e8 to
046acfc
Compare
|
I removed the calls to these methods from @available(swift, obsoleted: 1, ...)I'm going to fix this for all methods in |
The right solution is to just use |
|
🤔 I think you might still be able to obsolete them by instead of marking @available(iOS, obsoleted: 1, renamed: "getCustomerInfo(completion:)")
@available(tvOS, obsoleted: 1, renamed: "getCustomerInfo(completion:)")
@available(watchOS, obsoleted: 1, renamed: "getCustomerInfo(completion:)")
@available(macOS, obsoleted: 1, renamed: "getCustomerInfo(completion:)")
@objc func purchaserInfo(completion: @escaping (CustomerInfo?, Error?) -> Void) { |
|
That's essentially the same as But regardless, I'm still unsure about the |
|
So I guess that's always been an issue? Should we just have the |
|
to clarify, the thing that I tested out locally was specifying all platforms separately instead of |
|
Right, thanks for checking that :) |
046acfc to
3e77b32
Compare
|
I fixed this in #981. |
…ective-C See discussion in RevenueCat#974. Since they were only marked as `obsoleted` for Swift, Objective-C was able to call them.
3e77b32 to
93e7f1d
Compare
|
This branch is ready, but per my conversation with @aboedo, waiting to hear from the support team to make sure it's not too premature to deprecate these methods. |
There was a problem hiding this comment.
Let's add a message to all these fatalError()s like reset obsoleted, please use logOut
There was a problem hiding this comment.
The method is unreachable, it's impossible to call it 😛
taquitos
left a comment
There was a problem hiding this comment.
Pending support's input, I like this very much 😺
93e7f1d to
135c711
Compare
…yManager implementation Fixes RevenueCat#732. Instead of worrying about whether `IdentityManager.configure` was idempotent or if the implementation was correct, I realized that `Purchases` never called that method after its initialization Therefore, to simplify the whole implementation, the `configure` part is now in the constructor. Subsequent `logIn`/`logOut` calls are the only way to change the identity. Some of this code was tangled with some of the deprecations in `IdentityManager`, so to aid in this refactor, I `obsoleted` [3 methods that were already `deprecated` in version 3.13.0](https://github.com/RevenueCat/purchases-ios/blob/3.13.0/Purchases/Public/RCPurchases.h#L205-L224). This allowed me to remove the associated tests instead of changing them to use the new API. Following RevenueCat#950, these methods are now separate in `Obsoletions.swift`, and they point to the new methods. The remaining tests in `PurchasesTests` all pass, and the ones in `IdentityManagerTests` have been converted to initializing new `IdentityManager` instances. Those pass as well, so I feel confident in this refactor 💪
135c711 to
af1f3a0
Compare
|
Just to confirm @taquitos, you're good if we merge this now? :) |
|
@NachoSoto let's merge to help unblock other PRs. We can undo this if we get feedback that suggests it's not the right move. |
|
Great thanks! |
Fixes [sc-10159]. Based on top of #974 because it contains a significant simplification of `IdentityManager` that makes this a lot easier. Note that `Purchases.logIn` will still fail with an error when trying to use an empty string. This PR does not change that behavior.
|
@NachoSoto @taquitos let's reflect this in our v4 migration guide in that case. Shortcut link: https://app.shortcut.com/revenuecat/story/11512/update-migration-guide-to-include-removal-of-identity-v2 |

Fixes #732. Instead of worrying about whether
IdentityManager.configurewas idempotent or if the implementation was correct, I realized thatPurchasesnever called that method after its initializationTherefore, to simplify the whole implementation, the
configurepart is now in the constructor. SubsequentlogIn/logOutcalls are the only way to change the identity.Some of this code was tangled with some of the deprecations in
IdentityManager, so to aid in this refactor, Iobsoleted3 methods that were alreadydeprecatedin version 3.13.0.This allowed me to remove the associated tests instead of changing them to use the new API. Following #950, these methods are now separate in
Obsoletions.swift, and they point to the new methods.The remaining tests in
PurchasesTestsall pass, and the ones inIdentityManagerTestshave been converted to initializing newIdentityManagerinstances. Those pass as well, so I feel confident in this refactor 💪