Solved

iOS: Block Restore: unexpected Restore behavior (When not-purchased Member B restore second time restore goes through by Purchased MemberA)

  • 6 May 2022
  • 1 reply
  • 29 views

Badge

Revenuecat team: Thank you for providing such a good service.

Condition

  • SDK: react-native-purchases@^4.5.2:   version "4.5.3"
    Restore setting: Block Restore
  • SDK login timing: at App initializing and before purchase
  • Runs restorePurchase internally before makePurchase to check if product is already purchased by different Member. (Shows message to re-login by purchased member)

Usecase

  1. iPhone user (App ID = X)log in to app as Member: A=app_user_id. Then purchase Monthly subscription.
  2. User log out Member: A.
  3. User log in as Member: B.
  4. User Try to purchase Monthly subscription (internally runs restore for checking before purchase), “Receipt already in use” error occurs and prevent Member: B from purchasing.  This behavior is as we expected.
  5. But after above, When User try to purchase again as Member: B( internally runs restore for checking before purchase), this time “Receipt already in use” does not occur goes through restorePurchase and "Product already purchased" occurs AND SDK's APP_USER_ID IS CHANGED TO MEMBER: A !! ( as I checked from debug information)

Question

  • Why this happens? The first try (restore) we have “Receipt already in use” and it is as we expected, but once “Receipt already in use” happens once, restore occurs with purchased app_user_id and SDK’s app_user_id seems switched.

Thank you in advance.

icon

Best answer by Firstlogic 16 May 2022, 09:26

View original

1 reply

Badge

This issue is not solved yet. But if I killed the task after Member:A logout then

log in app_user_id does not change to Member:A when restore runs for more than 2 times.

 

  1. iPhone user (App ID = X)log in to app as Member: A=app_user_id. Then purchase Monthly subscription.
  2. User log out Member: A.
  3. [New] kill the task/application by swiping up.
  4. User log in as Member: B.
  5. User Try to purchase Monthly subscription (internally runs restore for checking before purchase), “Receipt already in use” error occurs and prevent Member: B from purchasing.  This behavior is as we expected.
  6. [New] I keep getting  “Receipt already in use”  as many times as I try restore. This is good result but I need to find way to do this without killing task after Member:A log out.

 

Reply