Here I am instantiating the Purchases SDK:
So according the docs, if I do not provide the app user ID, the Revenuecat should generate one:
But when I try to print the app user id, it is returning null? Also I am confused with Purchases.logIn() and Purchases.logOut() methods as I can not figure out their purpose. Can someone also explain the following scenarios:
1)Let’s say user purchases subscription successfully and exits the app(not log outs, just closes the app) and when the user opens the app later how do we know that user is premium user?
2)Let’s say user purchases subscription successfully and accidentally deletes the app. When the user downloads the app again how we gonna restore his purchase? I know there is Purchases.restorePurchase() but how does it know if the user has purchases the subscription before? Can you please explain it?
P.S. Do not mention the docs please explain it in a simple way if possible.