-
Notifications
You must be signed in to change notification settings - Fork 316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
customEntitlementsComputation
: new method to switch users
#2437
customEntitlementsComputation
: new method to switch users
#2437
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. Maybe we can link to this method in the new Purchases.configure
method.
Examples/testCustomEntitlementsComputation/testCustomEntitlementsComputation/ContentView.swift
Outdated
Show resolved
Hide resolved
Just a heads up that I'm taking over this PR. Will address current comments first then test it manually and add unit tests. |
/// with the newAppUserID. | ||
/// | ||
@objc(switchUserTo:) | ||
func switchUser(to newAppUserID: String) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It definitely feels some users might inadvertently use this method and it will error silently for them. I wonder if we should just crash if they are not in custom entitlement computation mode... Also, moving this to a different package could avoid this confusion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Solved by #2440.
Tested this manually and seems to work fine. Also added some unit tests though if we end up going with the approach of building a different package, we might have to move them as well... In any case, this is mostly final now. |
72e6157
to
41edbe0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one comment about the Obj-C method
ea7b5d9
into
andy/sdk-3068-dangeroussetting-that-disables_rebased
Adds a new method to switch users without posting to the backend for Custom Entitlements Computation mode.