Automatic on gps in mobile and getting lat,long


#1

Hi all,
I need to automatically on gps in device when it is switched off and at the same time it retrieves current lat,long in ionic…

Give me the solution


#2

Could you rephrase this please?
What should happen when what happens first?


#3

yes when i open the app it automatically on the device gps and also get lat,long from device current location


#4

I still don’t understand what you want to happen when you open the app.


#5

when i open my app in mobile it automatically on the mobile gps in background and fetch lat ,long from current mobile location


#6

Third time you post the same sentence. There is a verb missing in here.


#7

@muthukumar_8844 just a hint for you but not a proper answer, add a cordova permission for device locaiton if yes, it will automatically turn ON your device gps [ cordova permission](http://cordova plugin add cordova-plugin-android-permissions) then in run function simply fetch your current location’s lat and lng
Thanks


#8

He means the GPS should get switched on automatically…


#9

cordova-plugin-request-location-accuracy enables you to request high accuracy (GPS) location from within an app. On Android, if location mode is off or low accuracy, the user will be presented with a system dialog to confirm enabling high accuracy (GPS) location.

Note: it is not possible to directly enable high accuracy (GPS) location mode on Android without showing the dialog. This is built-in Android OS functionality leveraged via the Google Play Services Location API.


#10

thank you MdShuaib.I will add and let you know


#11

thank you dpa99c1 .will it automatically turn on the gps in device?


#12

Yes it will automatically turn on GPS if the user agrees in the dialog


#13

ok Dpa99c.thank you very much