Application with multiple users in one device - Inapp subscription

I am developing an application with a subscription function using Inapp Billing v3. There is a login mechanism to access the application. If user "X" subscribes to the function and logs out. If the user "Y" logs into the application on one device, and if the user tries to subscribe, the Google game says that the product has already been purchased. Are synchronization-based subscriptions synchronized on the device and not based on the user who signed up for the application? If so, how can I implement my script?

+6
source share
2 answers

The Google Play subscription in the app is tied to a Google Play account. Since the Google account does not change for a long time, the subscription is considered valid for this account, and you cannot purchase it again.

If you want to replace the Google account system with your accounts, you need to β€œtrick” Google Play. What you can do is create a pool of several different subscription accounts to subscribe (for example, subscription # 1, subscription # 2, etc.). When you sign up, you enter your own username as an optional parameter in the developerPayload field.

Now that you have listed all the available subscriptions, you check to see if it has the current user account in the developerPayload field. If not, then you think that the current user does not have a subscription and allows you to subscribe using the first unused subscription from the subscription pool (subscription # 1, subscription # 2, etc.) that you created. Just make sure that the number of subscribers in your pool is greater than the number of users on one device that you could have.

This is not an easy way, but rather a hoax to find a desktop for your situation.

+3
source

Currently, google IAB only supports one account (Primary gmail account on the device) on one device. But from Android 4.2, a multi-user feature is available, and google is working on the same IAB support.

+1
source

Source: https://habr.com/ru/post/943894/


All Articles