I have an application that uses FirebaseAuth as my authentication method. I want to implement an in-app purchase but there is a problem. Users have a specific email for their GooglePlay and can pay one time for my monthly/yearly subscription but create more than one account in my app using FirebaseAuth and keep using premium on all of their accounts. How to prevent users from purchasing my subscription and use it for multiple FirebaseAuth accounts? Is there any way to connect FirebaseAuth with in-app purchases?
CodePudding user response:
You'll typically associate the in-app payment with a specific Firebase Authentication user through their UID.
For example, a common way to implement user-specific in-app purchases it by adding a custom claim to the user's ID token when the purchase is completed. Since this happens in a trusted environment, you can ensure it happens only once per purchase.