I’ve successfully, it seems, integrate revenue cat with my firebase auth backend. Now I’m wondering what is the recommended customer journey in terms of what they do first?
Should I ensure that my users first authenticate with firebase, before allowing them to purchase an in-app subscription?
What would happen if they first purchased the subscription and then authenticated on firebase after?
Thanks for any help or suggestions.
Best answer by cody
Hey @grin_phi!
From RevenueCat’s perspective, we’ll always track purchases once our SDK is configured, either with your configured user ID or with a random anonymous ID. If you don’t want to have anonymous IDs, I’d recommend first authenticating with Firebase, and passing that identifier into RevenueCat’s SDK during configure or `login`.
From RevenueCat’s perspective, we’ll always track purchases once our SDK is configured, either with your configured user ID or with a random anonymous ID. If you don’t want to have anonymous IDs, I’d recommend first authenticating with Firebase, and passing that identifier into RevenueCat’s SDK during configure or `login`.
Auth.auth().addStateDidChangeListener { (auth, user) in
if let uid = user?.uid {
// identify Purchases SDK with new Firebase user Purchases.shared.logIn(uid, completion: { (info, created, error) in if let error { print("Sign in error: \(error.localizedDescription)") } else { print("User \(uid) signed in") } }) } }
Which I feel is passing the firebase uid to revene cat.