Skip to main content

Hey!

I wanted to make sure I understand the recommended approach of handling in-app purchases.
Let’s assume my app has only one app store in-app purchase that charges on per-month basis.
The app itself will run on IOS and is written in swift.
My current authentication flow is as follows:
the user opens the app and can log in or register via firebase with: Apple Account, Google Account, regular email + password account.

What I don’t really understand is:

  • Should I set the revenue cat userID to the firebase user ID in this case?
  • When I set the userID to firebase user ID will the subscription only be active for this single account that was used to log in?
  • Is there already some implementation that returns or informs the app when user is signed in but his purchase (membership) expired?
  • How can you implement a 7-day trial in this case?
  • The purchase is made by an apple ID account, but the beneficiary is the actual account that was used to log in in this case?
  • Is there some event that can notify the firebase app when the purchase is made? What if that api call failed once (the event fails), would that mean that the user lost their subscription somehow? (his ID was not persisted as a member)
  • How much things should I leave up to revenuecat backend/framework and what are the things that are actually needed to be implemented when integrating with firebase?

Sorry if these questions may be obvious or stupid, but I wanted to make sure I understand this correctly

Hi ​@localhostcruiser

Should I set the revenue cat userID to the firebase user ID in this case?

Yes, please see identifying users for more information.

When I set the userID to firebase user ID will the subscription only be active for this single account that was used to log in?

The subscription will be attributed to this userID. But, please review our guide on transfer behavior in the event of restoring purchases.

Is there already some implementation that returns or informs the app when user is signed in but his purchase (membership) expired?

Yes, you can get up-to-date subscription status from the SDK. I’d also recommend listening to customerInfo updates.

How can you implement a 7-day trial in this case?

Trials are configured as Introductory Offers in App Store Connect and are automatically applied when purchased (if eligible).

The purchase is made by an apple ID account, but the beneficiary is the actual account that was used to log in in this case?

Yes, though (for Apple) the underlying Apple ID owns the receipt that contains the purchase. The previously linked transfer behavior details what happens when an app user ID changes.

Is there some event that can notify the firebase app when the purchase is made? What if that api call failed once (the event fails), would that mean that the user lost their subscription somehow? (his ID was not persisted as a member)

We have a native Firebase integration that you may want to review. You can also always ask the SDK or API for subscription status, as we store the receipt and associate it with the appropriate user (whether identified or anonymous). You do not need to ask your own backend for subscription status - you can completely rely on the SDK.

How much things should I leave up to revenuecat backend/framework and what are the things that are actually needed to be implemented when integrating with firebase?

You can completely rely on RevenueCat if you want! Some customers like to use our Firebase integration to duplicate data in Firestore, but it’s not necessary. Just ensure you identify users in RevenueCat with your Firebase auth uid.

Thanks!

 


Reply