Search
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Understanding the background location plugin for iOS and Android apps

TL;DR: The Background Location plugin can take your app to the next level. This plugin provides apps the ability to track and monitor a device’s geographic location all while running in the background. Learn about the key features and benefits of Median’s Background Location plugin, as well as the steps you need to seamlessly integrate it into your app.

The background location feature in an app allows you to track and monitor the geographic location of your device even when the app is not actively in use or visible to your screen. 

It allows apps to receive continuous location updates all while running in the background — making this ideal for users needing location data while multitasking (i.e., using other apps).

DYK: The background location feature can be added into any native app (or a webview app) through a basic plugin integration? 

It’s true: This feature can be added to your app with Median’s native Background Location plugin. Let’s dive into what this plugin is, its features and benefits, and the steps required to integrate it into your own app.

Instant Preview

Enter any URL to build your app

Please wait ...
Oops! Something went wrong while loading...

What is a background location plugin? 

A background location plugin is a software component developed for mobile apps that allows your app to continuously track and monitor your device’s geographic location even when your app is running in the background.

How are they used, practically speaking? This plugin can be leveraged by fitness apps to track running routes, delivery apps that send out automated dispatch messages about your food’s ETA, and more.

Median.co developed its own background location plugin that you can seamlessly integrate into any native or webview apps

With the specific design requirements of iOS and Android platforms, and location services functionalities, Median’s Background Location plugin can be used to perform other background tasks such as data backup and server communication.

Key features of the Background Location plugin

With the Background Location plugin, you can take your app to the next level. Boost engagement, optimize efficiency, and unlock the full potential of location-based features.

Some of the key features of this plugin include:

  • Background execution and location tracking: Track the real time location of your app users, perform data backups, or send data/location to a remote server even when your app is not active in the foreground.
  • No more missing location updates: Ensure all location updates are received and processed as required, even when your app is backgrounded, with Median’s exclusive JavaScript modifications.
  • Hassle-free compatibility and access: The plugin handles all the necessary permissions and configurations on both iOS and Android platforms without any technical headaches.

The benefits of the Background Location plugin

Some of the benefits of the Background Location plugin include, but are not limited to:

  • Seamless user experience for navigating and tracking geographic location of your device.
  • Real-time location updates that ensure accuracy, ETA calculation, and other location-based services.
  • Geofencing support that triggers specific actions when a user enters or exits predetermined areas
  • Continuous log activities without the need for the app to be open
  • Trustworthy data collection for better tracking and optimization
  • Accurate data collection of information that can be used during emergencies, enhancing the overall safety of users
  • Reduced battery consumption due to it being run in the background

Median’s plugin also offers a level of flexibility that no other plugin has: It’s completely up to individual users on how much data they want to receive and the level of accuracy. 

For example, if the app needs to operate at low power to enhance battery life, you can have the users opt for low-accuracy location data, whereas if the app needs the most precise location data, you can let the users choose the option for the best accuracy available.

Tip: Combine a push notifications service like OneSignal with this Background Location plugin to provide timely push notifications to your app users based on their location data, further enhancing the functionalities of your app.

How to integrate the native Background Location plugin into you app

Median’s native plugins can be seamlessly integrated into any app created with Median’s App Studio.

There are currently two modes of operation for you to run a regular background process based on elapsed time interval and location change distance. These are: 

  • Directly transmit data including location to a remote server API, all through native code. 
  • Invoke a JavaScript callback function that you can define to include any required functionality.

Tip: You can also use both modes together in your app.  When your app is in the background, updates to the JavaScript callback will be paused but your app will still transmit data to your remote server API. When your app is resumed, any location updates that the callback function missed are sent in a large batch.

Steps on how to integrate native the Background Location plugin:

  • Open the “Native Plugins” tab in App Studio
  • In the “Available Plugins” list, press “Add” on “Background Location”
  • Once added, rebuild your app to integrate the “Background Location” plugin into your app
  • Add the JavaScript to your web application to initialize and configure the “Background Location” plugin according to your needs
  • Sample code to add to your web app is available on the demo page prepared for developers and in the plugin documentation

Note: This plugin handles the necessary permission and configurations required for both iOS and Android apps, ensuring your app adheres to both the app store’s privacy policies and smoothly adheres to the app store guidelines.

Summary 

A Background Location plugin is a must for an app that requires the use of geographic location data — for apps such as fitness apps, food delivery apps, marketing apps, and so on. 

This plugin is strong when it comes to accurate data collection, location tracking, map navigation (for GPS services), and providing users live real-time updates on ETAs related to location services. 

By integrating Median’s Background Location plugin, you can take your app to the next level by providing users a secure way to track their device’s location all while the app runs in the background — enhancing user experience and minimizing battery usage.

This plugin can be integrated seamlessly into any app, be it native, webview or hybrid apps. 

Ready to take your app to the next level? Talk to a Median expert now and start providing your customers a seamless user experience with location tracking.

Want to learn more about our plugins?

Launch a full-feature native app without native development!

Plugin library
Right Arrow
Screenshot of Fitbit iPhone app with Touch ID login prompt.

Frequently asked questions

How does Median’s Background Location plugin work?

The Median Background Location plugin uses built-in location services functionalities of iOS and Android devices to track the location data of your users. The background service runs on a regular basis according to time interval and location distance traveled. The plugin will POST all data to a remote server endpoint that you establish or it can invoke a JavaScript callback that you define.

What is required to use the Median Background Location plugin?

You will need to add JavaScript to your website (or web application) to initialize and configure the Background Location Plugin. If you are using the plugin to send data to a remote server API, you will need to implement a server endpoint to receive the data based on the JSON format sent by the plugin as found in our documentation.

Where can I get more help with the Background Location plugin

If you need help with the Background Location plugin, visit the Median documentation for the plugin. Fortunately, we have sample code for both the JavaScript initialization and a NodeJS server endpoint running as a Firebase Cloud Function, and our expert team is available to help you through every step of implementation.

*DISCLAIMER: This content is provided solely for informational purposes. It is not exhaustive and may not be relevant for your requirements. While we have obtained and compiled this information from sources we believe to be reliable, we cannot and do not guarantee its accuracy. This content is not to be considered professional advice and does not form a professional relationship of any kind between you and GoNative.io LLC or its affiliates. Median.co is the industry-leading end-to-end solution for developing, publishing, and maintaining native mobile apps for iOS and Android powered by web content. When considering any technology vendor we recommend that you conduct detailed research and “read the fine print” before using their services.*
Back
to top