Access to LocationManager in Android


#1

I want to know if GPS Service is available in the device, but

geolocation.isEnable()

return false also when GPS is on, but the user not confirm access to location services for this app.
So I try to do it in android native, and I want to write this code -

final LocationManager manager = (LocationManager) getSystemService( Context.LOCATION_SERVICE );
if ( !manager.isProviderEnabled( LocationManager.GPS_PROVIDER ) ) {
// gps not available
}

But I don’t know how to do it in typescript. Any help?


#2

Check it here, exactly what you might need


#3

@manojdcoder, You help me very much.
Thank you!