Hi there!
I'm testing the login/logout system of the RevenueCat SDK on Flutter.
I'm using the Transfer Purchase behavior from https://docs.revenuecat.com/docs/restoring-purchases.
Problem: PurchaserInfo entitlements returns empty after Purchases.logOut()
. Purchases.getPurchaserInfo()
only returns correct after I refresh the app and call Purchases.setup()
.
Steps to reproduce:
1. Enter app, call Purchases.setup()
(without appUserId).
2. Do a subscription purchase
3. Now with the user with subscription, call Purchases.login()
. The user now has a provided app id and has the subscription entitlement.
4. Call Purchases.logOut()
. Now the user has an anonymous id.
5. Call Purchases.getPurchaserInfo()
to retrieve the user's entitlements and check if the user has subscription.
Result: the user has no entitlements, even tho the user bought the subscription on that same device.
But…
6. Refresh the app and call Purchases.setup()
. Now when Purchases.getPurchaserInfo()
is called, it returns the subscription bought by the user.
Am I doing something wrong? should I call Purchases.setup()
after Purchases.logOut()
? Also, I'm calling setup every time the app opens up, is this correct?
Best answer by ryan
View original