1
I have a simple app using Cordova, inside, I call an external web application developed in Angularjs. I intend to start monetization in the app, and for that I want to make sales through the Google Play Store, within it. To do so, I need to inside this external web application, call the javascript/inAppPurchase plugin that has already been added to the project.
It turns out, obviously, that directly this is not possible. Currently, my call to the external application is 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 - https://github.com/AlexDisler/cordova-plugin-inapppurchase
Calling from the index.html of the Cordova project it works right, now from the external application, presents the following error:
Uncaught Referenceerror: inAppPurchase is not defined
The call in the index of the external project that is called inside the app is 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 also not successful.
I appreciate any help!