I would like to know how to reset a RevenueCat-enabled Mac Catalyst app's in-app purchase state so that I can test the app's in-purchases with different sandbox users and with local StoreKit testing. Below is a more in-depth description of the issue I’ve had and how I've (so far unsuccessfully) tried to resolve it.
(Note: in what follows, references to "app user IDs" are always to the anonymous app user IDs that RevenueCat automatically provides.)
Prior to the introduction of local StoreKit testing for in-app purchases, it was useful to have multiple sandbox accounts to test in-app purchases (since a developer could use any one sandbox account only once to test a particular IAP— as you probably know, there's no way to "roll back" a purchase in a single sandbox account to try testing it again with that account).
When I wanted to test an in-app purchase with a new sandbox user on the same iOS / iPadOS device on which a previous sandbox user was logged in, the following procedure reliably reset the app on the device, so that I could log in on that device with the new sandbox user:
On the iOS / iPadOS device…
I deleted the app.
In the Settings app -> App Store, I signed out of the sandbox account listed there.
I restarted the device.
I re-installed the app using Xcode.
Now I am developing a Mac Catalyst version of the app, and the analogous version of the above procedure (described below) fails to reset the app on the Mac— no matter what I do on the Mac (including trying to sign in with a new Sandbox account via Preferences in the App Store app), the app continues to register the same RevenueCat App User ID for the previously-signed-in sandbox user. The result is that on the Mac I can neither try out in-app purchases with a different sandbox user, nor make use of local StoreKit testing on the Mac (after I had previously logged in on it as a particular sandbox user).
Here's the “reset” procedure I've tried:
On the Mac…
I deleted Xcode's entire Derived Data folder (in which is contained the Mac Catalyst app). I also looked for any other preferences / traces of the app on the Mac, and deleted whatever I found.
In the App Store app -> Preferences, I signed out of the sandbox account listed there.
I restarted the Mac.
I re-installed the app on the Mac using Xcode.
As noted above, this procedure fails to reset the app on the Mac— no matter what I do on the Mac (including trying to sign in with a new Sandbox account via Preferences in the App Store app), the app continues to register the same RevenueCat App User ID for the previously-signed-in sandbox user. Again, the result is that on the Mac I can neither try out in-app purchases with a different sandbox user, nor make use of local StoreKit testing on the Mac (after I had previously logged in as a particular sandbox user).
To try resolving the issue, I could, of course, simply delete the app user ID via the RevenueCat website. I'm a little wary to do that, though, given that (1) it's irreversible and (2) I want to be absolutely sure I don't accidentally delete the ID for a user with live purchases. I don't think I'll end up doing that with the "stuck" app user ID on the Mac noted above, since it is listed as one of the sandbox app user IDs in my RevenueCat account; but my RevenueCat account also strangely lists the app user ID as one that was "first seen using the app" back in March, despite my logging in to the Mac with the associated sandbox user account for the first time just a few days ago. (That sandbox user account made no purchases prior to a couple days ago, and the stuck user ID has no aliases.) Given RevenueCat's reporting that the user ID was "first seen using the app" back in March, I worry that the user ID somehow got associated with some other (potentially "live purchase") user's use of the app.
If anyone has any suggestions for resetting the app on the Mac (for use with different sandbox users and/or local StoreKit testing), I'd be happy to hear those tips. (And, of course, if any of you think the best idea is still deletion of the app user ID on the RevenueCat website, I'd be happy to hear that, too.) Thanks!
Best answer by Chad MohlerView original