Open studentrk opened 1 week ago
I believe thought that this would work if receipt validation is setup (is it your case?). Calling "initialize" should trigger a receipt validation call that'll make the plugin aware of non-consumable purchases (and subscriptions). Without receipt validation, on iOS, purchases won't be reported again.
That could potentially be fixed by keeping a cache of transactions on the native side, but could create other issues (like a reload after switching AppStore account would report incorrect transactions, other side effects maybe?).
Not sure how important that is, notice that in debug you could probably work with "TEST" products, that will work across reloads (because they're pure JS) -- cf https://github.com/j3k0/cordova-plugin-purchase/wiki/v13-reference:-Test-Adapter
Observed behavior
Using live reload:
When employing live reload with Ionic on iOS, purchasing a non-consumable product, making code changes, and triggering app restart, the CdvPurchase.store.products function returns all products as not owned. However, upon calling restorePurchases, the purchases are accurately restored. It appears that not all plugin code is reloaded during live reload, and the paymentQueue function is not executed again after the reload.
This issue doesn't require immediate fixing but might be beneficial to document.
Expected behavior
During live reload, purchasing a non-consumable product should retain its owned status even after recompilation.
Simple workaround