Tried to use cordova-plugin-advanced-http in my framework7 app.
I want to call cordova.plugin.http in async route, but have no idea how to call the plugin.
async: function (routeTo, routeFrom, resolve, reject) {
var router = this;
var app = router.app;
}
Here how can I call cordova object?
I have tried
this.cordova
app.cordova
but all failed.
Thats probably because the Cordova plugins aren’t yet initialized and available when you load your routes. To overcome this, I’ve delayed the framework7 initialization and put my routes inside a function like this:
Exact code depends on your app, but I hope you get the point of delaying the route generation and Framework7 initialization by using the deviceready event.