PurchaserInfo not updated when internet connection is not available
Our application replies on Adapty purchaser info by using AdaptyDelegate.didReceiveUpdatedPurchaserInfo. Adapty requests PurchaserInfo from backed in Adapty.activate method. But didReceiveUpdatedPurchaserInfo not reported when internet connection is not available.
There's an option to get PurchaserInfo, i.e. Adapty.getPurchaserInfo(forceUpdate:). So the there's a flow:
- call
Adapty.activate - call
Adapty.getPurchaserInfo(forceUpdate: false)
this entails possible two requests to simultaneous requests to backed when internet is available. What is not optimal.
So I propose two options.
- Call
AdaptyDelegate.didReceiveUpdatedPurchaserInfoinprivate func configure(_ completion: ErrorCompletion? = nil)when purchaserInfo is not empty, before identify or getPurchaserInfo calls. #54 - Add
Adapty.getPurchaserInfo(forceUpdate:)option to skip network request.
Thanks!
Hi!
The delegate function didReceiveUpdatedPurchaserInfo, as its name and documentation suggest, should only tell the user about the updated state of PurchaserInfoModel, so I'm not sure if the behaviour you describe is a bug.
You can indeed get PurchaserInfoModel from the cache (if it is already there), by calling Adapty.getPurchaserInfo(forceUpdate: false).
I understand your concern about duplicate queries, and it probably makes sense to add some explicit way to get user information from the cache. In version 2.0 (coming very soon) and beyond, we'll think about how to do this properly.
I will leave this issue open as a reminder to us, but I will close your PR. As soon as something changes in this issue, I'll let you know!
Hey, @larryonoff ! We have released the new version of our SDK, check it out!
Here is the part of our docs about this thing.