Identifying users of Google Play subscriptions

How to implement (auto-renewable) Android app subscriptions.

I have read the documentation

and as far as I understand, the process is as follows:

  • The user subscribes to such subscriptions in the application. This will create a purchase token.
  • The app sends this token to the server along with something to identify this user
  • The server will store this Purchase token with this user and will mark the subscription as valid.
  • the server checks this Purchase token through http-api periodically (usually once a day) with something like a cronjob
  • If the subscription is already invalid, the subscription will be flagged as invalid on the server side.
  • If the application makes requests to the server for resources that need a subscription, the client will send this user ID string along with the requests. We then check the database if this user's subscription is still marked as valid.

Now my question is, how are we supposed to identify these users? Do we have a simple user ID that we can share between our application and our server? or should we use something else? What's the best practice here?

We already signed up for ios and we used the uuid of the device to identify users (at least while we could use uuid).


In the answer below, we have to generate a unique ID. This would be unique to each device (or app installation). But if the user changes their device or reinstalls the app, this ID will no longer be the same. So I'm not sure how the process is used in this case. I thought of something like this:

  • The user is signed in with the same Google Play account on their second device.
  • When the application starts (or becomes active), we will receive user subscriptions
  • We will then retrieve this purchase token from the subscription and send it along with the new unique ID to our backend server, as if the user made a new subscription.

Will this be the right process? And the purchase token remains the same as on the first device?


Ok my question about user identification was answered, the link provided provides enough information. I'll be asking additional questions in new threads on SO if I have some.

+3


source to share


1 answer


This link may be useful to you as you want to uniquely identify users. Please note that the user's personal information depends only on Google. And you should avoid getting the user's personal information. http://www.pocketmagic.net/2011/02/android-unique-device-id/#.URIe_B3Wgr7



-2


source







All Articles