Hello,
I am testing purchases in a sandbox environment and I don’t understand one thing (is this expected behavior ?) this is IOS app written in swift, using firebase for authentication
step1: A new user opens the app and chooses to sign in via Apple account (provided by firebase auth)
step2: They are presented with a paywall, they make the purchase and continue using the service.
step3: They press “logout” which triggers firebase auth sign out and
Purchases.shared.logOut { custInfo, err in
if let err = err {
print("Error while logging out revenuecat: \(err.localizedDescription)")
} else {
print("Log out successful from revcat and firebase")
completion(nil)
}
}
step4: The user logs in again via the same apple account
step5: The user is presented with a paywall again, even though the purchase was already made for this account.
I am setting the user’s ID after logging in to the firebase’s UID one:
Auth.auth().addStateDidChangeListener() { auth, user in
if user != nil {
self.signedIn = true
Purchases.shared.logIn(user!.uid) { customerInfo, created, error in
if let error = error {
print("error occured: \(error.localizedDescription)")
}
print("created successful: \(created)")
print("Logged in to revenuecat with userId successful")
}
print("Auth state changed, is signed in")
} else {
self.signedIn = false
print("Auth state changed, is signed out")
}
}
Is this intended behavior?