I can’t get the cordova-plugin-purchase plugin working either. The final step of finishing an order does not work in my app. So the product status of “owned” is always “false”.
I am thinking of a working solution to just create 2 Android packages: free and paid and publish them to the store.
I think the only thing I need to do is create a script to change the Cordova config.xml and AndroidManifest.xml and change the package name to either “my.app.id.free” or “my.app.id.paid” and then do “cordova platform remove android && cordova platform add android” before a build.
I spent a long time trying to get inapp purchase working on Android with the cordova-plugin-purchase plugin but I’m getting stuck at the final step of finishing an approved order. The product.finish() method seems to do nothing in my app and the product keeps in a not owned state.
The following code works for me - but it is not tidy - I am still getting my head around some js concepts and realise that someone will be able to provide a more concise solution, but seeing as this is unanswered for a couple of years I’ve posted my code. It lets a user upload a single picture upto 5mb, and updates the displayed profile picture from the uploaded image. I have also included the code I use to update the Cognito attributes.