Forge Documentation


This documentation is deprecated, and only kept here to support users of browser extension APIs. If you are using for iOS or Android, see

geolocation: Geolocation

Although geolocation APIs are part of the HTML5 specification, on some platforms, the default permissions dialogs can be cumbersome and annoying to your users.

For that reason, we offer an alternative way to get geolocation data.


The geolocation module must be enabled in config.json

    "modules": {
        "geolocation": true


geolocation.getCurrentPosition(options, success, error)
  • options (object) -- request specific levels of service from the location provider, currently supports "enableHighAccuracy": true to request GPS location if available.
  • success (function(position)) -- called with an object matching the W3C Position specification
  • error (function(error)) -- called when the user chooses not to share their location with your app


To enable easy porting from existing HTML5 code onto Forge, we also accept parameters in the order (success, error, options)


On Android this module will add the ACCESS_FINE_LOCATION permission to your app, users will be prompted to accept this when they install your app.