Current Device Location

This property is used to get the current device location (aka geolocation). You can access this when the Source is set to Global Properties.

You can use this property to get the user's current location to update on Google Maps or store it in the backend database.

At present, testing this property isn't possible in Test mode, but you can use the Run mode for this purpose. For Android and iOS platforms, you can test by downloading the code and following the instructions provided here.

Examples

How to get the Current Device Location

Let's see an example of getting the current device location and passing it to a widget (that supports accepting LatLong, for example, Google Maps).

Here is an example of how you can retrieve the current device location:

  1. Select the widget (e.g., GoogleMap) from the widget tree or canvas area.

  2. Move to the properties panel, find the Initial Location property, and click on Set from Variable.

  3. Set the Source to Global Properties.

  4. Set the Available Options to the Current Device Location.

  5. Click Confirm.

How to save the Current Device Location

Here's how you can save the user's current location (Geolocation) in the Firestore document.

  1. Create a LatLng field in your Firestore Schema.

  1. After this, you need to set this field from a variable source and select Current Device Location from the Global Properties.

Last updated