In my app, I require all users to create an account and subscribe before using. RevenueCat handles this. However, when a user who does not subscribe signs up/logs in on a users phone who does have an account, the entitlement transfers over to the other account. I want to prevent this. Below is my code that I have, would appreciate if any know knows how to do this:
Purchases.shared.purchase(package: pkg) { (transaction, customerInfo, error, userCancelled) in
if userCancelled {
print("User cancelled the transaction.")
return
}
if let error = error {
// Handle errors
print("Error occurred during transaction: \(error.localizedDescription)")
return
}
if customerInfo?.entitlements.all["All Access"]?.isActive == true {
// Activate Account
print("Account is active")
DispatchQueue.main.asyncAfter(deadline: .now() + 1.5) {
authViewModel.isActive = true
authViewModel.updateSubscriptionStatus(status: authViewModel.isActive)
}
} else {
print("User does not have an active subscription.")
self.isSpinningViewShown = false
}
}
RevenueCat community told me to “Keep with original app user id”. I am trying to implement this, however, I do not know how to.