Solved

Delay after transferring purchase

  • 15 September 2021
  • 1 reply
  • 129 views

Badge +1

Hi there!
I'm experiencing some delay on the PurchaserInfo data right after login. 
I'm using the Transfer Purchase behavior from https://docs.revenuecat.com/docs/restoring-purchases.
 

Problem: PurchaserInfo returns without active entitlements right after Purchases.login()

Steps to reproduce:
1.With a anonymous user, buy a subscription :white_check_mark:
2. Now the anonymous user has an active entitlement on PurchaserInfo :white_check_mark:
3. Log in (Purchases.login()) on a account with no active entitlements :white_check_mark:
4. Call Purchases.getPurchaserInfo() to check if user has active entitlements :x:
Result: The recently logged in user has no active entitlements, even though they should (because of the Transfer Purchase behavior). However, if I call Purchases.getPurchaserInfo() again after 2-5 seconds, then the PurchaserInfo returns correctly, with the user having the active entitlement.

To fix this I'm using addPurchaserInfoUpdateListener, so I can observe better the PurchaserInfo changes. But is this delay after transferring a purchase normal?

icon

Best answer by jazmine 15 September 2021, 23:11

View original

1 reply

Userlevel 3
Badge +7

Hey @Lucas Sampaio ,

You have the right idea using addPurchaserInfoUpdateListener we recommend setting up this listener to observe any PurchaserInfo changes.  Overall I think you are running into a combination of a slow network and waiting for PurchaserInfo to update. When using the Purchases.login() this will update the cache, but login waits for a callback to do this. 

Reply