Question

Using user attributes with the Firebase RevenueCat extension

  • 5 October 2023
  • 3 replies
  • 120 views

Badge +3

In my app, I am trying to use Purchases.setAttibutes() to capture user settings and store them in Firestore. I had hoped that the attributes would appear in a document generated by the Firebase RevenueCat extension, but the attributes do not appear. Is this possible? If not, where are these attributes actually stored?


3 replies

Userlevel 3
Badge +8

Hi,

Subscriber attributes are stored on RevenueCat servers (https://www.revenuecat.com/docs/subscriber-attributes).

Our Firebase extension does not currently send subscriber attributes to Firestore, but you could retrieve them by calling our /subscribers api endpoint with your secret api key in Firebase.

Badge +3

Ryan,

 

Thanks for the response. After further exploration, I was successful in having attributes appear in the Firestore event document using the RevenueCat Firebase Extension. Basically, I watched the RevenueCat Flutter In-app subscription video 3 or 4 times and captured the steps below. While I tried this before, I must have missed a step between the app, RevenueCat and App Store Connect.
 

Here are the setup steps that got it working for me…


Install the magic weather app

open ios/Runner.xcworkspace

  • Create a unique bundle id

Build and run

In RevenueCat,

  • create a project
  • Create an entitlement
    • premium
  • Create an iOS app
    • Name it
    • Add bundle id

In App Store Connect,

  • Create an app
  • In app information, select App-Specific Shared Secret / Manage
    • Copy the secret

In RevenueCat,

  • Set the secret
  • Click Save Changes
  • Under API Keys, click ’Show key’ and copy the key

In the app constants.dart file, paste the key

In App Store Connect, select Subscriptions

  • Add a subscription group
  • Add a subscription
    • Specify the subscription duration
  • Add another subscription
    • Specify the subscription duration

In RevenueCat, select Products

  • Add new products
  • Add products to the existing entitlement
  • Create a default offering (this will appear in the paywall to show the available products)
  • Add the packages
  • Attach the products

Re-run the app

 

Bill

Userlevel 3
Badge +8

Hi Bill,

Thanks for all that info! I can work this into our docs

Reply