For example this is how I would fetch the info about a user.
First I need to set the unique user id during the configuration:
Purchases.configure(“PUBLIC_KEY”).appUserID(userId).build())
Then after a purchase I could simply obtain it:
http get https://api.revenuecat.com/v1/subscribers/$USER_ID Authorization:"Bearer XXXX" Content-Type:"application/json" X-Platform:android accept:"application/json"
The problem with userID is that they will get lost, if the user deletes the app and reinstalls it, and will no longer have access to the existing purchases. The only way would be creating an email signup in the flow, which I was hoping to avoid.
The other way is to use anonymous users:
Purchases.configure(“PUBLIC_KEY”).build())
Now ReveneCat can create aliases and merge the ids upon reinstallation as long as it’s the same user in Google PlayStore that made the purchases.
This solves the problem, but now I have no way to double check the entitlement from the server side through RevenueCat’s RestAPI. Because the following doesn’t seem to work, unless I’m overlooking something
ANONOMOUS_USER_ID = Purchases.sharedInstance.appUserID
http get https://api.revenuecat.com/v1/subscribers/RCAnonymousID:945d6ad20af8402e832b897337dc4dbc Authorization:"Bearer XXXX" Content-Type:"application/json" X-Platform:android accept:"application/json"
Many Thanks