Open lukepighetti opened 9 months ago
👀 We've just linked this issue to our internal tracker and notified the team. Thank you for reporting, we're checking this out!
Hi @lukepighetti,
That's strange, any chance you could print the result of !await Purchases.isAnonymous
as well as the app user ID?
Hi guys! Also saw this strange situation couple weeks ago. As I understood it's not a regular issue, just happened sometimes.
Maybe it's better to not to throw exception in this case? Just do the same checking await Purchases.isAnonymous
inside logOut function and make a log out only if it's false without throwing exceptions or logging errors otherwise.
Anyway, thanks for your time and your package! It's awesome
Hi all,
After discussing with the mobile engineering team we decided that since calling logOut with an anonymous iD is a non-successful state, we're going to keep this as an exception.
One thing that came up: you may have to use if (!await Purchases.isAnonymous) await Purchases.logOut();
I'm having a hard time understanding the last message posted.
if (!await Purchases.isAnonymous) Purchases.logOut();
and
if (!await Purchases.isAnonymous) await Purchases.logOut();
Should both work
and ideally, Purchases.logOut()
would just make this check internally so we don't have to
We are still seeing this error in our Crashlytics logs.
Here is the code block that we are using:
try {
if (!(await Purchases.isAnonymous)) {
await Purchases.logOut();
_log.info(
'Logged out from RevenueCat since Firebase user is null.');
}
} on PlatformException catch (e) {
PurchasesErrorCode errorCode = PurchasesErrorHelper.getErrorCode(e);
// Log error.
}
If I check that the current session is not anonymous before calling Purchases.logOut(), I still get a "user is anonymous" error