Solved

Subscriptions valid for one device not 100 devices on one subscription ?

  • 2 December 2021
  • 6 replies
  • 45 views

Badge +4

I have worked for businesses where all their employees use the same google play account to install apps, how can you setup a subscription so one subscription allows one device rather than pay once and use the same app on 100 devices ?

Im sure this question must have been asked before so I’m hoping this can be done.

Many thanks

icon

Best answer by ryan 2 December 2021, 17:09

View original

6 replies

Userlevel 5
Badge +9

Seems related to this post: 

 

However, if you do not have a login system where you’re getting the App User ID from your authentication system, you may be able to simplify what you’re after by generating a UUID for each install and setting that as the App User ID. Then if 100 ppl logged in with the same Google Play account on 100 devices, each one would still have a unique App User ID, and each customer would need to restore purchases to “transfer” the subscription to their account which would remove it from anyone else.

Badge +4

Im not using a login system, Is there an instruction sheet on this Ryan to set this up in revenueCat?

Badge +4

Im thinking If i go with this example below

private static String uniqueID = null;
private static final String PREF_UNIQUE_ID = "PREF_UNIQUE_ID";

public synchronized static String id(Context context) {
if (uniqueID == null) {
SharedPreferences sharedPrefs = context.getSharedPreferences(PREF_UNIQUE_ID, Context.MODE_PRIVATE);
uniqueID = sharedPrefs.getString(PREF_UNIQUE_ID, null);
if (uniqueID == null) {
uniqueID = UUID.randomUUID().toString();
Editor editor = sharedPrefs.edit();
editor.putString(PREF_UNIQUE_ID, uniqueID);
editor.commit();
}
}
return uniqueID;
}

If I generate a UUID on a sale and store it in preferences and at the same time use the UUID on the sale details.

I believe in the checkForProEntitlement function I should be able to check for the same UUID being returned from revenueCat to support this is a valid subscribed device, otherwise the new device would need to subscribe so in essence thats one subscription per device. 

Now I need one of those magic reveneCat step by step documents to make that bit more obvious what I send to revenueCat and have to extract the UUID from the checkForProEntitlement

Hope this makes complete sense !!

Thank you

Badge +4

Finally figured out how to do this no doubt I will find out if its working correctly once people start to subscribe to the app.

 

Userlevel 5
Badge +9

Hey @appstrader let us know if this works! How are you associating the UUID in shared preferences with the transaction in RevenueCat?

Badge +4

Sorry never seen any replies, 

Basically I use the code generated by the purchasing device, then check this number when the app is started if the code does not match keep the app in an unsubscribed state, 

 

As only one device has the magic key and it cant be passed to the other clients so only one client will only ever be subscribed other devices will never sign into the subscription state due to the locked key.

Reply