IBeaconScanner


super: Object

The iBeaconScanner allows you to detect nearby iBeacon devices.

Events

  • Load() This event is called when the object becames available in the current runtime system.

  • DidChangeAuthorizationStatus(status: Int) Event raised when a monitored beacon comes in range. This event is not called in the Creo simulator for Mac.

  • DidEnterRegion(uuid: String, major: Int, minor: Int, identifier: String) Event raised when a monitored beacon comes in range. Not available on the iOS simulator and on the Creo simulator for Mac.

  • DidExitRegion(uuid: String, major: Int, minor: Int, identifier: String) Event raised when the user left the range of a monitored beacon. iOS delays exit notifications in undocumented ways. This built-in, non-adjustable delay prevents false “exit” events. The exit notification usually occurs between 30 and 60 seconds after the iBeacon is out of range. Not available on the iOS simulator and on the Creo simulator for Mac.

  • DidDetermineState(state: Int, uuid: String, major: Int, minor: Int, identifier: String) Event raised when there's a state transition for a monitored region or in response to a request for state via a call to requestState. Not available on the iOS simulator and on the Creo simulator for Mac.

  • DidRangeBeacons(beacons: List) Event raised when a new set of beacons are available. The beacons parameter is an array of iBeacon objects. If beacons is empty, it may be assumed no beacons that match the specified region are nearby. Similarly if a specific beacon no longer appears in beacons, it may be assumed the beacon is no longer received by the device. Not available on the iOS simulator and on the Creo simulator for Mac.

  • DidFail(error: String) Event raised when an error has occurred.

  • Unload() This event is called when the object has been removed from the current runtime system (but not yet deallocated).

Properties

  • var objectName: String The name of the object.

Methods

  • func authorizationStatus(): AuthorizationStatus Returns the app’s authorization status for using location services. The authorization status of a given app is managed by the system and determined by several factors. Apps must be explicitly authorized to use location services by the user and location services must themselves currently be enabled for the system.

  • func requestAlwaysAuthorization() Requests the user’s permission for location services whether or not the app is in use. You must request a type of authorization before you can receive location-related information. You may call requestAlwaysAuthorization when the current authorization state is either "Not Determined" (AuthorizationStatus.NotDetermined), or "When in Use" (AuthorizationStatus.WhenInUse).

  • func requestWhenInUseAuthorization() Requests the user’s permission to use location services while the app is in use. You must request a type of authorization before you can receive location-related information. You may call requestWhenInUseAuthorization whenever the current authorization status is not determined (AuthorizationStatus.NotDetermined).

  • func startMonitoring(uuid: String, identifier: String = "", major: Int = -1, minor: Int = -1) Start monitoring for beacons matching the specified filters for uuid, major (opcional) and minor (optional). The DidEnterRegion and DidExitRegion event are raised when the region is entered or exited. If the autorization status is "AuthorizedAlways", these notification are raised regardless of whether your app is running. An app can register up to 20 regions (filters) at a time. Not available on the iOS simulator and on the Creo simulator for Mac.

  • func stopMonitoring(uuid: String, identifier: String = "", major: Int = -1, minor: Int = -1) Stops monitoring the specified region defined by the set of filters for uuid, major (opcional) and minor (optional). Not available on the iOS simulator and on the Creo simulator for Mac.

  • func requestState(uuid: String, identifier: String = "", major: Int = -1, minor: Int = -1) Retrieves the state of the beacons matching the specified filters for uuid, major (opcional) and minor (optional). This method works asynchronously and the state is returned in the DidDetermineState event. Not available on the iOS simulator an on the Creo simulator for Mac.

  • func startRanging(uuid: String, major: Int = -1, minor: Int = -1) Starts the delivery of rante notifications for the specified beacon filters for uuid, major (opcional) and minor (optional). While monitoring creates a virtual fence to detect when you’re moving in and out a set of beacons, ranging returns the list of nearby beacons every second with an estimated proximity value for each beacon. Ranging works only when the app is running so, if you don’t plan to use monitoring, consider the “when in use” level for your apps instead. Not available on the iOS simulator an on the Creo simulator for Mac.

  • func stopRanging(uuid: String, major: Int = -1, minor: Int = -1) Stops the delivery of range notifications for the specified beacon filters for uuid, major (opcional) and minor (optional). Not available on the iOS simulator an on the Creo simulator for Mac.

Enums

AuthorizationStatus

  • .AuthorizedAlways
  • .AuthorizedWhenInUse
  • .Denied
  • .NotDetermined
  • .Restricted