I’m new to RevenueCat, read the setup docs, watched some YouTube videos, and I got everything working so far. But I ran into a problem after making a test purchase on a real device.
A- In viewDidLoad I run fetchCustomerInfo() to check if the user has subscribed or not. When the user hasn’t, the subscribe and restore buttons are shown. I press the subscribeButton and the transaction is successful. I stop the app, and when I restart, the buttons don’t show, which is correct.
B- In Xcode
I go to Debug
> StoreKit
> ManageTransactions
> I delete
the Transaction, and it says No Transaction
.
C- I stop the app, open the app back up, and the buttons don’t show, but they should show because there aren't any transactions. I check the flow in step 2 again and it still says No Transaction.
D- I go to the RevenueCat console
, Projects > My Project > iOS > Customers
> Active/Sandbox/Non-Subscription/Expired
, there aren't any customers in either of them. There is no data whatsoever.
E- At the top of the page, I tried to toggle Sandbox data, but it’s grayed out, and I can't interact with it in any way. The little check box doesn’t do anything when I click it.
My Questions:
1- Using the fetchCustomerInfo() code, why does info.entitlements.all>"myRevenueCatEntitlementID"]?.isActive
still think there is an active subscription?
2- If there aren't any customers in the RevenueCat console, why does it think that there are, or better yet, why does it think this particular app has an active Subscription?
3- If there aren't any customers, how does it associate this app with the initial subscription that I made, which is no longer valid?
func fetchCustomerInfo() {
Purchases.shared.getCustomerInfo { (info, error)in
if let error = error as? RevenueCat.ErrorCode { return }
guard let info = info else { return }
let isActive = info.entitlements.all/"myRevenueCatEntitlementID"]?.isActive ?? false
if isActive { // after deleting a transaction in Xcode, this is always true even though there aren't any customers in the RevenueCat console
hideSubscribeAndRestoreButtons()
} else {
showSubscribeAndRestoreButtons()
}
}
}