Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Getting entitlements for customer – revenuecat

What’s up some guys. I am implementing purchases_flutter in my flutter app and I have stumbled upon a problem. I have been following the revenuecat documentation on how to get customer entitlements and then grant them access to certain content. I am doing the following in my code:

    final customerInfo = Purchases.getCustomerInfo();

    final entitlements = customerInfo.entitlements.active.values.toList();

According to the documents this should work (although Purchaser is now called Customer), but I get a red marking on the ‘.entitlements’ in the second row, with the message ‘The getter ‘entitlements’ isn’t defined for the type ‘Future’ ‘. I am not sure what I am doing wrong, maybe I am missing something in the documentation. Would appreciate any help I can get. Thanks in advance!

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You should await the call to Purchases.getCustomerInfo() first like the following code snippet:

final customerInfo = await Purchases.getCustomerInfo();
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading