Beacon

class Beacon(var factoryId: String? = null, var deviceId: String? = null, var facilityId: Int = 0, var uuid: String? = null, var major: Long? = null, var minor: Long? = null)

Beacon — represents a Bluetooth beacon associated with a Facility.

Beacons are part of facility metadata returned by the backend.

Notes

  • Use uuid + major + minor to uniquely identify a beacon within a network.

  • Beacons support fine-grained facility detection when GPS is unreliable (indoors).

Android (Kotlin) — matching a beacon

val beacons = AFCore.facilities().get() // facilities may include beacon info
beacons.forEach { beacon ->
if (beacon.uuid == scannedUuid && beacon.major == scannedMajor && beacon.minor == scannedMinor) {
println("Beacon belongs to facility ${beacon.facilityId}")
}
}

iOS (Swift) — checking beacon assignment

Task {
do {
let facilities = try await AFCore.shared.facilities().get()
for beacon in facilities.flatMap({ $0.beacons }) {
if beacon.uuid == scannedUuid &&
beacon.major == scannedMajor &&
beacon.minor == scannedMinor {
print("Matched facilityId: \\(beacon.facilityId)")
}
}
} catch {
print("Failed to fetch beacons: \\(error.localizedDescription)")
}
}

Constructors

Link copied to clipboard
constructor(factoryId: String? = null, deviceId: String? = null, facilityId: Int = 0, uuid: String? = null, major: Long? = null, minor: Long? = null)

Properties

Link copied to clipboard

Beacon identifier assigned by the Mobile API (string name), or null if not provided.

Link copied to clipboard

ID of the Facility this beacon is linked to.

Link copied to clipboard

A 9-digit alphanumeric code printed inside or on the back of the beacon (hardware ID), or null if not provided.

Link copied to clipboard
var major: Long?

Major grouping value (e.g., floor, room, or building zone), or null if not provided.

Link copied to clipboard
var minor: Long?

Minor identifier for an individual beacon within a group, or null if not provided.

Link copied to clipboard
var uuid: String?

Universally Unique Identifier — distinguishes your beacon network from others, or null if not provided.

Functions

Link copied to clipboard
open override fun toString(): String