I just released a new version of my app on the App Store. When users who are already subscribed download and update to the new version, they’re getting my “Subscribe Now” paywall.
If they tap “Restore Purchases”, then it correctly restores the purchase and shows that they are now subscribed.
My app doesn’t have user authentication, so I’m relying on RevenueCat to generate a random App User ID. This is how I’m instantiating the RevenueCat SDK:
// *** Configure RevenueCat in-app purchases *** //
Purchases.logLevel = .debug
Purchases.configure(withAPIKey: API_KEY_HERE, appUserID: nil, observerMode: false, userDefaults: UserDefaults(suiteName: "NAME HERE"))
Purchases.shared.delegate = self
I’m guessing what’s happening is when a user updates the app and opens it, the app instantiates the RevenueCat SDK and generates a new anonymous ID, which isn’t aliased back to the original subscription unless they tap “Restore Purchase” first.
My question is--- is there any way to do this without having users tap “Restore Purchases” first? Tapping “Restore Purchases” is not an intuitive step they would take. If I don’t want them to have to tap “Restore Purchases” each time I update the app, would I have to add user authentication to my app?
Or, if I don’t want to go through the trouble of user authentication, is there another way of somehow generating a random app user ID myself, storing it in User Defaults (which should be preserved between app version upgrades), and then trying to retrieve it when they launch the updated version and then instantiating RevenueCat with that retrieved app user ID?
Basically, this is the iOS version of the question that another developer asked here.
Best answer by whuangView original