Working with Location and Permissions in JET Hybrid by Andrejus Baranovskis

Posted: March 5, 2018 in Cloud, Mobile
Tags: , , , , , , ,
image

What if you want to access mobile device location data from JET Hybrid application? This can be achieved with Cordova Geolocation plugin. But you want it to be nicely done and want to make sure application is granted with permission to access location information. Use Cordova Permissions plugin for that.
You could add Cordova plugin to JET app by executing this command:
cordova plugin add 
If this command doesnt work for any reason, you could add plugin information directly into config.xml file (check Geertjan post about the same – Plugging into Devices with Oracle JET on Cordova (Part 1)):
In JS function, before calling location API – we call permissions API to check if app is already granted permission to read location data. In hasPermission method, in case of success – location data is accessed. In case of no permission, request for permission is sent. If request is satisfied – location is accessed (and permission is granted at the same time): Read the complete article here.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.