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.
Im not using a login system, Is there an instruction sheet on this Ryan to set this up in revenueCat?
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
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.
Hey @appstrader let us know if this works! How are you associating the UUID in shared preferences with the transaction in RevenueCat?
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.