I can’t seem to find a way to go about this… as the Vue instance is executed on the fly, and the only option am left with is to rely on the app’s main app component.
@pvtallulah, thank bro… I tried that first but it definitely will fire straight after the event is fired. I sort of want to make sure the permission is given and location enabled before showing anything in the app.
In core, i would use app.init() later after doing my stuff.
I have an external variable that I import and give the app instance… I am supposed to give it the Vue instance, save it to some local variable, do stuff, and when I am done with everything, I call that local variable (it now has the instance), and it kickstarts the app.
ok, so wait for deviceReady, then call the Location permision. and if it yes, load vue if not, alert(‘some text’)
document.addEventListener('deviceready', askLocationPermission, false);
function askLocationPermission (e) {
//ask here,
hasPermision()
.then(res => {
if (res) { const app = new Vue(); LocationSettings.init(app); }
else alert('your text')
})
.catch(err => { alert('something went wrong: ' + err) })
}
if this donst work to you, i will try to do a small app with permission location and f7 init false. Since you say f7 init dosnt work for you, all my advices are trying to avid that path.
@nolimits4web, I am trying to enforce users to allow us to use the highest accuracy location using this plugin, as the app needs to access device location to actually go about its core business.
If users deny this, then the app won’t really have a meaning, because we can’t really help them. we need to watch their location whenever they are using the app so we help them based on their location.
Then you init the app still. If no location permission granted you show some default page saying location need to be enabled and show permission request dialog. Then, if permission granted, you page/view to what you need