Simple Background LocationSensor using Itoo

Since Itoo v4.5.0, it is now possible to customise the app's manifest content for various kinds of background processing services.

Thus, the Itoo extension now supports the native LocationSensor component to be run in the background (even when the app is closed).

Steps

  1. Download the Itoo variant for background location ability: Itoo Manifest
  2. Import the extension to the IDE:
  3. Enable LocationUsage:

Example

  1. Basic Start/Stop Itoo buttons and a label to display location updates (if the app is open):

  2. Ask for location access and notification permission:

  3. Start/Stop button functionality, and configuring the LocationSensor component:

  4. Handle location updates and update the UI:


    You may choose to do whatever is relevant to the data. In the example above, I'm sending it to a locally hosted HTTP server.

    • The handler must follow the format ComponentName_EventName with n arguments as the original event. In this case, the component name is LocationSensor1, and the event is LocationChanged with 4 arguments.

    • To call a procedure from the background that updates the UI, it must have a ui_ prefix. Thus, it will be called on the main thread of the application if active.

Download

Project: ItooLocation.aia (84.7 KB)
License: MIT

6 Likes

Great!

But, shouldn't permissions be requested one by one? And why not FINE_LOCATION?

1 Like

Thanks! It was an oversight. I have corrected the blocks.

It should be:

1 Like