Bluetooth devices could not be detected in the background on iOS 16.6.
Up until iOS16.0.3, the same code was able to detect Bluetooth devices.
Did the update between iOS 16.0.3 and iOS 16.6 put restrictions on Bluetooth scanning?
It is initiating a Bluetooh scan upon beacon detection.
The beacon is detectable.
Below is the code.
func locationManager(_ manager: CLLocationManager, didDetermineState state: CLRegionState, for region: CLRegion) {
switch (state) {
case .inside:
print("StartBeaconNavigation: iBeacon inside")
myLocationManager.requestAlwaysAuthorization()
if(bleManager.linkState == .disconnected) {
_=bleManager.startScan()
}
break;
case .outside:
print("StartBeaconNavigation: iBeacon outside")
break;
case .unknown:
print("StartBeaconNavigation: iBeacon unknown")
break;
}
}
func startScan() -> Bool {
print("BTMana:startScan")
if( centralManager.state == .poweredOn ) {
if centralManager.isScanning == false {
let UUIDs: [CBUUID] = [systemServiceUUID]
let scanOptions = [CBCentralManagerScanOptionAllowDuplicatesKey: true]
centralManager.scanForPeripherals(withServices: UUIDs, options: scanOptions)
return true
} else {
print("BTMana:startScan NG for scanning...")
return false
}
} else {
print("BTMana:startScan NG for state is not powerdOn ")
return false
}
}
As above, we are specifying the UUID of the service when scanning.
Thank you in advance.
Post
Replies
Boosts
Views
Activity
Hello.
I am trying to create an app that detects the beacon and makes a BLE connection when the beacon is turned on while the iPhone is in sleep mode, without the app being on the app switcher.
However, there are often times when beacons cannot be detected or BLE connections cannot be made.
From what I've found, it's because iOS limits beacon/BLE scanning for security reasons.
I know it's impossible, but is there any way to remove this restriction on scanning?
If you can't, we would like to know when iOS places restrictions on scanning.
If you can't, then we would like to know when iOS places restrictions on scanning and when those restrictions are lifted.
Thank you very much.
Development Environment:
iPhone8 (iOS 13.7),
iPhone13(iOS 16.0.3),
macOS Monterey,
MacBook Pro 2020(Intel Core i5),
Xcode 14.2
I'm trying to create a system that unlocks the machine just by holding the iPhone over the SuiCa registered on the iPhone and a ticket gate.
To do that, you need to create a pass that supports express mode in the wallet app.
However, no matter how much I search, I don't know how to create a path that supports express mode.
In the first place, it seems that Apple will not give permission to make unless it is a global company like BMW.
So I gave up trying to make my own.
However, I found out that there are a number of services that will create a wallet pass for you.
However, I couldn't find any service that can generate an express mode compatible path among the many services.
The service you want may not exist.
But if you know of a service that miraculously can generate paths that support express mode, please let me know.