I implemented BGContinuedProcessingTask in my app and it seems to be working well for everyone except one user (so far) who has reached out to report nothing happens when they tap the Start Processing button. They have an iPhone 12 Pro Max running iOS 26.1. Restarting iPhone does not fix it.
When they turn off the background processing feature in the app, it works. In that case my code directly calls the function to start processing instead of waiting for it to be invoked in the register block (or submit catch block).
Is this a bug that's possible to occur, maybe device specific? Or have I done something wrong in the implementation?
func startProcessingTapped(_ sender: UIButton) {
if isBackgroundProcessingEnabled {
startBackgroundContinuedProcessing()
} else {
startProcessing(backgroundTask: nil)
}
}
func startBackgroundContinuedProcessing() {
BGTaskScheduler.shared.register(forTaskWithIdentifier: taskIdentifier, using: .main) { @Sendable [weak self] task in
guard self != nil else { return }
startProcessing(backgroundTask: task as? BGContinuedProcessingTask)
}
let request = BGContinuedProcessingTaskRequest(identifier: taskIdentifier, title: title, subtitle: subtitle)
request.strategy = .fail
if BGTaskScheduler.supportedResources.contains(.gpu) {
request.requiredResources = .gpu
}
do {
try BGTaskScheduler.shared.submit(request)
} catch {
startProcessing(backgroundTask: nil)
}
}
func startProcessing(backgroundTask: BGContinuedProcessingTask?) {
// FIXME: Never called for this user when isBackgroundProcessingEnabled is true
}
Posts under iOS tag
200 Posts
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
After the update to iOS 17, tapping on message notification shown on CarPlay Dashboard is navigating to the CarPlay app instead of announcing the message notification.
Announce Notifications turned ON
Announce Messages turned ON
Announce New Messages option is selected
Other apps message notifications are announced as expected when tapping on the notification implying that the settings are set as required.
Enabled com.apple.developer.carplay-communication
Class CustomCarPlaySceneDelegate: UIResponder, CPTemplateApplicationSceneDelegate {
func templateApplicationScene(_ templateApplicationScene: CPTemplateApplicationScene,
didConnect interfaceController: CPInterfaceController)
func templateApplicationScene(_ templateApplicationScene: CPTemplateApplicationScene,
didDisconnectInterfaceController interfaceController: CPInterfaceController)
func scene(_ scene: UIScene, willContinueUserActivityWithType userActivityType: String)
}
在 iOS 平台使用 WKWebView 通过file://协议加载本地 HTML 文件时,存储在localStorage中的数据会在 App 后台切换、进程重启后偶尔丢失;但相同代码在安卓 / 鸿蒙平台无此问题。
现在的文档
仅明确了「默认数据存储(defaultDataStore)可将网站数据持久化到磁盘,非持久化存储(nonPersistent)仅存内存」的基础规则;
未提及「file://协议内容即使使用默认持久化存储,也会被归为临时内存存储」这一关键场景限制;
仅在WKURLSchemeHandler关联说明中隐含「自定义 URL 协议可处理 WebKit 原生不支持的 URL 方案」,但未直接关联file://的存储问题。
我找不到如何处理这个问题的官方文档,仅仅有其他的博客说需要增加http/https加载就没有这个问题。
请提供给我官方文档或者官方回复 关于出现这种file:/加载html出现问题的处理办法
Hello All,
I want to implement Text-to-Speech (TTS) and vibration functionality when a push notification arrives. In my app, I am already using Critical Alerts, and the critical alert sound plays correctly in all app states.
However, I need to confirm whether it is possible to trigger Text-to-Speech and custom vibration in all app states:
Foreground
Background
Terminated (killed) state
My Questions:
Is it technically possible for iOS to run Text-to-Speech (using AVSpeechSynthesizer) when a critical alert notification arrives in background or terminated state?
Is it possible to trigger custom vibration patterns from a critical alert when the app is not running?
If yes, can someone please provide guidance or sample code on how to implement this?
If no, can Apple explain the limitation or provide documentation confirming that TTS and vibration cannot be triggered in background/kill states?
What works currently:
TTS and vibration only work in foreground when the app is active.
Critical alert sound works correctly in all states.
I want confirmation on whether iOS supports background/terminated TTS and vibration, or if this is a platform restriction even when using Critical Alerts.
Thank you!
Hello there,
I'm trying to implement feature which uses AirPlay with Apple TV. I want to disconnect from the device programmatically when something happens. Under something I mean a situation when a user wants to stop broadcasting (for example close the PiP window on his phone). I use this snippet:
try audioSession.setCategory(.playAndRecord, options: .defaultToSpeaker)
try audioSession.setActive(true, options: .notifyOthersOnDeactivation)
It works fine sometimes but not always (it works on iOS 18 but it doesn't on iOS 17 or ). So I thought it's a bug and create a ticker to feedback assistant (FB21220013). The support told me write a post on the forum.
I’m facing an issue in our native iOS app that occurs specifically on iOS 26.1 (not observed on any lower versions). When I update a @State field value, the UI does not reflect the change as expected.
The @State variable updates internally, but the view does not re-render.
This behaviour started after upgrading to iOS 26.1.
Works fine on iOS 26.0 and earlier versions.
Has anyone else encountered this issue or found a workaround? Any insights or suggestions would be greatly appreciated.
We have an app in Swift that uses push notifications. It has a deployment target of iOS 15.0
I originally audited our app for iOS 26 by building it with Xcode 26 beta 3. At that point, all was well. Our implementation of application:didRegisterForRemoteNotificationsWithDeviceToken was called.
But when rebuilding the app with beta 4, 5 and now 6, that function is no longer being called.
I created a simple test case by creating a default iOS app project, then performing these additional steps:
Set bundle ID to our app's ID
Add the Push Notifications capability
Add in application:didRegisterForRemoteNotificationsWithDeviceToken: with a print("HERE") just to set a breakpoint.
Added the following code inside application:didFinishLaunchingWithOptions: along with setting a breakpoint on the registerForRemoteNotifications line:
UNUserNotificationCenter.current().requestAuthorization(options: [.badge, .alert, .sound]) { granted, _ in
DispatchQueue.main.async {
UIApplication.shared.registerForRemoteNotifications()
}
}
Building and running with Xcode 26 beta 6 (17A5305f) generates these two different outcomes based upon the OS running in the Simulator:
iPhone 16 Pro simulator running iOS 18.4 - both breakpoints are reached
iPhone 16 Pro simulator running iOS 26 - only the breakpoint on UIApplication.shared.registerForRemoteNotifications is reached.
Assuming this is a bug in iOS 26. Or, is there something additional we now need to do to get push notifications working?
If I have two iOS apps, with bundle ids com.mycompany.A and com.mycompany.B, and they both have the shared group id of group.com.mycompany.B, then they can read/write data to same file (in shared defaults or, for example, a Realm database saved to the same shared group location).
What I have noticed is that if both apps get installed and some data X written to shared defaults (but data which isn't accessed by both apps i.e. if only app A uses this data), then if app A is deleted and reinstalled then X is not deleted in this situation (unless both apps A and B are deleted).
I guess that is to be expected as they both use the same group id and the OS won't clear that area out unless both apps are deleted.
However I think I am seeing a situation where if app A has group.com.mycompany.A as its group and app B has group.com.mycompany.B as its group, then this is still the same situation - data written by app B for doesn't get deleted if only app B is deleted/reinstalled on the phone. It won't get deleted unless both app B and A are deleted from the phone.
This is not what I was expecting.
I need to perform some more checks (its more complex to verify as app A is developed by one company and app B by another), but if this were to be the case would this be unexpected behavior by the OS? Presumably it would be unexpected as the container should be identified by the full group id and not a partial portion of the group id right?
Hi,
We've noticed that this issue occurs more frequently after upgrading to iOS 18.4.1 and can result in one-way audio.
Our app uses CallKit with WebRTC to establish VoIP connections.
However, on iOS 18.4.1, CallKit no longer triggers:
func provider(_ provider: CXProvider, didActivate audioSession: AVAudioSession)
We're currently comparing the occurrence rate across different iOS versions to better understand the impact.
Could you please help analyze the root cause of this issue?
Hi Team,
How do I prevent screenshots using SwiftUI. I was using this solution on UIKit:
extension UIView {
func makeSecure() {
DispatchQueue.main.async {
let protectedView = UIView()
self.superview?.addSubview(protectedView)
// constraints...
let secureView = SecureView()
self.superview?.addSubview(secureView)
// constraints...
secureView.addSecureSubview(self)
// constraints...
}
}
}
class SecureView: UIView {
private lazy var secureField: UIView = {
var secureField: UIView = UIView()
// ...
if let secureContainer = SecureField().secureContainer {
secureField = secureContainer
}
...
return secureField
}()
required init() { ... }
}
Is it posible to do the same thing using SwiftUI. Do we have an example? What would you recommend when we work with confidencial information in SwiftUI like bank account information?
Thanks in advance!
Hi all,
It has been >30 days since my app was removed, and I was served with the pending account termination notice. Similar to others, I was flagged for section 3.2(f). Submitted an appeal, explicitly addressing every possible violation, offered to show source code with entire history, and also have all the email threads of me providing customer support to my users, and also multiple 5 star reviews. However, I was met with the rejection and the confirmation that the account would be terminated.
Fast forward more than 30 days, my account is still here, but no closure or clarification at all regarding what I can do moving forward. Understandably, the team deals with millions of submissions and apps, but isn’t it reasonable (given that we pay $100/yr) to at least get some clarification on what went wrong?
Currently, all I want to know is,
Can I create a new account and develop other apps? Or will I risk getting banned again, hence wasting another $100?
If I am able to proceed, what do I need to do to make sure my app doesn’t get randomly terminated again? Why aren’t there any signs or warnings?
If anyone is able to assist me on this, I would greatly appreciate it. Thank you so much!
Is the Cancel button intentionally removed from UISearchBar (right side)?
Even when using searchController with navigationItem also.
showsCancelButton = true
doesn’t display the cancel button.
Also:
When tapping the clear ("x") button inside the search field, the search is getting canceled, and searchBarCancelButtonClicked(_:) is triggered (Generally it should only clear text, not cancel search).
If the search text is empty and I tap outside the search bar, the search is canceled.
Also when I have tableview in my controller(like recent searches) below search bar and if I try to tap when editing started, action is not triggered(verified in sample too). Just cancellation is happening.
In a split view controller, if the search is on the right side and I try to open the side panel, the search also gets canceled.
Are these behaviors intentional changes, beta issues, or are we missing something in implementation?
In iOS AP-mode onboarding for IOT devices, why does the iPhone sometimes stay stuck on the device Wi-Fi (no internet) and fail to route packets to the device’s local IP, even though SSID is correct?
Sub-questions to include:
• Is this an iOS Wi-Fi auto-join priority issue?
• Can AP networks become “sticky” after multiple joins?
• How does iOS choose the active routing interface when Wi-Fi has no gateway?
• Why does the packet never reach the device even though NWPath shows WiFi = satisfied?
We are facing a DNS resolution issue with a specific ISP, where our domain name does not resolve correctly using the system DNS. However, the same domain works as expected when a custom DNS resolver is used.
On Android, this is straightforward to handle by configuring a custom DNS implementation using OkHttp / Retrofit. I am trying to implement a functionally equivalent solution in native iOS (Swift / SwiftUI).
Android Reference (Working Behavior) :
val dns = DnsOverHttps.Builder()
.client(OkHttpClient())
.url("https://cloudflare-dns.com/dns-query".toHttpUrl())
.bootstrapDnsHosts(InetAddress.getByName("1.1.1.1"))
.build()
OkHttpClient.Builder()
.dns(dns)
.build()
Attempted iOS Approach
I attempted the following approach :
Resolve the domain to an IP address programmatically (using DNS over HTTPS)
Connect directly to the resolved IP address
Set the original domain in the Host HTTP header
DNS Resolution via DoH :
func resolveDomain(domain: String) async throws -> String {
guard let url = URL(
string: "https://cloudflare-dns.com/dns-query?name=\(domain)&type=A"
) else {
throw URLError(.badURL)
}
var request = URLRequest(url: url)
request.setValue("application/dns-json", forHTTPHeaderField: "accept")
let (data, _) = try await URLSession.shared.data(for: request)
let response = try JSONDecoder().decode(DNSResponse.self, from: data)
guard let ip = response.Answer?.first?.data else {
throw URLError(.cannotFindHost)
}
return ip
}
API Call Using Resolved IP :
func callAPIUsingCustomDNS() async throws {
let ip = try await resolveDomain(domain: "example.com")
guard let url = URL(string: "https://(ip)") else {
throw URLError(.badURL)
}
let configuration = URLSessionConfiguration.ephemeral
let session = URLSession(
configuration: configuration,
delegate: CustomURLSessionDelegate(originalHost: "example.com"),
delegateQueue: .main
)
var request = URLRequest(url: url)
request.setValue("example.com", forHTTPHeaderField: "Host")
let (_, response) = try await session.data(for: request)
print("Success: (response)")
}
Problem Encountered
When connecting via the IP address, the TLS handshake fails with the following error:
Error Domain=NSURLErrorDomain Code=-1200
"A TLS error caused the secure connection to fail."
This appears to happen because iOS sends the IP address as the Server Name Indication (SNI) during the TLS handshake, while the server’s certificate is issued for the domain name.
Custom URLSessionDelegate Attempt :
class CustomURLSessionDelegate: NSObject, URLSessionDelegate {
let originalHost: String
init(originalHost: String) {
self.originalHost = originalHost
}
func urlSession(
_ session: URLSession,
didReceive challenge: URLAuthenticationChallenge,
completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void
) {
guard challenge.protectionSpace.authenticationMethod == NSURLAuthenticationMethodServerTrust,
let serverTrust = challenge.protectionSpace.serverTrust else {
completionHandler(.performDefaultHandling, nil)
return
}
let sslPolicy = SecPolicyCreateSSL(true, originalHost as CFString)
let basicPolicy = SecPolicyCreateBasicX509()
SecTrustSetPolicies(serverTrust, [sslPolicy, basicPolicy] as CFArray)
var error: CFError?
if SecTrustEvaluateWithError(serverTrust, &error) {
completionHandler(.useCredential, URLCredential(trust: serverTrust))
} else {
completionHandler(.cancelAuthenticationChallenge, nil)
}
}
}
However, TLS validation still fails because the SNI remains the IP address, not the domain.
I would appreciate guidance on the supported and App Store–compliant way to handle ISP-specific DNS resolution issues on iOS. If custom DNS or SNI configuration is not supported, what alternative architectural approaches are recommended by Apple?
I would like to inquire about Apple's recommended best practices for iPhone thermal management. Specifically, what actions are developers expected to take to prevent the device from overheating?
I am aware that we should subscribe to Thermal State Notifications and throttle performance accordingly—such as by reducing streaming quality or temporarily disabling active features. Beyond these measures, are there any other strategies you recommend to mitigate thermal issues and help the device cool down?
When you use .navigationTransition(.zoom(sourceID: "placeholder", in: placehoder)) for navigation animation, going back using the swipe gesture is still very buggy on IOS26. I know it has been mentioned in other places like here: https://developer.apple.com/forums/thread/796805?answerId=856846022#856846022 but nothing seems to have been done to fix this issue.
Here is a video showing the bug comparing when the back button is used vs swipe to go back: https://imgur.com/a/JgEusRH
I wish there was a way to at least disable the swipe back gesture until this bug is fixed.
From watching the video on App Attest the answer would appear to be no, but the video is a few years old so in hope, I thought I would post this question anyway.
There's several scenarios where I would like a notification service extension to be able to use App Attest in communications with the back end(for example to send a receipt to the backend acknowledging receipt of the push, fetching an image from a url in the push payload, a few others).
Any change App Attest can be used in by a notification service extension?
I'm using a custom modifier called AutoSheetDetentModifier to automatically size a sheet based on its content.
On iOS 26, it works as expected: the content height is measured correctly and the sheet shrinks to match that height.
However, on iOS 16, 17 and 18, the same code doesn’t work. The content height is still measured, but the sheet does not reduce its height. Instead, the sheet remains larger and the content appears vertically centered. (Note that content() includes ScrollView)
public struct AutoSheetDetentModifier: ViewModifier {
@State private var height: CGFloat = 380 // default value to avoid bouncing
public func body(content: Content) -> some View {
content
.modifier(MeasureHeightViewModifier(height: $height))
.presentationDetents([.height(height)])
}
}
public struct MeasureHeightViewModifier: ViewModifier {
@Binding var height: CGFloat
public func body(content: Content) -> some View {
content
.fixedSize(horizontal: false, vertical: true)
.background(
GeometryReader { geo -> Color in
DispatchQueue.main.async {
height = geo.size.height
}
return Color.clear
}
)
}
}
extension View {
public func applyAutoSheetDetent() -> some View {
self
.modifier(AutoSheetDetentModifier())
}
}
public var body: some View {
VStack {
header()
content() // includes ScrollView
footer()
}
.background(Color.customGray)
.applyAutoSheetDetent()
}
func content() -> some View {
ScrollView {
VStack {
ForEach(items) { item in
itemRow(item)
}
}
}
.frame(maxHeight: UIScreen.main.bounds.height * 0.7)
}
Screenshot from iOS 26 (working as expected):
Screenshot from iOS 18 (not working):
How can I make .presentationDetents(.height) shrink the sheet correctly on iOS 16–18, the same way it does on iOS 26?
For a long time our app had this creation of a URLRequest:
var urlRequest = URLRequest(url: url, cachePolicy: .reloadIgnoringLocalAndRemoteCacheData, timeoutInterval: timeout)
But since iOS 26 was released we started to get crashes in this call. It is created on a background thread.
Thread 10 Crashed:
0 libsystem_malloc.dylib 0x00000001920e309c _xzm_xzone_malloc_freelist_outlined + 864 (xzone_malloc.c:1869)
1 libswiftCore.dylib 0x0000000184030360 swift::swift_slowAllocTyped(unsigned long, unsigned long, unsigned long long) + 56 (Heap.cpp:110)
2 libswiftCore.dylib 0x0000000184030754 swift_allocObject + 136 (HeapObject.cpp:245)
3 Foundation 0x00000001845dab9c specialized _ArrayBuffer._consumeAndCreateNew(bufferIsUnique:minimumCapacity:growForAppend:) + 120
4 Foundation 0x00000001845daa58 specialized static _SwiftURL._makeCFURL(from:baseURL:) + 2288 (URL_Swift.swift:1192)
5 Foundation 0x00000001845da118 closure #1 in _SwiftURL._nsurl.getter + 112 (URL_Swift.swift:64)
6 Foundation 0x00000001845da160 partial apply for closure #1 in _SwiftURL._nsurl.getter + 20 (<compiler-generated>:0)
7 Foundation 0x00000001845da0a0 closure #1 in _SwiftURL._nsurl.getterpartial apply + 16
8 Foundation 0x00000001845d9a6c protocol witness for _URLProtocol.bridgeToNSURL() in conformance _SwiftURL + 196 (<compiler-generated>:974)
9 Foundation 0x000000018470f31c URLRequest.init(url:cachePolicy:timeoutInterval:) + 92 (URLRequest.swift:44)# Live For Studio
Any idea if this crash is caused by our code or if it is a known problem in iOS 26?
I have attached one of the crash reports from Xcode:
2025-10-08_10-13-45.1128_+0200-8acf1536892bf0576f963e1534419cd29e6e10b8.crash
My app allows to save user-selected URLs in a list and browse them with a tap. A user reported that the app often shows that when browsing their saved entry for "On My iPad", it's apparently empty (it contains no files).
I saved "On My iPad" in my own list some time ago and noticed that the same issue occurs. The URL seems to be correctly resolved from the saved bookmark data, but I noticed that url.startAccessingSecurityScopedResource() returns false. The other URL I saved some time ago is iCloud Drive, which I can access without issues. If I select "On My iPad" again in a file importer, create new bookmark data from it and resolve the URL from it, access works correctly.
I create bookmark data like this:
let data = try url.bookmarkData(includingResourceValuesForKeys: [.localizedNameKey, .pathKey, .volumeIsLocalKey])
and resolve URLs like this:
let url = try URL(resolvingBookmarkData: data, bookmarkDataIsStale: &bookmarkDataIsStale)
bookmarkDataIsStale is false for both the working and not working URLs for "On My iPad". The two bookmark data are different though, even if url.path is the same.
What could be the issue?