I found the problem. So whenever
getPurchaserInfo is called, but if
Purchaser.setup hasn’t finish processing, then it will fire this exception. Thanks to the comment by @Cesar above.
In my case, I found the problem was because:
- I had two Blocs that handles IAP and Business logic respectively.
- The IAP calls
Purchases.setupas soon as the user is authenticated. Then at the main screen, the Business logic will check validity of local data with server by doing
- The problem comes when the internet connection is not great and
getPurchaserInfogets fired by Business logic bloc before
So the solution I did was by making sure that Business logic bloc starts initializing once IAP bloc done with
Purchases.setup. Such as placing them in an async function that awaits for each process.
CLICK HERE to find out more related problems solutions.