I have a simple app using the cordova, inside, I call an external web application developed in AngularJS. I want to start monetization in the app, and for that I want to make sales through the Google Play Store, inside of it. To do this, I need to within that external web application, call the javascript / plugin inAppPurchase that has already been added to the project.
It happens, of course, that is not directly possible. Currently, my call to the external application looks like this:
<script>
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
if (navigator.network.connection.type == Connection.NONE) {
networkError()
} else {
loadApp()
}
}
function loadApp() {
navigator.app.loadUrl("http://192.168.0.102:8000/")
}
</script>
The plugin I want to call: InAppPurchase - link
Calling the index.html of the cordova project it works fine, now from the external application, it presents the following error:
Uncaught ReferenceError: inAppPurchase is not defined
The call in the external project index that is called within the app looks like this:
<script>
inAppPurchase.getProducts(['vaga_de_veiculo'])
.then(function (products) {
console.log(products);
})
.catch(function (err) {
console.log(err);
});
</script>
I'm trying now with inAppBrowser, but I was not successful either.
Thanks for any help!