Using "Group ID" as App User ID in RevenueCat

  • 26 July 2021
  • 4 replies
  • 116 views

Badge +4

Hi. There are groups in my app and the groups have a couple of members. If one of them pays for subscription, I change the group status and all the members in group can access premium contents.

 

Can I initialize the ‘group id’ instead of user id (firebase auth uid) ? Is it a good practice? Do I have to use aliases?

My code: await Purchases.setup(_api_key, appUserId: group.id);

 

 


4 replies

Userlevel 5
Badge +9

Hey @esp!

 

That should be fine to use a “Group ID” in place of an App User ID in RevenueCat. 

 

RevenueCat will keep the subscription status in sync against an provided identifier, so in this case the subscription status would be tied to the “Group”, not an individual customer, which sounds preferable for your use-case.

 

Keep in mind that things like Subscriber Attributes will also be at the group level, along with Customer Lists, etc.

Badge +4

Thank you @ryan

Badge +1

Hi @ryan , on that same note with group subscription, is it possible to have Revenue Cat check subscription status against group id in attributes instead of App User ID?  That way users in a same group can still show up in customer list and have their own attributes. 

Userlevel 5
Badge +9

Hey @Vera subscription status can only be linked to an App User ID, you’re correct that Attributes and Customer Lists would be associated with a “Group” instead of a “Customer” if you go with this approach.

Reply