Question

How to set restore behavior programmatically?

  • 22 April 2022
  • 1 reply
  • 36 views

Badge +1

Hello!

I have used block transfers as a restore behavior in revenue cat in accordance to my application’s business logic which is:

  • If User A subscribes to product and his subscription in underlying store is active then the User B shouldn't be able to make the purchase, but if the subscription of User A in underlying store is expired then the User B should be able to make the purchase.

Currently I am facing issue of 

There is already another active subscriber using the same receipt.

while trying to purchase from User B even if the subscription purchased by User A is expired.

 

For the desired behavior when the subscription of User A is expired then the purchase should be transferred to the User B but if the subscription of User A is active then the purchases shouldn’t be transferred to the  User B.

Is there any way that I can achieve this desired behavior? If not is there any workaround for this ?  


1 reply

Userlevel 3
Badge +7

HI @Binayak Adhikari , 

When using block restores the receipt for user A will never transfer to user B, even if the subscription is expired. Even if you successfully make a purchase with user B it will be added to the receipt of user A as we will see that the receipt already belongs to another user. 

For the desired behavior when the subscription of User A is expired then the purchase should be transferred to the User B but if the subscription of User A is active then the purchases shouldn’t be transferred to the  User B.

 

There currently isn’t a way to make this functionality work. If you changed your restore behavior to transfer the receipt would transfer regardless if there is an active subscription. 

 

Reply