What is Bluetooth LINE Service Advertising?

We have just one beacon that can advertise LINE. This post explains LINE advertising with information on the packet format.

LINE Beacons are used alongside the LINE messenger service, which enables users to exchange text, video, and voice messages on both smartphones and personal computers. This service is currently available in Japan, Taiwan, Thailand, and Indonesia. LINE offers developer APIs for both iOS and Android platforms, allowing developers to integrate LINE functionality into their own applications.

The LINE Beacon system works by sending webhook events to a LINE bot whenever a user with the LINE app comes into close range of a registered beacon. This enables developers to create context-aware interactions, tailoring the bot’s behaviour based on the user’s proximity to specific physical locations. In addition, there is a feature known as the beacon banner, which is accessible to corporate users. This allows a promotional banner to appear in the LINE messenger app when the user approaches a LINE Beacon, providing another layer of engagement for location-based services and marketing campaigns.

LINE Bluetooth Advertising
LINE Bluetooth Advertising

Unlike iBeacon, LINE Beacon packets have a secure message field to prevent packet tampering and replay attacks. The secure data is 7 bytes long containing a message authentication code, timestamp and battery level. Secure messages are sent to the LINE platform for verification.

Generating LINE advertising
Generating LINE Advertising

LINE recommend LINE beacon packets be sent at a very high rate of every 152ms. In addition, LINE recommend advertising iBeacon (UUID D0D2CE24-9EFC-11E5-82C4-1C6A7A17EF38, Major 0x4C49, Mino 0x4E45) to notify iOS devices that the LINE Beacon device is nearby. This is because an iOS app can only see iBeacons when in background and LINE beacons can’t wake an app.

We observe that the high advertising rate and concurrent iBeacon advertising aren’t battery friendly and the beacon battery isn’t going to last long.

There’s more information on the LINE developer site on using beacons and the LINE packet format.

Is it Possible to Continuously Scan for Bluetooth Devices on iOS and Android?

We sometimes get asked if it’s possible to use a smartphone as a gateway to scan for Bluetooth devices. The thinking is usually that workers or users already have devices so why not make use of them?

While it is possible, there are many reasons why you might not want to do this:

  • On iOS, Apple hide Bluetooth MAC addresses and for some APIs hide the iBeacon ids making unique identification more difficult.
  • You will find it very difficult to get a continuously scanning app through Apple app store review. You will need strong justifications.
  • Scanning continuously uses lots of battery power, even when advertising with periodic ‘off’ and ‘on’ periods.
  • Capabilities of devices vary meaning you will almost certainly get some end user devices where your implementation won’t work. For example, some manufacturers stop long running processes.
  • On Android there’s a limit of six scans every 30 seconds. Also, it’s necessary to scan in a foreground activity to prevent the operating system from throttling detections. There are hacks to instead run scanning in threads but these aren’t officially supported and so might not be viable in future OS releases. It’s best not to create production apps based on hacks as they can suddenly stop working.
  • Some users will play with their phones and end up purposely or inadvertently disabling your application.

The best scenarios are those where you can dictate the phone type, it can be mains (PSU) powered and the phone isn’t owned by a user (i.e. it’s just used as a gateway). It’s almost always better to use a dedicated gateway.

Which Beacons are Compatible with iOS and Android?

We often get asked the question which beacons are compatible with iOS and Android. All beacons, whether iBeacon, Eddystone or sensor beacons can be used with iOS and Android. The compatibility is achieved through the implementation of common Bluetooth standards on these mobile platforms.

However, there are some caveats:

  • Android only supported Bluetooth LE as of Android 4.3. Older devices can’t see Bluetooth beacons. Over 99% of users are on Android 4.3 or later so most people can see beacons.
  • Apple iOS doesn’t have background OS support for Eddystone triggering. While iOS apps can scan for, see and act on Eddystone beacons, the iOS operating system won’t create a notification to start up your app when there’s an Eddystone beacon in the vicinity.
  • Apple can’t see beacon’s or other Bluetooth devices’ MAC address or iBeacon ids due to over zealous privacy concerns. It can see iBeacons but you have to pre-declare, already know, their ids.

Rather than beacons being compatible with iOS/Android, we find that there are more problems with particular Android devices not seeing beacons, when in background, due to some manufacturers killing background services.

Also see Which Beacon’s Are the Most Compatible?

View iBeacons

New MobileBeaconer Android App

IdeaSave Software has released a new Android app, MobileBeaconer, designed to easily detect Bluetooth Low Energy (BLE) beacons using iBeacon™, Eddystone URL, Eddystone UID or AltBeacon formats. The app allows users to save selected beacons and receive notifications when those beacons are nearby.

To ensure the scan continues without keeping the screen on, the app uses a foreground service, indicated by a “Scanning for managed beacons” notification. Users can also set the proximity range for notifications to immediate, near or far.

iBeacon App Development Considerations

If you are considering writing apps to communicate with iBeacons, here are some high level things you need to think about that are specific to beacon app development:

  • Detecting whether Location and Bluetooth are on/off and alerting the user for permission to use these
  • Detecting beacons in background when the iOS app is closed or the Android app is in doze mode
  • On Android, taking account of the various Bluetooth APIs that exist for the different Android releases
  • Fetching data, associated with a beacon, from a service, such that it’s cached and not fetched every time
  • Arranging for some initial data bundled with the app so that it works straight away without a data connection
  • Fetching data before it is needed such that it’s available with no delay and when there’s no network connection
  • Re-fetching of data when it becomes stale
  • Fetching metadata from the server to control the behaviour of triggering
  • Arranging how Apple will test the app for app review otherwise complications will arise and the review will take weeks
  • Assessing whether to use the mobile OS or manufacturer supplied SDKs (or both)
  • If connecting to beacons, taking account of the unreliability of wireless connections
  • Collecting and uploading statistics/analytics to assess usage
  • Providing end user diagnostics to aid support troubleshooting

Need an experienced beacon app developer to get these things done quicker? Consider our development services.

Each Beacon Manufacturer Has its Own App

Each Bluetooth beacon manufacturer typically provides its own proprietary configuration app for several key reasons. Firstly, manufacturers use different internal components and designs, meaning a custom app is necessary to tailor configuration options specifically to the hardware. Many also implement proprietary Bluetooth communication protocols for setup, requiring a unique app to handle these configurations correctly.

Security is another factor, as manufacturers often include measures to prevent unauthorised reconfiguration, and custom apps allow for the necessary authentication and encryption. Customisation also allows manufacturers to highlight unique features that may not be available in generic tools, while a branded app ensures control over the look, feel and overall user experience during configuration.

Some beacons only permit configuration within a limited timeframe after being powered on or require a special mode to be enabled and custom apps are designed to accommodate these specific procedures. Firmware updates are also often delivered through these apps, while support and troubleshooting features, including diagnostic tools and links to support resources, are commonly integrated.

For beacons that store data locally, custom apps offer interfaces to manage that data according to manufacturer-specific formats. While universal configuration tools are theoretically possible, the wide variety of hardware, protocols and features in use makes them difficult to develop, and manufacturer-specific apps remain the most reliable way to fully manage proprietary beacon hardware.

What Bluetooth Systems Can Track Working Using Their Smartphones?

Contrary to popular belief, it’s not possible to directly track smartphones using Bluetooth alone. Both iOS and Android devices have built-in privacy protections and limitations that prevent this kind of tracking.

For iOS devices, Apple has implemented randomised MAC addresses for Bluetooth transmissions. This means that the unique identifier broadcast by an iPhone or iPad changes regularly, making it impossible to consistently track a specific device over time. Android doesn’t continuously send out Bluetooth transmissions.

However, whilst smartphones themselves can’t be directly tracked via Bluetooth, there are systems that can perform location tracking using Bluetooth beacons and gateways. These systems rely on people carrying small Bluetooth beacons, often in the form of keyfobs or badges, which broadcast a unique identifier. Fixed gateway devices are then installed throughout an area to detect these beacons.

When a gateway detects a beacon, it records the beacon’s identifier and signal strength to infer distance, along with a timestamp. By combining data from multiple gateways, the system can estimate the location of the beacon, and by extension the person carrying it, within the covered area. This approach is often used in workplace settings for things like occupancy monitoring or contact tracing.

It’s important to note that these systems require active participation – people must choose to carry the beacon devices. This is quite different from the idea of passively tracking smartphones without user consent.

Some retailers have experimented with using Bluetooth beacons to track customers’ movements within stores. However, this still requires customers to have the store’s app installed and Bluetooth enabled on their phones. These work the other way around by having fixed beacons and the app detecting the beacons. It’s not a covert tracking system, but rather one that customers opt into, often in exchange for discounts or other benefits. It’s less reliable due to the nuances of ensuring the app runs on all phones, at all times.

In summary, whilst it’s not possible to directly track smartphones via Bluetooth due to privacy protections and limitations, there are Bluetooth-based systems that can provide location based services when users actively participate.

Using Beacons with Smartphone Apps

Bluetooth beacons are a powerful tool for creating personalised experiences through mobile apps. They work by transmitting signals that can be detected by all smartphones. When a user comes within range, the app detects the beacon’s signal and identifies the user’s proximity to a specific location.

This enables the delivery of contextually relevant content, such as detailed information or reviews when a customer approaches a product in a retail store. It also allows for personalised recommendations based on a user’s location and past behaviour, offering tailored suggestions that match their interests.

Interactive experiences are another feature made possible by Bluetooth beacons. They can trigger app-specific actions based on user location, such as providing wait times and virtual queuing options in an amusement park. Additionally, they assist in wayfinding and navigation within large venues by providing directions and highlighting points of interest.

Utilising Bluetooth beacons for personalised experiences benefits businesses in numerous ways. They enable enhanced engagement with customers by delivering timely content, fostering a stronger connection and loyalty. They improve customer satisfaction by providing tailored information and recommendations, making customers feel more valued. Sales and conversion rates are also boosted by offering targeted promotions when customers are near specific products.

Bluetooth beacons gather valuable data that provides insights into customer preferences and behaviour, helping businesses optimise operations and make data-driven decisions to enhance their offerings and marketing strategies.

Android and iOS use included operating system APIs to detect Bluetooth beacons. When an Android application detects a beacon, it gets a callback to a function including the signal level (RSSI), where developers can specify the app’s operation. On iOS the framework includes classes to represent beacons and beacon regions, enabling monitoring and ranging, i.e., determining the approximate distance to a beacon. When an app registers to monitor a specific beacon region, iOS notifies the app if the device enters or exits that region. This happens even if the app isn’t running at the time. Furthermore, if the app is currently in use, it can continually receive updates about nearby beacons and their relative distance.

In both Android and iOS, the apps don’t connect with the beacons. Instead, they detect the Bluetooth signals that the beacons broadcast. Also, both systems require the user’s permission for the app to access Bluetooth and location services.

Which Beacons Transmit a MAC Address?

A MAC (Media Access Control) address is a hardware identification number that uniquely identifies each device. In the context of Bluetooth, a MAC address is used to identify a specific Bluetooth device, such as a smartphone, headset or a Bluetooth beacon. All beacons transmit a Bluetooth MAC Address which is a 48-bit address usually represented in hexadecimal format like this: 0123456789AB.

All devices such as smartphones can see the incoming MAC addresses that are sent as part of the device discovery stage rather than the main Bluetooth LE advertising payload. iOS is a bit strange and non-standard because it hides detected Bluetooth MAC address from apps, and hence from users, when detecting beacons and other Bluetooth devices.

No such restriction happens on Android or any other device. The rationale is probably that Apple wants you to use their ids, the iBeacon UUID, major and minor or the Peripheral Id rather than the MAC address. Apple also probably think they are protecting privacy in some way. A few beacons and other devices such as sensors and fitness trackers additionally put the MAC address into the advertising payload which circumvents Apple’s restrictions and allows reading of the MAC address by apps.

Can I Use My Phone as Bluetooth Beacon?

A question that often arises is, “Can I use my phone as a Bluetooth beacon?” The answer is ‘yes’.

Before we get into the details, it’s essential to understand what a Bluetooth beacon is. In simple terms, a Bluetooth beacon is a small wireless device that transmits a periodic signal to other Bluetooth-enabled devices within its range. This technology is often used for indoor positioning, sensing and other location-based services.

Technically, yes, a smartphone can function as a Bluetooth beacon. Both Android and iOS platforms offer apps to turn your phone into a beacon transmitter. However, there are some caveats.

Using your phone as a Bluetooth beacon can be a significant drain on your battery. Beacons are designed to be low-energy devices that can run for years on a single battery. Your phone, on the other hand, has many other functions that consume power, so using it as a beacon will lead to the need for frequent charging.

The range of a dedicated Bluetooth beacon can be up to 100 metres, depending on the model and settings. A smartphone’s Bluetooth range is generally much shorter, limiting its effectiveness as a beacon.

While there are apps such as Locate Beacon, Beacon Simulator (for iOS), Beacon Simulator, nRFConnect (for Android) that can turn your phone into a beacon, these are often not as reliable or feature-rich as dedicated beacon hardware. You won’t be able to change all the settings such as power, advertising period and advertising type as you would with a dedicated hardware beacon. Additionally, running such an app in the background may interfere with other phone functions and some phones eventually close long running services.

Despite these limitations, there are scenarios where using your phone as a Bluetooth beacon could be useful. If you’re a developer or a business looking to experiment with beacon technology, using a phone can be a cost-effective way to test your ideas before investing in dedicated devices.

While it’s possible to use your phone as a Bluetooth beacon, it’s generally not the most efficient or reliable method for most applications. However, for personal use or small-scale use, it can serve as a convenient alternative. If you’re considering implementing beacon technology on a larger scale, investing in inexpensive dedicated hardware is usually the better option.

View Bluetooth beacons