Skip to main content
Solved

Flutter : firebase google authentication cycle with revenuecat

  • September 25, 2021
  • 1 reply
  • 394 views

Forum|alt.badge.img+4

 

we are working on a flutter app that uses firebase authentication and each user has his own unique user id , first we setup the revenuecat on the lunch of the app using this 

await Purchases.setup("public_sdk_key");
secondly when the user logs in we use its unique user id in : 

await Purchases.logIn(uuid);
thirdly and when the user logs out we use 
await Purchases.logOut();
is this the best practice and how can we handle if the user terminated his subscription while using the app

Best answer by ryan

Hey @Iqraa-lamha

That setup sounds correct! You should inspect the PurchaserInfo object to determine if the subscription for the user is still active. You won’t get pushed information if the subscription expires in the middle of app-usage, but the next time you call .getPurchaserInfo() or restart the app the latest PurchaserInfo object will be fetched.

 

The .getPurchaserInfo() call operates on a 5-minute cache, so you can call this as frequent as you’d like without worrying about rate limits, still knowing that the information won’t be more than a few minutes behind.

 

 

View original
Did this post help you find an answer to your question?
This post has been closed for comments

1 reply

ryan
RevenueCat Staff
Forum|alt.badge.img+9
  • RevenueCat Staff
  • 391 replies
  • Answer
  • September 28, 2021

Hey @Iqraa-lamha

That setup sounds correct! You should inspect the PurchaserInfo object to determine if the subscription for the user is still active. You won’t get pushed information if the subscription expires in the middle of app-usage, but the next time you call .getPurchaserInfo() or restart the app the latest PurchaserInfo object will be fetched.

 

The .getPurchaserInfo() call operates on a 5-minute cache, so you can call this as frequent as you’d like without worrying about rate limits, still knowing that the information won’t be more than a few minutes behind.

 

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings