Official SDKs for integrating Bearound's secure BLE beacon detection and indoor location technology across Android, iOS, React Native, and Flutter.
Swift SDK for iOS — secure BLE beacon detection and indoor positioning by Bearound.
- Continuous region monitoring for beacons
- Sends
enterandexitevents to a remote API - Captures distance, RSSI, UUID, major/minor, Advertising ID
- Foreground service support for background execution
- Sends telemetry data (if available)
- Built-in debug logging with tag BeAroundSdk
- Minimum iOS version: 13
- Location or Bluetooth must be enabled on the device
Add the following to info.plist:
<key>NSLocationWhenInUseUsageDescription</key>
<string>Precisamos da sua localização para mostrar conteúdos próximos.</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>Precisamos da sua localização mesmo em segundo plano para enviar notificações relevantes.</string>
<key>NSBluetoothAlwaysUsageDescription</key>
<string>Este aplicativo precisa acessar o Bluetooth para se conectar a dispositivos próximos.</string>
<key>NSUserTrackingUsageDescription</key>
<string>Precisamos do seu consentimento para rastrear sua atividade e oferecer uma experiência personalizada.</string>
<key>NSUserTrackingUsageDescription</key>
<string>Precisamos de sua permissão para rastrear sua atividade e oferecer uma experiência personalizada.</string>Also, in order to run it on background mode, you must add the following:
<key>UIBackgroundModes</key>
<array>
<string>fetch</string>
<string>location</string>
<string>processing</string>
<string>bluetooth-central</string>
</array>✅ Important: In case the user doesn't allow location neither bluetooth access, the SDK won't be able to find possible beacons. So for the SDK works properly the user must has allow at least one of the permissions.
So far the sdk only supports SPM installation, to move forward you must add the following URL to your package dependencies:
https://github.com/Bearound/bearound-ios-sdk.git
*We recommend you to keep the sdk version updated always as possible, to find the newest versions, check for the latest tags on the sdk repository
In case your xcode is not configured with your github access, you must do it, since the repository is private.
Here are the steps visually:
- In order to add your your github account to xcode you need to have an AccessToken, generated on github. You should go to your github account settings page > Developer Settings > Personal Access Tokens > Token classic. We recommend to enable all options, however the only write and read access are needed.
- Add github account to xcode, first add your github account to xcode, open xcode preferences and goes to Accounts tab (Don't worry, you can have more than one synced at once)
- Use your github token in order to connect your account to xcode
- Add the package to your project
- Use the given URL and select the desired version
Initialize the SDK inside your Application class after checking the required permissions:
import BeAround
#Add this next line on wherever you want
Bearound(clientToken: "", isDebugEnable: true).startServices()☝️ You must prompt the user for permissions before initializing the SDK — see example below.
You need to manually request permissions from the user, especially:
- CoreBlutooth (Ask for permission automatically)
- CoreLocation
import CoreLocation
#Add these next lines on wherever you want, just make sure the app is showing the alert
let locationManager = CLLocationManager()
locationManager.delegate = self
locationManager.requestAlwaysAuthorization()- AppTrackingTransparency
if #available(iOS 14, *) {
ATTrackingManager.requestTrackingAuthorization { status in
switch status {
case .authorized:
// User granted permission, you can now access IDFA and track
print("ATT Authorized")
// Example: Retrieve IDFA
let idfa = ASIdentifierManager.shared().advertisingIdentifier
print("IDFA: \(idfa.uuidString)")
case .denied:
// User denied permission, disable tracking functionalities
print("ATT Denied")
case .notDetermined:
// Status is not determined, prompt will be shown
print("ATT Not Determined")
case .restricted:
// Tracking is restricted by system settings (e.g., parental controls)
print("ATT Restricted")
@unknown default:
// Handle future cases
print("Unknown ATT Status")
}
}
}📌 Without these permissions, the SDK will not function properly and will not be able to detect beacons in the background.
⚠️ After initializing it, it starts executing the service, you can follow this by activating the debug and looking at the Logs with the TAG: BeAroundSdk
- The SDK automatically monitors beacons with the UUID
- When entering or exiting beacon regions, it sends a JSON payload to the remote API.
- Events include beacon identifiers, RSSI, distance, app state (foreground/background/inactive), Bluetooth details, and IDFA.
- AES-GCM encrypted payloads
- Obfuscated beacon identifiers
- Privacy-first architecture
- Use physical beacons or nRF Connect
- Check logs
- Ensure runtime permissions are granted
MIT © Bearound