Question

UserId strategy when migrating paid Android app to RevenueCat

  • 20 August 2023
  • 4 replies
  • 35 views

Userlevel 1
Badge +3

I have a paid Android app which I want to migrate to RevenueCat and also make free (converting each app purchase to an equivalent in-app purchase - but I’m not talking about the details of this here).

 

Since the app is currently paid, I do a license check using Google Play’s License Verification Library. This library gives a userId which is unique for that user-app combination and will not change in the future even with uninstall-reinstall etc. This userId does not expose any information about the user (looks like some meaningless hash).

 

At first glance, this looks like a good userId to set through the RevenueCat SDK. Even after the app is made free, the License Verification Library can be used to fetch the userId, and so also fetch any entitlements through the RevenueCat SDK.

 

Now, this will work for the Android app, but a new userId strategy will be needed once I expand to other platforms. I’m not worried about this for now, however.

 

Has anyone used this strategy before? Any issues I may face?


4 replies

Userlevel 1
Badge +3

Note: the userId from Google Play’s App Licensing is of the regex format:

[A-Za-z0-9]{34}==

So 34 alphanumeric characters followed by two equals signs.

At least, those are the ones I’ve seen in testing.

 

Userlevel 1
Badge +3

A second question: once I detect the user has paid for the app (using Google’s App Licensing) how to use the RC SDK to grant the corresponding Entitlement?

Userlevel 6
Badge +8

Hey @mark147!

If that userId provided from the verification library is stable, and can be referenced long term for the user, it sounds like a great option for an app user ID in RevenueCat. I’ve not used it myself, but we’ll leave the thread open for anyone else that might have done something similar!

A second question: once I detect the user has paid for the app (using Google’s App Licensing) how to use the RC SDK to grant the corresponding Entitlement?

You’ll only be able to grant entitlements from your server or from the dashboard directly for this case. You can read more about the endpoint in our docs here: https://www.revenuecat.com/reference/grant-a-promotional-entitlement

Userlevel 1
Badge +3

Thanks for your reply.

It would be good if RC could come up with an out-of-the-box solution for migrating paid-apps this way. Or at least a way of recording app purchases (not only in-app purchases). The app purchase data is signed, so that could be securely processed on the RC end.

Reply