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 typically used with AFGeofencing or AFProximity to detect member presence.

Properties

  • factoryId A 9-digit alphanumeric code printed inside or on the back of the beacon (hardware ID).

  • deviceId Beacon identifier assigned by the Mobile API (string name).

  • facilityId ID of the Facility this beacon is linked to.

  • uuid Universally Unique Identifier — distinguishes your beacon network from others.

  • major Major grouping value (e.g., floor, room, or building zone).

  • minor Minor identifier for an individual beacon within a group.

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
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var major: Long?
Link copied to clipboard
var minor: Long?
Link copied to clipboard
var uuid: String?

Functions

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