Question

User can purchase different offering with the same store account

  • 12 December 2023
  • 4 replies
  • 134 views

Badge +1

I need help with the following scenario:

  1. User with userId x logs into my app, he is taken to the subscriptions page where he can choose from 3 offerings: monthly, 6 months and annual subscription. Let’s say he subscribes to the monthly. A webhook event is sent to my backend and now user with id x also shows with an active sub in my backend database.
  2. User with userid y logs into my app from the same store account as user x. Basically the same user with the same phone, same google/ios account but different application accounts. Now user y, does not have a sub so he is also taken to the subscription page and offered to subscribe to the same 3 offerings. If he chooses to purchase the same offering as the one that user x purchased, he will get an error saying that he cannot subscribe again to this offering. However, if he chooses a 6 months or annual offering, he is able to subscribe. A webhook event is sent to my backend and now user with id y also shows with an active subscription.

The problem here is that i am able to start another subscription if it’s of a different time period and the user will have 2 subscriptions started from the same store account. 

Expected behaviour:

  • When user with id y is taken to the subscriptions page in my app. He should not be able to purchase a new subscription since the underlying store account already has a subscription, no matter the time period. He should receive an error for all 3 offerings and have only the option to restore purchases from the user with id x.

Now taken into account the expected behaviour, how can i achieve this? From what I have seen there is no way to know if there is already a sub purchased with the underlying store account.

What is your advice to best handle this scenario?


4 replies

Userlevel 3
Badge +5

Hi! For products from the Apple Store, I believe that you should be able to get the expected behavior through subscription groups. We have this blog post that goes over them in further detail. Do you already have the products configured with them? In terms of Google Play, this may be more difficult as Google does not have a similar tool like the subscription groups and allows for a user to have multiple subscriptions. How are you currently checking for a user’s entitlements before you show them the paywall?

Badge +1

Hi! For products from the Apple Store, I believe that you should be able to get the expected behavior through subscription groups. We have this blog post that goes over them in further detail. Do you already have the products configured with them? In terms of Google Play, this may be more difficult as Google does not have a similar tool like the subscription groups and allows for a user to have multiple subscriptions. How are you currently checking for a user’s entitlements before you show them the paywall?

I check the entitlements first with my own server. If the account does not have an active sub then the customer info object is retrieved from revenuecat. From this object i request the entitlementinfo object as customerInfo.entitlements.all[‘premium’] and the check if it’s active with entitlementInfo.isActive. When i login with user with app id y, this condition always returns false and the user is sent to the paywall.

Badge +1

@wes_clark 

Userlevel 3
Badge +5

I deeply apologize for the delay. In your case, I think that using the syncPurchases method would be the best option for you as it can be used to programmatically restore purchases. Here is the documentation regarding it. By calling the method, you would be reactivating any content that had been purchased by that same store account and it would be reflected in the CustomerInfo object.

Reply