Delve into the world of built-in app and system services available to developers. Discuss leveraging these services to enhance your app's functionality and user experience.

Posts under General subtopic

Post

Replies

Boosts

Views

Activity

iOS 26 Empty Stack Crash
When we compile our app using Xcode 26 and run it on iOS 26, we encounter a strange crash where the crashing thread shows no stack trace. After inspecting the registers, we have initially traced it to the Google Mobile Ads SDK. When we disable the initialization of the Google Mobile Ads SDK, the app no longer crashes. However, running the Google Mobile Ads SDK demo app on iOS 26 alone does not cause any issues; the crash only occurs once it is integrated into our app. We also tried enabling Address Sanitizer and Zombie Objects but found no valuable clues. Could you advise what other methods or tools we can use to further diagnose this issue? Additionally, when we compile the app with Xcode 15 and run it on iOS 26, everything works fine without crashes. app-2025-09-19-161044.ips.txt
4
0
190
14h
What is the current proper way to load an image from local filesystem?
I'm just trying to display an image that is stored in the local filesystem, but the more I dig into this the more confused I get. So previously I used this code (it's simplified): func findImage(name: String) -> UIImage? { do { let url = try FileManager.default.url(for: .applicationSupportDirectory, in: .userDomainMask, appropriateFor: nil, create: false) .appendingPathComponent("MyFolder") .appendingPathComponent("\(name).png") guard let image = UIImage(contentsOfFile: url.path) else { return nil } return image } catch { print(error.localizedDescription) } return nil } Notice I create the URL with just .appendingPathComponent() and turning URL to path via url.path. It works! So what's the question? In Improving performance and stability when accessing the file system I've read that you better use the new appendingPathComponent(_:isDirectory:), that's good, will do. Also url.path is deprecated in iOS18. Should I use url.path(percentEncoded:) instead? What should be the value of percentEncoded when accessing the local filesystem? In this adjacent thread I've read: Don't use UIImage(contentsOfFile:) either, because it's a path-based API. There's no URL-based equivalent, which is an Apple clue that should be doing something else. Is this true? Then how should I store and load my images? Just FYI, I create images like this: private func generateThumbnail(name: String) { guard let drawingWidth = canvasGeo?.size.width, let drawingHeight = canvasGeo?.size.height else { return } let thumbnailRect = CGRect(x: 0, y: 0, width: drawingWidth, height: drawingHeight) Task { UITraitCollection(userInterfaceStyle: .light).performAsCurrent { let image = self.canvasView.drawing.image(from: thumbnailRect, scale: UIScreen.main.scale) guard let data = image.pngData() else { return } // -- HERE do { try FileManager.default.createDirectory(at: try FileManager.default.url(for: .applicationSupportDirectory, in: .userDomainMask, appropriateFor: nil, create: true) .appendingPathComponent("MyFolder"), withIntermediateDirectories: true, attributes: nil) let filename = "\(name).png" let url = try FileManager.default.url(for: .applicationSupportDirectory, in: .userDomainMask, appropriateFor: nil, create: true) .appendingPathComponent("MyFolder") .appendingPathComponent(filename) try data.write(to: url, options: .atomic) // -- and HERE } catch { print(error.localizedDescription) } } } } My usecase — just save the user's PencilKit Canvas as an image and display it back to him on a different View. I'm on SwiftUI and iOS 16+. Would be happy to learn the correct way, thanks!
4
0
2.4k
Jan ’25
Interactive Live Activity Bug in iOS 18 - perform not called
In iOS 18 (beta 1-4) when you set openAppWhenRun = false in your AppIntent of your live activity the perform function never gets called. In iOS 16 and 17 my live activities work. I have downloaded other apps and in their live activities any button tab which doesn´t open the app is also doing nothing in iOS 18. Has anyone got this working? Any comments from an Apple engineer on this?
4
2
1.3k
Apr ’25
Sticker Pack Not Appearing in iMessage
Description: I have developed an iOS app that includes a sticker pack feature. However, when adding stickers to iMessage, they are not appearing as expected. Despite following the standard procedures, the stickers are not visible in the iMessage app. The issue persists even after ensuring compatibility with the latest iOS version. Attached is an image that highlights the problem. Any guidance or suggestions to resolve this issue would be greatly appreciated. Thank you!
4
3
824
Oct ’24
Receive Custom URL Parameters
Hello! I’m trying to handle custom URLs (e.g., customurl://open?param=value) that open the app. However, while the app launches via the custom URL as expected, the parameters are not being passed to or are accessible from the iOS-specific implementation. Currently, if I open a custom URL via Safari, the app gets launched but the custom URL and parameters are not accessible. customurl://open?hello=test According to the iOS Docs ( https://developer.apple.com/documentation/xcode/defining-a-custom-url-scheme-for-your-app#Handle-incoming-URLs ) any URLs should be passed to: func application(_ application: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:] ) -> Bool I do not register the above application function to be called but instead this one is executed during app start with launchOptions always being nil: func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool This is the case regardless of if the App is started fresh or was already running in the background. My pInfo entry for the custom URL: <key>CFBundleURLTypes</key> <array> <dict> <key>CFBundleTypeRole</key> <string>Viewer</string> <key>CFBundleURLName</key> <string>dev.customurl.project</string> <key>CFBundleURLSchemes</key> <array> <string>customurl</string> </array> </dict> <dict/> </array> TLDR: How can I access the parameters, passed with the URL? Any thoughts on what I am doing wrong?
4
0
120
Apr ’25
Defining custom file types
On iOS:When one receives a file of type .pages by email, Mail displays a large Pages icon and tapping on it opens Pages. (A long-press brings up the more complicated Actions screen).When one receives a file of type .vcf by email, Mail displays a large Contacts icon and tapping on it opens Contacts. (A long-press brings up the more complicated Actions screen).I have my own custom file type, .ripf, and I want to have the same behaviour because that is what my users will expect. Accordingly, in my app's Info.plist I have a CFBundleDocumentTypes dictionary providing a one-element LSItemContentTypes array referring to the name 'com.universalis.ripcard', and a UTExportedTypeDeclarations dictionary associating the UTTypeIdentifier 'com.universalis.ripcard' with a public.filename-extension 'ripf' and a public.mime-type 'text/vnd.universalis.ripcard'. All the other entries in those two dictionaries are present and correct as far as I can tell. Both CFBundleDocumentTypes[0].CFBundleTypeIconFiles and UTExportedTypeDeclarations[0].UTTypeIconFiles contain a list of icon files for the file type.(That rather long paragraph is to avoid boring people by including the entire Info.plist!)Some things do work..ripf files received via AirDrop bring up a suitable "Open with..." message which mentions my app, and tapping the message opens the app..ripf files received as an email attachment display as an icon. But it is the app's icon and not the icon of the file type.BUTTapping on a received file's icon does not open the app, but only opens the generic Actions screen, offering Message, Mail, WhatsApp, Notes, and only then (after the user has scrolled sideways) "Copy to..." my app.Now, the whole apparatus of CFBundleDocumentTypes and UTExportedTypeDeclarations is obscure and under-documented, and indeed the main documenation for the latter has a big warning at the top saying that it is obsolete and not being updated. That doesn't matter so much. What I need to know is:(Less important): How do I get the right file icon?(More important): How do I get my app to open when the icon is tapped, as Pages and Contacts do? There must be a way – unless special cases for those two apps are wired into iOS itself.
10
0
6.3k
Apr ’25
URLComponents bug in 18.x
Prior to 18.x, this has worked for years. However, if a port is included, the behavior in 18.x is to return "///some/path". In all previous versions it correctly returns "/some/path". Is this a bug, or documented change we missed? func relativeURLString(for urlString: String) -> String? { guard var components = URLComponents(string: urlString) else { return nil } components.host = nil components.scheme = nil // WE FOUND IF YOU NIL THE PORT BEFORE HOST AND SCHEME, IT WORKS components.port = nil return components.string }
4
0
333
Jan ’25
Issues with Multicast Operations using NWConnectionGroup and NWMulticastGroup
Hello, I've been encountering some challenges while working with NWConnectionGroup and NWMulticastGroup for multicast operations on iOS. I have a few doubts and issues that I would like to address: 1. NWMulticastGroup Initialization It seems that when initializing NWMulticastGroup, only one NWEndpoint can be passed, and attempting to pass multiple endpoints results in failure. Can someone confirm if this behavior is correct? 2. Interface Level Control Upon initializing NWConnectionGroup, it appears that packets are received on all interfaces without the ability to control this at the interface level. Is this correct? If not is there a way to configure NWConnectionGroup to receive packets on all interfaces? 3. Sending Behavior During the send operation, it appears that the data is sent through any one of the available interfaces, and there doesn't seem to be an option to configure it to send through all available endpoints. Is there a way to enable sending data through all available endpoints? Any insights, guidance, or solutions to these issues would be greatly appreciated. Has anyone else encountered similar problems or found workarounds for these limitations? Thank you for your assistance and support. Thanks, Harshal
4
0
759
Jan ’25
How to Set Up Deferred Deep Linking
I have universal links configured for my iOS app which work as expected when the app is installed. When the app is not installed the universal link will go to the browser as expected. What I want to do is redirect to the app store, allow the user to install the app, then redirect them to the initial universal link. Redirecting them to the app store isn't the hard part I can achieve that from the webpage, however I don't know how to save a reference to that initial link to redirect them once they instal the app. What I want the flow to be for a user who doesn't have the app is: visit a universal link (example.com/UUID) redirect to the app store and install the app open the app and redirect to example.com/UUID I've seen some ways people are doing this with the clipboard but I don't love that solution, I also don't want to use a 3rd party service if I can avoid it - how are the 3rd party services making this happen?
4
5
4.5k
Apr ’25
CallKit Call Blocking Not Working
I have also tested this on iOS 26 (Beta 9 and above), and the CallKit call blocking functionality is not working. Numbers that should be blocked still ring through. Caller Identification continues to function as expected, but blocking entries (addBlockingEntry) are ignored.
4
1
163
6d
Inquiry About Deferred Deep Link Limitation and Alternative Options
Dear Apple Support Team, I hope this message finds you well. I’m reaching out to inquire about the limitations of deferred deep linking within iOS applications. Specifically, I’m interested in understanding the constraints and challenges that prevent deferred deep links from functioning as expected in certain scenarios (e.g., when the app is not installed or other related issues). Additionally, I would like to ask if there are any recommended alternative approaches or solutions to implement deep linking, ensuring that users can still be directed to specific content or screens even if they need to install the app first. Your insights and guidance would be greatly appreciated as I work to enhance the user experience in my app. Thank you for your time and assistance. Best regards, Santosh
4
5
1.1k
Apr ’25
What are the requirements of isSIMInserted api newly introduced from iOS 18 onwards
Hello Folks, I recently came through a new API introduced from iOS 18 onwards isSIMInserted and according to the document it is A Boolean property that indicates whether a SIM is present. I really appreciate Apple for introducing such an useful API but there are few queries on what are the requirements for using this API. Query 1: Do we need any special entitlements for making use of this API. ? If yes then what are those entitlements and are these entitlements available openly or we have to raise special request to apple for such entitlements? Query 2: What are the entries required to be added in info.plist for supporting the isSIMInserted api to work. Query 3: Is isSIMInserted api available for all type of apps because mine is a financial stock related app and i am looking forward to use this API for providing more security to the end user while registering through sms. As per the below link this api is only available for mobile Carrier apps but in official document there is no such mention. https://forums.developer.apple.com/forums/thread/760991 Please kindly help me on these queries ? Regards, Carol
4
0
631
Jan ’25
Instant access to call log with new ios 18 commands
Hello, I am wondering about developing my application. Can the new commands available with iOS 18 give me access to the call log (recent calls)? With a request prior to installing the application for example. I saw that Truecaller has just launched an update on iOS to offer the same features as Android, i.e. capture the call log. Apple allows applications like Truecaller to integrate their spam databases into the iOS caller ID system. I wonder by which command! Otherwise, I can perhaps use the "SMS and Call Spam Reporting" commands and divert them to retrieve the call log. To tell you the truth, I'm trying to find, for my application, a way to retrieve recent call data to create a call dashboard of certain calls, by retrieving the name or phone number, call date, call time and call duration. Does anyone have an idea?
4
0
1.4k
Oct ’24
BGProcessingTaskRequest execute randomly.
I am using BGProcessingTaskRequest to fetch a API make my app up to date. Sometimes this background task execute with 10 minutes some times it take more than 10 mins, Some other times its never execute. But in my case im provide just 1 minute to BGProcessingTaskRequest.earliestBeginDate variable. And i will share my implementation here, My codes are, Called the register function before app launching. let taskId = "_________" func registerBackgroundTaks() { BGTaskScheduler.shared.register(forTaskWithIdentifier: taskId, using: nil) { task in self.handleBackgroundProcessRequest(task: task as! BGProcessingTask) } print("Receiver called") } Called the scheduleBackgroundPrecessingTask function when application enter in background mode. func scheduleBackgroundPrecessingTask() { let request = BGProcessingTaskRequest(identifier: taskId) request.requiresNetworkConnectivity = false // Need to true if your task need to network process. Defaults to false. request.requiresExternalPower = false request.earliestBeginDate = Date(timeIntervalSinceNow: 1 * 60) // Featch Image Count after 1 minute. do { try BGTaskScheduler.shared.submit(request) print("Process notification triggered") } catch { print("Could not schedule background process: \(error)") } } Could anyone share any concerns to my problem? or kindly clarify me why BGProcessingTaskRequest takes time randomly?
4
0
951
Oct ’24
Critical Technical Issue: App Update Rendering iPhones Inoperative on iOS 16 Versions
We appreciate your suggestion to use the Apple Developer Forums. However, we must respectfully request further escalation of this issue beyond the forums for several critical reasons: Severity and Scope: This is not a general development discussion topic. We are facing a massive, reproducible performance issue on iOS 16 that renders devices unresponsive, requiring factory resets or DFU restores. This goes far beyond typical app bugs and points to a potential systemic issue in the OS's image handling. Insufficiency of Forum Support: While the forums are a valuable resource for community advice, they cannot provide the official, in-depth technical diagnosis from Apple engineers that this situation demands. Our users' devices are being bricked by an app update that passed App Review, and we require clarity on the root cause to prevent further damage and restore user trust. Code-Level Support Eligibility: As members of the Apple Developer Program, we believe our issue falls under the purview of Code-Level Support, as described on the Apple Developer website 9. Our problem involves "building or running software" and requires expertise in Apple's frameworks and hardware-level image rendering APIs. We request that our case be forwarded to that specialized team. To reiterate the core problem: Our update introduced 1024x1026 JPEG assets into the Asset Catalog. On iOS 16, this causes severe overheating, freezing, and device unresponsiveness. Replacing them with PNGs completely resolves the issue. This suggests a potentially serious regression in iOS 16's JPEG decoding or memory management pipeline. We prepared to provide a sample project that demonstrates the issue if required. Our case number is 102678393572. We urgently need to understand why this happens at the OS level to ensure our app is safe and to contribute to the stability of the iOS platform. Please escalate this case to the appropriate technical team for a detailed investigation. Sincerely,
4
0
111
1w
identitylookup needed for ILMessageFilterQueryHandling?
My iOS app uses a Message Filter extension (via ILMessageFilterQueryHandling) and works only when run directly as the extension target. When installed normally (via TestFlight), the filter does not trigger at all — which I now believe is because iOS enforces the com.apple.developer.identitylookup entitlement at runtime. Anyone know anything about this? I put in a request for the entitlement last week but heard nothing back. Called Apple "technical" support and they had no idea what I was talking about. The documentation around this is EXTREMELY lacking in my opinion...
4
0
66
Apr ’25
Live activity sample code for Swift 6?
Hi, I'm updating our app to use Xcode 16 and Swift 6 language mode. I'm stuck on updating our live activity code. I looked at the Emoji Rangers sample project and after switching it to Swft 6 mode, it has the exact same errors as our project. The main problem seems to be that Activity is not Sendable, which prevents us from passing it to child tasks to await things like activityStateUpdates and contentUpdates (those are also not Sendable). Is there any guidance on this? Updated sample code? Another project?
4
0
845
Sep ’24