Skip to main content
Solved

Delay after transferring purchase

  • 15 September 2021
  • 1 reply
  • 146 views

Forum|alt.badge.img+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?

Best answer by jazmine

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. 

View original
Did this post help you find an answer to your question?

1 reply

jazmine
Forum|alt.badge.img+7
  • Dedicated Contributor
  • 122 replies
  • Answer
  • September 15, 2021

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings