Question

Login flow with known userID flow for subscription app?

  • 24 October 2023
  • 3 replies
  • 151 views

Badge +6

I have been planning to have my app be available as only a subscription service: monthly or annual.

I was expecting to have them sign in with OAuth from Google or Apple, using Supabase Auth to handle things like sessions.  Then, once signed in/registered, update my own data `user` data table to store things about the user depending on their interactions within the app.

Now I am trying to add RevenueCat. 

I see that in the docs about Users, Purchases.configure({apiKey: <public_sdk_key>}); will generate a random ID.  Unfortunately, this will not tie into my backend of known users.  So the docs give an option to include appUserID in the config.  

My question is now about the flow.

Is it reasonable to have my subscription-only app open on the login screen, then user logs in, and once logged in, trigger the configure({apiKey: ‘123abc’, appUserID: ‘known@user.com’) API with the appUserId?

Or I can call the RC `logIn()` method later too...

 

Is there a downside to waiting to configure & load my products until after user logs in?


3 replies

Userlevel 4
Badge +6

Hey @lucksp!

 

Ill go ahead and break down your question below! 

 

Is it reasonable to have my subscription-only app open on the login screen, then user logs in, and once logged in, trigger the configure({apiKey: ‘123abc’, appUserID: ‘known@user.com’) API with the appUserId?

Or I can call the RC `logIn()` method later too...

Either of these methods will work. Configuring directly with an app user ID is a sure fire way of having the user ID known and be the correct user ID once that user logs in on your app. 

 

You can also use the login() method and pass that ID in as soon as the user logs in, the only difference here is that depending on your restore behavior and the current user ID that is logged in you might have some aliasing occur. 

 

Let me know if that helps! 

Badge +6

What’s really interesting...I got a “more info needed” response from AppStore review about the login flow:

 

Guideline 2.1 - Information Needed

  • Why does your app require users to register or log in to access your app's content and features?

 

So…it made me wonder, for those with logins, why do we require login flow when we could, in theory, rely on RevenueCat’s user DB? I think I know the answer why and how to respond, but it’s an interesting topic

Userlevel 4
Badge +6

Sorry to hear about your rejection! Many times, this can be a case of forgetting to include products with review, or even an App Store outage that can affect sandbox purchases. If your app is working in sandbox mode while testing on your own devices, this is likely an issue with the App Store.

 

Take a look at our docs page geared toward App Store rejections, and feel free to follow up with any additional questions you may have.

 

In theory you could completely forgo the login logic on your end and RevenueCat would work just fine. You would just want to use our anonymous ID’s which would be automatically generated when configuring the SDK on the device. It is more of a preference on your end on how you want your app to work and if it requires a login for everything else in the the app! 

Reply