I am implementing BLE scanning and connection using CoreBluetooth in a Flutter application with native iOS Swift code.
BLE scanning and connection work correctly in the foreground and for a short time after the app is sent to the background. However, after some time in the background, BLE scanning stops and the device is no longer discovered. The app appears to be suspended by iOS.
Key Observation:
When location services are actively in use (navigation arrow visible in the iOS status bar), BLE scanning and reconnection work reliably in the background.
When location services are not actively running, BLE scanning stops in the background even though the app has “Always Allow” location permission.
Expected Result
BLE scanning and connection should continue to function in the background using the Bluetooth LE background mode, without relying on active location updates.
Actual Result
BLE scanning starts successfully
App enters background
After some time, scanning stops
Device is no longer discovered
BLE works again only if location services are actively running
BLE Connection Behavior
One-time scan connects successfully to a BLE medical device
App is sent to background
Existing connection does not disconnect
However, new scans or reconnections fail once the app is suspended
Relevant Native iOS Code (AppDelegate)
import Flutter
import UIKit
import CoreBluetooth
@main
@objc class AppDelegate: FlutterAppDelegate {
private var backgroundTaskID: UIBackgroundTaskIdentifier = .invalid
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
GeneratedPluginRegistrant.register(with: self)
if let identifiers =
launchOptions?[UIApplication.LaunchOptionsKey.bluetoothCentrals] as? [String] {
print("App relaunched for BLE state restoration: \(identifiers)")
}
NotificationCenter.default.addObserver(
self,
selector: #selector(appDidEnterBackground),
name: UIApplication.didEnterBackgroundNotification,
object: nil
)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
@objc private func appDidEnterBackground() {
backgroundTaskID = UIApplication.shared.beginBackgroundTask {
self.endBackgroundTask()
}
}
private func endBackgroundTask() {
if backgroundTaskID != .invalid {
UIApplication.shared.endBackgroundTask(backgroundTaskID)
backgroundTaskID = .invalid
}
}
}
Questions for DTS:
Is it expected behavior that CoreBluetooth background scanning effectively stops once the app is suspended, even when the Bluetooth LE background mode is enabled?
Why does BLE background scanning appear to work reliably only when location services are actively running?
Is iOS internally associating BLE background execution with active location updates?
For continuous BLE reconnection (medical device use case), is the recommended approach to rely solely on CoreBluetooth state restoration instead of continuous background scanning?
Is it considered best practice to avoid long-running BLE scans in the background and instead wait for system-delivered BLE events?
Additional Notes
Issue is reproducible on real devices
Not using private APIs or unsupported background execution methods
Objective is to follow Apple-recommended, App Store–compliant behavior
Apple Developers
RSS for tagThis is a dedicated space for developers to connect, share ideas, collaborate, and ask questions. Introduce yourself, network with other developers, and foster a supportive community.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I applied to the Apple Developer Program on Jan 17 and my enrollment showed pending for several days. I eventually contacted support on the 27th and they told me they needed additional documentation and sent me a link to upload and asked me to email them once I've done so, so that they can get it reviewed quickly.
On Jan 27, I uploaded the documents they requested and sent the email confirming they've been uploaded as was requested. After several days, it still says "pending".
I spoke with support today and they said they have the documents and there's nothing for me to do other than wait for them to be reviewed and this "could take months". I'm in the process of purchasing a business and need this account so that they can transfer me the mobile app. My due diligence period is ending within a few days and need clarity on this approval asap. Has anyone else experienced these types of delays or know how to get the review completed?
Enrollment ID: 7P992248Q5
Case ID: 102811401305
Topic:
Community
SubTopic:
Apple Developers
Hi Team,
Looking for an answer, if it's just us or a widespread issue.
Since Sept, our clients Apple devices can't load a Captive Portal on Apple devices. Client wants the CNA to pop up and I can't get it to happen!
Android and Windows devices all work correctly with their respective popups, but CNA will not work.
No changes done on our side and after multiple tshoots and getting vendors to take multiple PCAPs found, Apple devices are not initiating a HTTP GET request as per Meraki >> https://documentation.meraki.com/MR/MR_Splash_Page/Splash_Page_Traffic_Flow_and_Troubleshooting
The work around is to force a HTTP GET request by manually going into the browser and initiate a http site (we tried 1.1.1.1, also tried other public HTTP sites and it works) and that redirects to our Captive Portal page.
Hi,
I'm on a MacBook M1. Numbers and Pages notified me that 15.1 version is out and I have to download them anew from the App Store.
However, in the App Store it says with both that they're 'Bought' in a greyed out button. So, I can't download them. Please help!
Thanks,
Ying
Topic:
Community
SubTopic:
Apple Developers
I recently replaced my older Macbook with a Mac Mini. My iphone charges fine from a powered USB hub, but when I connect the hub to my new Mac Mini, my phone stops charging. This is the same phone, hub, and cables that worked just fine with my Macbook. I M running Beta 26.3, but the MacBook was also on Beta 26. Anyone have any ideas?
Topic:
Community
SubTopic:
Apple Developers
I've paid - and have the confirmation of subscription email.
But when I try to enroll both on my iphone and macbook air - I get errors. on the iphone said could not complete enrollment. on the macbook it said "not available in your area"
I am in australia and it should work. Does anyone know how to fix the enrollment bugs?
We made a purchase to join the Apple Developer Program, but we have been waiting for 5 days and have not received any response such as an approval or rejection. Are you experiencing the same issue as well?
I tried to enroll some weeks ago, went thru the whole process, it eventually took by IDs, but now I'm stuck on "Enrollement not completed - You enrollment in the Apple Developper pogram could not be completed at this time."
So, after 2 weeks, what's next ?
Recently I've noticed that certain cursor actions cause the finger icon to appear with a gray box around it. It appears when I hover over other icons (for example, the menu items at the top of this website; Microsoft Teams options but not MS Word, etc.). Is this new? Is there a way to get rid of the box?
Topic:
Community
SubTopic:
Apple Developers
Understand other technologies or app doing mirroring will have 2 screens active at the same time. But for Apple iPhone Mirroring is showing only 1 screen at a time and with other protection of same Apple ID, Bluetooth and Wifi for proximity checks.
Hence, it is really considered a iPhone Mirroring?
https://support.apple.com/en-sg/120421
Topic:
Community
SubTopic:
Apple Developers
Using iPhone 16 Pro Max. iOS 26.3-Public Beta.
App using: MyScreen26
I have only been able to use 1 live wallpaper (black and white tyrannosaurus rex) about 2 weeks ago. I wanted to change it today, and have been unable to get any of the live wallpapers to work, even the same one I used the last couple of weeks.
I find the live wallpaper I want, download it. I click on the upper left hand corner to put into 'Loop' mode. I have 'Low Power Mode' and 'Reduce Motion' turned off.
I then click on the arrow on the lower left to open the menu to use the image as a locked screen wallpaper. The screen then shows 'add to album', 'airplay', 'export unmodified original' and 'add to new quick note'. There is no selection for add to wallpaper.
Not sure what I'm doing wrong....any suggestions?
Thanks!
Topic:
Community
SubTopic:
Apple Developers
iPhone 13 mini running iOS 26.2
I went to mirror a stream to a previously used Roku device. The Roku popped right up on the Screen Mirror list, but would not respond. Investigation showed it had lost its network connection - so what showed on the Screen Mirror list was still in cache, not from a current request - and sure enough, after repairing the Roku's LAN connection, it worked fine. That raised these questions:
Does the iOS device (iPhone) cache a Screen Mirror list for each network?
How does the iOS device build its list of Screen Mirror servers on a local network? I presume it broadcasts a request to the LAN, the first time it is invoked on a new LAN, asking "Does anyone provide this service?" - Is that correct? [Is that broadcast a Bonjour function?] If not, how does it acquire its list of Screen Mirror servers?
To avoid the problem of false positives in the Screen Mirror list, how can I clear that cache (#1) and issue a new request (#2) for current Screen Mirror servers? How can iOS avoid showing servers that no longer exist on the network?
Is there any limit to the number of networks cached by iOS, or the number of servers cached per network?
More generally, is there a good resource to read how iOS manages this issue?
Topic:
Community
SubTopic:
Apple Developers
Is anyone else experiencing issues with CarPlay with this beta update?
Hi all,
I just submitted my application to join the Developer Program.
I went through the form, and got to the payment screen and filled out.
I submitted and have received an "order acknowledgement" email, but I note that payment hasn't been taken, nor do I have any other emails regarding it.
I understand my application can take a while to progress and it's still early days, but I'm concerned that it's stuck in limbo as payment hasn't been taken.
With that and the notice on my account page that still reads:
"Purchase your membership.
To continue your enrollment, complete your purchase now
Your purchase may take up to 48 hours to process."
When I navigate to the payment screen again, I can see that there is no CVV field which my bank requires to accept payments.
I'm wondering if anyone has had a similar issue and how they resolved or, even, if I have done something wrong during the application phase.
Thanks!
Topic:
Community
SubTopic:
Apple Developers
So I've been bugging Apple (and anyone who will listen) for years, about the hassles that come with having one ID for iCloud+ (primary) and one ID for purchases (secondary). I forget why the split, but there was a reason, that's long since gone.
Since discovering last year that finally, Apple have provided a way to transfer purchases from secondary to primary, I have lost so... much... time... trying to make this work. Following checklists many times... upgrading, downgrading, removing profiles... deregistering from TestFlight etc etc. After escalating within Apple support, the "solution" came back as "It's because you're a developer - you can't."
Now, I've been around the block in 'puters enough times to know that, that "solution" is - even if correct, the "cause". A solution, it ain't. But in any case, surely Apple wouldn't do that to "us", right? Everyone else affected by the two-account hassles is now cured... but for those of us who live on our Macs and iPhones making software for Apple and its communities, it's "screw you guys".
I'll try and climb off my high horse now... but man, frustrated is not even close, not helped by another 3 hours on the phone today, getting cut off twice and having to repeat myself again and again. I've even suggested de-registering as a dev, transferring assets etc... but one person even told me (albeit as if he was clutching at straws) that once a dev, that's it - no way back, and some options like transfer are gone forever!
Has anyone here - as a developer - managed to transfer their purchases from one ID to another? Does anyone know any more about this? Can anyone put me out of my misery - or offer some calming advice before I totally lose my sh...share of sanity.
Topic:
Community
SubTopic:
Apple Developers
Hi,Does anyone else encountered a delayed or unresponsive change when trying to change input languageon macos Sierra?Beta1 and 2 same problem.Working great on El Capitan.Thanks in advanced
Hello,
I'm reaching you because I have an issue on my mac (very new user), I tried to install Ghostty 1.2.3 on my macos 26.2 from brew or the dmg file from their website.
When I try top open it I have the popup with the message "Apple could not verify "Ghostty" is free of malware..."
After many discussions with them on discord, many attempts on clearing Gatekeeper cache, rebooting, reinstalling there is now way for me to have it working.
When I check the notarization on my machine I have this
spctl -a -vvv -t install /Applications/Ghostty.app
/Applications/Ghostty.app: rejected
source=Unnotarized Developer ID
origin=Developer ID Application: Mitchell Hashimoto (24VZTF6M5V)
While other people can check it and it is marked as notarized and they can open it without any issue.
I could bypass Gatekeeper to make it work, but it's a bad solution and I'm looking for a way to understand why is this happening only on my machine.
Any expert who could help me would be great !
Thanks in advance
Topic:
Community
SubTopic:
Apple Developers
We're sending the spcData payload to our fairplay key server (version 5.1) with the base64 encoded string of our fairPlay.cer that was downloaded from our developer portal and we're getting a spcVersionErr (-42580) for the spc version. The value that is being received by the key server seems to be 813827283 when it should be either 1 (base_constants.SPCVersion.v1.rawValue) or 2 (base_constant.SPCVersion.v2.rawValue). We're assuming we're encoding the fairplay.cer incorrectly. Any insight from anybody would be appreciated.
Excited to be here programming with Swift Programming Language skills. I have already learned as part of my skillset: commands, functions and for loops. I will contribute as much as time allows on this forum as well as ask questions if I get stuck with programming concepts.
Topic:
Community
SubTopic:
Apple Developers
Hello,
I'm having a serious problem registering for the Apple Developer Program, and I can't resolve it.
I applied over two weeks ago, but I still haven't received an activation email. I've also tried using different credit cards, suspecting there might be a problem with my payment method.
The main issues are as follows:
My order/registration remains in the "processing" status,
I haven't received an activation email,
Apple Developer Program support isn't responding.
I've already sent over seven emails to support, but haven't received any response or updates.
Has anyone else encountered a similar situation?
Topic:
Community
SubTopic:
Apple Developers