Posts under App & System Services topic

Post

Replies

Boosts

Views

Created

Does anyone know how to achieve this custom MKAnnotation?
I’ve notice that in Maps, some pins contain images and do not have the little triangle at the bottom of it, yet they still animate the same when clicked. How could this be achieved? I believe the name of this annotation is MKMapFeatureAnnotation. I've tried this and it did not give the same result. I'm able to create a custom MKMarkerAnnotationView but it does not animate the same (balloon animation like the MKMapFeatureAnnotation). I was looking forward to create a custom MKMapFeatureAnnotation similar in design which would animate the same. Unfortunately, I cannot create a custom MKMapFeatureAnnotation because everything is privated
0
0
171
1w
Unexpected CoreBluetooth background suspension without active location updates
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
2
0
255
1w
Intended Flow of Invalidating the pushToStartToken When User Logs Out
Hi, we start and update Live Activities with ActivityKit push notifications in our app, but want to do so only if the user is logged in. Therefore we only send the pushToStartToken to the server when a user logs in (or when the token changed and the user is still logged in.) When the user logs out, we remove that start token from our server so that no LA can be started while the app is in the logged out state. This means that the logout isn't happening immediately but is waiting for that deletion request to succeed. This could also fail and lead to the use rnot being able to log out, e.g. if the user has no internet access. If that deletion request would be fire and forget, we would end up in a state where the server still has the token and might start LAs without any user being logged in. The token flow for Remote Push Notifications is different, on the other hand: requesting a token asynchronously via UIApplication.shared.registerForRemoteNotifications() but invalidating it synchronously (at least from the app's perspective) on logout via UIApplication.shared.unregisterForRemoteNotifications(), which makes it way easier for us to make sure the app does not get notifications when no user is logged in. We're wondering if we're just holding it wrong or if our way of handling the LA token deletion is indeed the intended one?
0
1
95
1w
iOS UDP transmission always experiences packet loss
My iOS application needs to connect a device by wifi and exchange data between them. The way of transmission is using the UDP protocol, most of all, it works well. But some part of iOS devices will loss the package always. Even if re-open the application or reboot wifi devices, or reboot iOS devices, it can not be solved. Only reset the network settings on iOS devices could fix it. But this can not make sure that be well always, if occurs in the future. User need to reset network setting again. Are there any brothers know or meet this phenomenon? Thanks for your time to research this.
2
0
77
1w
CloudKit sync fails across TestFlight iOS + macOS builds — “Field recordName is not marked queryable”
I’m running into a CloudKit sync issue that I can’t reconcile after multiple rebuilds, TestFlight uploads, and entitlement verification, and I’m hoping for guidance on what I’m missing or whether this is expected behavior. Context App: RankSpinnah Platforms: iOS + macOS Distribution: TestFlight Xcode: 26.x Both apps use the same bundle identifier, same container, and same Apple Developer team Automatic signing enabled; Xcode-managed profiles CloudKit capability enabled for both targets Both builds install and run correctly from TestFlight on: iPhone 17 Pro Apple-silicon Mac (M5 MacBook Pro) The Problem CloudKit data does not sync at all between devices. On both iOS and macOS, CloudKit queries return no records, and I consistently see this error: Field 'recordName' is not marked queryable This occurs even when querying for records that should exist and after fresh installs on both devices. What I’ve Verified Same iCloud account signed in on both devices CloudKit container exists and is enabled App Sandbox enabled with network access CloudKit entitlements present in the signed app (verified from the archived .app) TestFlight builds are using the correct container Rebuilt and re-uploaded after version bump (1.2.0 / build 2026.02.03) Both iOS and macOS apps successfully uploaded and installed via TestFlight Despite this, no data syncs, and the queryable error persists. What I’m Unsure About Whether recordName is expected to be non-queryable in production schemas Whether TestFlight + CloudKit requires an explicit production schema deploy beyond what Xcode manages Whether this indicates a schema mismatch between development and production environments Or whether something subtle changed in recent Xcode / CloudKit behavior Ask Can someone clarify: Whether querying by recordName should work in production CloudKit What specifically causes the “Field recordName is not marked queryable” error in TestFlight builds What steps are required to ensure CloudKit schemas are correctly deployed for cross-platform sync At this point I feel like I’m missing one critical step, but I can’t identify what it is. Thanks in advance for any guidance.
1
0
96
1w
Screen Time API: ApplicationToken Mismatch / Randomization in Extensions
Description: I am developing a digital well-being application using the Screen Time API (FamilyControls, ManagedSettings, and DeviceActivity). I am encountering a critical issue where the ApplicationToken provided by the system to my app extensions suddenly changes, causing a mismatch with the tokens originally stored by the main application. The Problem: When a user selects applications via FamilyActivityPicker, we persist the FamilyActivitySelection (and the underlying ApplicationToken objects) in a shared App Group container. However, we are seeing frequent cases where the token passed into: ShieldConfigurationDataSource.configuration(shielding:in:) ShieldActionDelegate.handle(action:for:completionHandler:) ...does not match (using ==) any of the tokens previously selected and stored. IOS version: 26.2.1
1
1
137
1w
Scheduled events reach threshold almost immediately on iOS 26.2
Hi, we are developing a screen time management app. The app locks the device after it was used for specified amount of time. After updating to iOS 26.2, we noticed a huge issue: the events started to fire (reach the threshold) in the DeviceActivityMonitorExtension prematurely, almost immediately after scheduling. The only solution we've found is to delete the app and reboot the device, but the effect is not lasting long and this does not always help. Before updating to iOS 26, events also used to sometimes fire prematurely, but rescheduling the event often helped. Now the rescheduling happens almost every second and the events keep reaching the threshold prematurely. Can you suggest any workarounds for this issue?
2
2
188
1w
Enrollment Stuck in "Processing" for Organization
Hello everyone, I’m currently enrolling as an Organization from Albania and I’ve been stuck on the "Enrolling" status for 8 business days now. I have my D-U-N-S number sorted and everything was submitted. I sent an email last week to the support but I haven't heard back yet. I’ve already sent another support message 2 days ago but no reply so far. I’m curious to hear from others who have enrolled recently (especially in 2026): How long did your organization verification take? Did you receive a verification phone call, or was it just approved via email? For those in the Balkans/Europe, did you have to provide extra local business registry documents (like the QKB extract) manually? I’m trying to time my launch with my Google Play release, so I’m a bit anxious about the "black hole" of waiting. Any experiences or "nudge" tips would be greatly appreciated! Thanks!
0
0
115
1w
iOS 26 Crash: _xzm_xzone_malloc_freelist_outlined in com.apple.network.connections
Hello Apple Support Team, We are seeing a production crash on iOS 26 devices that appears to originate from Apple system frameworks rather than application code. Crash Summary Crash signature: _xzm_xzone_malloc_freelist_outlined Crashed thread: com.apple.network.connections Frameworks involved: CFNetwork, Security, libdispatch, libsystem_malloc Affected OS: iOS 26.x App built with: Xcode 16 Devices: Multiple models (not device-specific) Reproducibility: Intermittent, higher frequency during app launch / background networking Observed Stack Trace (top frames) _xzm_xzone_malloc_freelist_outlined dispatch_data_create_alloc xpc_data_deserialize SecTrustEvaluateIfNecessary CFNetwork HTTPProtocol / HTTP3Connection com.apple.network.connections App Context The app uses URLSession for networking. Multiple third-party SDKs are integrated (Firebase Analytics, Dynatrace, Appsflyer, and similar analytics/monitoring SDKs). These SDKs perform concurrent background network requests, especially during app launch and foreground transitions. No unsafe memory operations (manual malloc/free, unsafe pointers, or custom networking stacks) are used in the app code. Key Observations The crash is predominantly observed on iOS 26 and not on earlier iOS versions. Stack traces do not include application symbols. Disabling or delaying analytics SDK initialization significantly reduces the crash rate. Reducing concurrent network requests and limiting HTTP/3 usage also mitigates the issue. This suggests a potential regression in CFNetwork / Network.framework / HTTP/3 handling combined with the new memory allocator (xzone) on iOS 26. Impact Random app termination during background networking. Occurs without a clear deterministic repro path, making it difficult to fully mitigate at the app level. Request Could you please help investigate whether this is a known iOS 26 issue related to: HTTP/3 / QUIC networking XPC deserialization Memory allocation in the new xzone allocator High-concurrency network requests We would appreciate guidance on: Recommended mitigations Whether this issue is already tracked internally Any best practices for apps integrating multiple analytics SDKs on iOS 26 Crash logs and additional diagnostics can be provided if needed. Thank you for your support. Best regards, Dhananjay
0
0
83
1w
UNLocationNotificationTrigger not firing reliably in China – possible coordinate system mismatch
Problem Description Location-based notifications added with UNLocationNotificationTrigger and CLCircularRegion do not fire consistently when the user enters the monitored region. Sometimes they work, sometimes they do not. In tests where the user physically enters the region and waits several days, the notification often never triggers. What we’ve confirmed Notification permission is granted Location permission is set to “Always” The notification request is successfully added (no error from UNUserNotificationCenter.add) Pending notification requests are present when checked with getPendingNotificationRequests CLLocationManager didEnterRegion / didExitRegion work when we monitor the same region via startMonitoring(for:) UNLocationNotificationTrigger behavior is inconsistent and unreliable in our tests Reproduction Steps Launch the app and grant notification permission and “Always” location permission Add a region notification (either by current GPS location or by selecting a point from MKLocalSearch) Leave the monitored region Later, physically return into the region Expected: a notification is delivered when entering the region Actual: the notification often does not appear, even after waiting days Our Hypothesis: Coordinate System Mismatch in China We suspect the issue may be related to coordinate systems in mainland China. In China, Apple MapKit and MKLocalSearch use GCJ-02 (the “Mars” coordinate system required by local regulations). Device GPS and CLCircularRegion / Core Location use WGS-84. If an app supplies GCJ-02 coordinates to CLCircularRegion (e.g. from MapKit or search), the region center may be offset by hundreds of meters from the actual WGS-84 position. That could make the system’s “inside region” check fail, even when the user is physically inside the intended area. Questions for Apple Does CLCircularRegion (and therefore UNLocationNotificationTrigger) expect coordinates in WGS-84? If so, should apps in China convert GCJ-02 to WGS-84 before passing coordinates to CLCircularRegion? Is there any official guidance or documentation for handling coordinate systems when using location-based notifications in mainland China? Are there known limitations or special requirements for UNLocationNotificationTrigger in China (e.g. coordinate system, accuracy, or system behavior) that could explain intermittent or missing triggers?
0
1
78
1w
Expected behavior of searchDomains
Based on https://developer.apple.com/documentation/networkextension/nednssettings/searchdomains , we expect the values mentioned in searchDomains to be appended to a single label DNS query. However, we are not seeing this behavior. We have a packetTunnelProvider VPN, where we set searchDomains to a dns suffix (for ex: test.com) and we set matchDomains to applications and suffix (for ex: abc.com and test.com) . When a user tries to access https://myapp , we expect to see a DNS query packet for myapp.test.com . However, this is not happening when matchDomainsNoSearch is set to true. https://developer.apple.com/documentation/networkextension/nednssettings/matchdomainsnosearch When matchDomainsNoSearch is set to false, we see dns queries for myapp.test.com and myapp.abc.com. What is the expected behavior of searchDomains?
6
0
166
2w
Widget & Snapshot Blank on iOS 26
Some of the users of my app reported that, the widgets cannot be loaded, event after restarts and re-installs. It seems that it is not rare, I have tens of reports on this (and probably much more who didn't report). It seems the widget is blank even on the gallery screen while you are first adding it: struct SingleWidgetProvider: AppIntentTimelineProvider { @Environment(\.widgetFamily) var family private let viewModel: WidgetViewModel = WidgetViewModel() func placeholder(in context: Context) -> SingleEntry { SingleEntry(date: Date(), habit: .singleSample) } func snapshot(for configuration: SingleWidgetConfigurationIntent, in context: Context) async -> SingleEntry { guard let habit = Array(PersistenceManager.shared.retrieveHabitList().habits).first else { return SingleEntry(date: Date(), habit: .singleSample) } let displayable = viewModel.displayableFromHabit(habit, separateComponents: true, secondOffset: 0) return SingleEntry(date: Date(), habit: displayable) } func timeline(for configuration: SingleWidgetConfigurationIntent, in context: Context) async -> Timeline<SingleEntry> { var entries: [SingleEntry] = [] guard let counter = configuration.currentCounter else { return Timeline(entries: [SingleEntry(date: Date(), habit: .singleSample)], policy: .atEnd) } guard let habit = PersistenceManager.shared.retrieveHabit(habitKey: counter.id) else { return Timeline(entries: [SingleEntry(date: Date(), habit: .singleSample)], policy: .atEnd) } let currentDate = Date() for secondOffset in 0 ..< 100 { let displayable = viewModel.displayableFromHabit( habit, separateComponents: true, secondOffset: secondOffset, symbolName: habit.habitSymbol?.name ?? "", overrideColor: configuration.currentColor.color, overrideButtonVisibility: configuration.currentButtonVisibility, overrideDisplayOption: configuration.currentDisplayOption ) let entryDate = Calendar.current.date(byAdding: .second, value: secondOffset, to: currentDate)! let entry = SingleEntry(date: entryDate, habit: displayable) entries.append(entry) } return Timeline(entries: entries, policy: .atEnd) } } struct SingleEntry: TimelineEntry { let date: Date let habit: HabitDisplayable } static var singleSample: HabitDisplayable { return HabitDisplayable(habitKey: nil, title: LS("sampleWidgetHabitTitle"), dates: [Date(timeIntervalSince1970: 1507158360)], displayOption: .dayMonthYear, secondOffset: 0, separateComponents: true) } func displayableFromHabit( _ habit: Habit, separateComponents: Bool, secondOffset: Int, symbolName: String = "", overrideColor: Color? = nil, overrideButtonVisibility: WidgetButtonVisibility? = nil, overrideDisplayOption: WidgetDisplayOption? = nil ) -> HabitDisplayable { let latestDates: [HabitDate] let displayOption: DisplayOption if let overrideDisplayOption { if overrideDisplayOption == .sameAsCounter { displayOption = habit.settings?.toValue.displayOption ?? .dayMonthYear } else { displayOption = DisplayOption(rawValue: overrideDisplayOption.rawValue - 1) ?? .dayMonthYear } } else { displayOption = habit.settings?.toValue.displayOption ?? .dayMonthYear } let displayMode = displayOption.mode switch displayMode { case .timePassed, .date: latestDates = PersistenceManager.shared.latestDate(habit: habit).map { [$0] } ?? [] case .activity: latestDates = PersistenceManager.shared.retrieveHabitDates(habit: habit, limitDate: displayOption.limitDate()) } let displayButton: Bool if let overrideButtonVisibility { if overrideButtonVisibility == .sameAsCounter { displayButton = habit.settings?.toValue.buttonType == .onRow } else { displayButton = overrideButtonVisibility == .show } } else { displayButton = false } return HabitDisplayable( habitKey: habit.habitKey, title: habit.title, dates: latestDates.map { $0.date }, displayOption: displayOption, secondOffset: secondOffset, separateComponents: separateComponents, color: overrideColor ?? habit.habitColor?.color ?? .appPrimary, symbolName: symbolName, displayButton: displayButton ) } I provided a large portion of my code, let me know if you need more. The strange thing here is, even if the DB connection is broken somehow, it should have shown the default option (singleSample). I am not able to reproduce/fix this for months now, so any help is very appreciated.
1
0
53
2w
Scene-based Launch Detection
Our app supports UIScene. As a result, launchOptions in application(_:didFinishLaunchingWithOptions:) is always nil. However, the documentation mentions that UIApplication.LaunchOptionsKey.location should be present when the app is launched due to a location event. Given that our app is scene-based: How can we reliably determine whether the app was launched due to a location update, geofence, or significant location change? Is there a recommended pattern or API to detect this scenario in a Scene-based app lifecycle? This information is critical for us to correctly initialize location-related logic on launch. Relevant documentation: https://developer.apple.com/documentation/corelocation/cllocationmanager/startmonitoringsignificantlocationchanges()
1
0
125
2w
BLE Advertising in Background
For our research study, it is essential that the app can advertise BLE packets even when the app is no longer in the foreground (for example, when it is in the app switcher / recents state). Is it supported to advertise BLE packets while the app is in the background or recents state? If so, what are the specific requirements or limitations we should be aware of (background modes, payload size, timing, etc.)? Are there any constraints that would prevent consistent BLE advertising for research use cases?
2
0
163
2w