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

Created

How to get a phone into a state where it's possible to test text filtering?
I'm currently finding it impossible to get a text filtering extension to be invoked when there's an incoming text message. There isn't a problem with the app/extension because this is the same app and code that is already developed, tested, and unchanged since I last observed it working. I know if there's any history of the incoming number being "known" then the extension won't get invoked, and I used to find this no hindrance to testing previously provided that: the incoming number isn't in contacts there's no outgoing messages to that number there's no outgoing phone calls to the number. This always used to work in the past, but not anymore. However, I've ensured the incoming text's number isn't in contacts, in fact I've deleted all the contacts. I've deleted the entire phone history, incoming and outgoing, and I've also searched in messages and made sure there's no interactions with that number. There's logging in the extension so I can see its being invoked when turned on from the settings app, but its not getting invoked when there's a message. The one difference between now and when I used to have no problem with this - the phone now has iOS 18.5 on it. Its as if in iOS 18.5 there ever was any past association with a text number, its not impossible to remove that association. Has there been some known change in 18.5 that would affect this call filtering behavior and not being able to rid of the incoming message caller as being "known" to the phone? Update I completely reset the phone and then I was able to see the the message filter extension being invoked. That's not an ideal situation though. What else needs to be done beyond what I mentioned above in order to get a phone to forget about a message's number and thus get an message filtering extension to be invoked when there's a message from that number?
0
0
146
Jul ’25
Detecting When App Token Is Removed Due to Category Selection in FamilyActivityPicker
I'm working with the Screen Time API (FamilyActivityPicker) in SwiftUI and need help with a specific scenario. I'm using the FamilyActivityPicker to let users select apps and categories to block. I save the previous selection (both applicationTokens and categoryTokens) locally. When the user updates their selection, I compare the new selection with the saved one to determine which apps or categories were removed. However, I’m trying to handle a specific case: when an individual app token is removed from the selection because its entire category was selected instead. In this situation, even though the app is no longer in applicationTokens, it's still blocked due to its category being included in categoryTokens. Since I need to show users which apps were actually removed, I want to avoid listing apps that are still indirectly blocked via a selected category. I’ve created a mapping between ApplicationToken and FamilyActivityCategoryToken to check whether a removed app is still covered by a selected category before displaying it. Is there any way to check this using the current Screen Time APIs, or does the system not give access to the relationship between apps and their categories? Any help or suggestions would mean a lot!
2
1
147
Jul ’25
Translation API not working without the Apple Translate app installed
Hello, My app depends on the Translation framework (iOS 17.4+), but I've found out that it doesn't work unless the Apple Translate app is installed on the device. After I've deleted Apple's translation app, I started getting the following errors: Optional(Foundation.Locale.Language(components: Foundation.Locale.Language.Components(languageCode: Optional(en), script: nil, region: Optional(GB)))) Optional(Foundation.Locale.Language(components: Foundation.Locale.Language.Components(languageCode: Optional(es), script: nil, region: Optional(ES)))) Error sending 1 paragraphs Error Domain=TranslationErrorDomain Code=16 "Translation failed" UserInfo={NSLocalizedDescription=Translation failed, NSLocalizedFailureReason=Offline models not available for language pair} Failed to translate input 0; returning error: Error Domain=TranslationErrorDomain Code=16 "Translation failed" UserInfo={NSLocalizedDescription=Translation failed, NSLocalizedFailureReason=Offline models not available for language pair} Received unbridged NSError to API, converting to `.internalError`: Error Domain=TranslationErrorDomain Code=16 "Translation failed" UserInfo={NSLocalizedDescription=Translation failed, NSLocalizedFailureReason=Offline models not available for language pair} TranslationError(cause: Translation.TranslationError.Cause.internalError, sourceLanguage: nil, targetLanguage: nil) This is an example from trying to translate text from English to Spanish. And I was receiving the error even though I have the dictionaries downloaded. Once I reinstalled Apple's Translate app, it started working again. This sadly means that users of my app must have the factory translation app installed, otherwise they won't be able to use my app. Some people choose to delete the factory apps. Why is the framework not available then? :(
2
0
81
Jul ’25
The menu can't be shown in background process in MacOS 26(beta)
After I upgraded to MacOS 26(beta), my program caused the system to pop up a window as shown in the following picture. My application is a process with only a tray icon. I found that my tray icon is not displayed in the current version, even though I clicked the "Always Allow" button. Here are my questions: 1.Will this related feature remain consistent in the official release? 2.How can I create a cmd process that only displays a system tray icon (no main window) like Alfred?
2
1
71
Jul ’25
Our customer's events on calendar are disappeared
Our app provides a calendar that integrates with the default calendar app. Specifically, we use iOS EventKit to perform CRUD operations on calendar data. Recently, we have received reports from users that all of their events have disappeared. However, after reviewing our implementation and logs, we have not been able to identify the cause. Some users have also reported that all data in their default calendar app has disappeared as well. Does anyone have any idea what might be causing this? To delete an event within our app, users must press the delete button and then confirm the deletion in a dialog. Additionally, it is not possible to delete more than two events at once. We've seen many people in the community discussing a bug where calendar events disappear after updating to iOS 18. If you have any information about when or why this happens, we'd appreciate it if you could share your insights.
0
3
84
Jul ’25
FamilyControls Framework Not Working for TestFlight Testers
Hello everyone, I’m developing an app using the FamilyControls framework, I distributed through TestFlight the other day using the “Family Controls” distribution (not Development). Everything works as expected in dev builds — but for external TestFlight testers, nothing in the FamilyControls framework seems to function. I'm using the correct Family Controls capability in Xcode (added via Signing & Capabilities). The com.apple.developer.family-controls entitlement is present in my .entitlements file. All the users who reported the issue had correctly given screen time permissions to the app. Would really appreciate some help regarding where the issue could come from.
1
0
135
Jun ’25
Access resource in swift package from xcframework
I have an iOS app that includes a local Swift package. This Swift package contains some .plist files added as resources. The package also depends on an XCFramework. I want to read these .plist files from within the XCFramework. What I’d like to know is: Is this a common or recommended approach—having resources in a Swift package and accessing them from an XCFramework? Previously, I had the .plist files added directly to the main app target, and accessing them from the XCFramework felt straightforward. With the new setup, I’m trying to determine whether this method (placing resources in a Swift package and accessing them from an XCFramework) is considered good practice. For context: I am currently able to read the .plist files from the XCFramework by passing Bundle.module through one of the APIs exposed by the XCFramework.
3
1
128
Jun ’25
No such module 'JournalingSuggestions'
I followed this tutorial to add JournalingSuggestions API, but it keeps showing me No such module 'JournalingSuggestions'. How can I fix this? import SwiftUI import JournalingSuggestions struct ContentView: View { @State var suggestionTitle: String? = nil var body: some View { VStack { JournalingSuggestionsPicker { Text("Select Journaling Suggestion") } onCompletion: { suggestion in suggestionTitle = suggestion.title } Text(suggestionTitle ?? "") } .padding() } } #Preview { ContentView() }
2
0
52
Jun ’25
iOS magnetometer data processing
Hello, I’m developing an app to detect movement past a strong magnet, targeting both Android and iOS. On Android, I’m using the Sensor API, which provides calibrated readings with temperature compensation, factory (or online) soft-iron calibration, and online hard-iron calibration. The equivalent on iOS appears to be the CMCalibratedMagneticField data from the CoreMotion framework. However, I’m encountering an issue with the iOS implementation. The magnetometer data on iOS behaves erratically compared to Android. While Android produces perfectly symmetric peaks, iOS shows visual peaks that report double the magnetic field strength. Additionally, there’s a "pendulum" effect: the field strength rises, drops rapidly, rises again to form a "double peak" structure, and takes a while to return to the local Earth magnetic field average. The peaks on iOS are also asymmetric. I’m wondering if this could be due to sensor fusion algorithms applied by iOS, which might affect the CMCalibratedMagneticField data. Are there other potential reasons for this behavior? Any insights or suggestions would be greatly appreciated. Thank you!
0
0
25
Jun ’25
Bug in Screen Time API: familyActivityPicker dismisses a presenting sheet on iOS 18.4 and above
Hello, I’m presenting the familyActivityPicker from a presented sheet in my application. When I select some apps, categories or websites and tap “Done”, the familyActivityPicker is dismissed but the presenting sheet is also dismissed on iOS 18.4, iOS 18.5, iOS 26 beta 1 and 2. If I tap on “Cancel” from the familyActivityPicker, the sheet is also dismissed on iOS 18.4, iOS 18.5, iOS 26 beta 1 and 2. The same code works perfectly fine on iOS 18.0, iOS 18.1, iOS 18.2 and iOS 18.3. Is this a known-issue? If opened the feedback FB18369821 for this. Regards, Axel
3
0
103
Jun ’25
NSuserdefault issue after restart my iphone
hi,guys.There's a issue about my app about NSuserdefault. Everything is arlright if i stay in the app, once i close my app, and restart it.Datas from nsuserdefault is gone(nil). i tried to add and delete synchronize method , but its not working. But this situation only happens in ios 18.(at least ios12 and ios16 is alright).
3
0
102
Jun ’25
Quick Look Preview Extension works on macOS but not iOS
Hi, I have a document-based SwiftUI multiplatform app, where the document is saved as JSON. Obviously I don't want Quick Look to show the JSON of my file, so I made a Quick Look Preview extension for each platform. The macOS one works… okay, sometimes it's tricky to test and I need to use qlmanage to empty the cache or to show the preview, but it does work. I can even debug it. But the iOS one just never seems to be run. If I show Quick Look in the Files app on iOS, or if I AirDrop a file from my app to my iPhone, it shows as JSON, with an option to open it in my app. If I run the iOS Preview Extension in the debugger and launch the Files app, and then try to use Quick Look in a file there, it shows the JSON and the debugger just stays in the state 'Waiting to Attach'. The preview extensions are not data based; in both of them I have implemented func preparePreviewOfFile(at url: URL) async throws in PreviewViewController.swift. Pretty much the same code except one is using a UIHostingController and the other is using an NSHostingController. The only difference in the Info.plists for the two extensions is that the iOS one uses NSExtensionMainStoryboard while the macOS one uses NSExtensionPrincipalClass. This is how they were set up when I created them from the relevant Quick Look Preview Extension templates. I made a sample project with a much simpler document, UI, etc. and I have the same issue there. The macOS preview works, the iOS one never runs. I have checked that the correct preview extension is embedded in the target for each OS (under Embed Foundation Extensions in the Build Phases) Is there anything I need to do differently in iOS, or anything I might have inadvertently got wrong? Is there a way to run something similar to qlmanage on iOS, since that sometimes seems to help on macOS? Incidentally, I have also added Quick Look Thumbnail extensions, and they work on both platforms.
2
0
147
Jun ’25
Delays When Creating Advanced App Clip Experiences for Other Businesses
Hey there, I have an app where I create custom Advanced App Clip Experiences for other businesses which seems to be a valid thing. I do create them via API. Upon creation everything looks fine: when I go to App Store Connect -> App -> Advanced App Clip Experiences, I do see the new App Clip Experience I've just created. Their status is Received (as any other active experiences) and have a custom URL. The issue is weird timing when the Advanced App Clip Experience actually becomes available on the iPhone (can be triggered via App Clip Code, etc). Some experiences become available literally immediately but others take days (some take 1-2 days, some take ~5 days). I'm not sure why there's a bid difference for an Advanced App Clip to be actually active. Does anyone have any kind of experience with that? I don't change domain settings, app's settings, etc. I'm just creating a new experience (both via API or manually at App Store Connect) and I do have different "activation" times for different App Clips. Same when I delete an Advanced App Clip Experience, it will still be available for next couple days. I get there might be caching stuff, etc. But the difference is quite huge and makes no sense since as I've mentioned some clips become available immediately but some takes days to be available. Thank you!
0
0
59
Jun ’25
WeatherKit failing on JWT Error
My app AirCompare has been in the app store and successfully using WeatherKit to fetch weather since it became available. Now some (not all) users are encountering the following errors: Failed to generate jwt token for: com.apple.weatherkit.authservice with error: Error Domain=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors Code=2 "(null)" Encountered an error when fetching weather data subset; location=<+42.40865786,-88.96911526> +/- 0.00m (speed -1.00 mps / course -1.00) @ 6/23/25, 2:56:47 PM Central Daylight Time, error=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors 2 Error Domain=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors Code=2 "(null)" Others are reporting this same problem here in the forums. We need a solution!
5
4
139
Jun ’25
JWT Token Errors
I have an app using weatherkit and its currently live and up on the app store, recently I had some users report to me that they had been receiving errors loading weather data, I had error handling built in and it reported an issue with apples authentication server Failed to generate jwt token for: com.apple.weatherkit.authservice with error: Error Domain=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors Code=2 "(null)" I have not come across this during the development lifecycle of my project, there where no codebase changes, it just stopped functioning. The app entitlements are valid and correct, Weatherkit is enabled in both xcode and across my Certs, identifiers and profiles. I was not experiencing this issue until I reinstalled the app from the app store completly by first removing it and then re-installing fresh. Hard reboots do not help and I do not want to start suggesting to my users to factory reset their devices. We are using WeatherKit in both our main app and widget, relying entirely on Apple’s framework for authentication and token management. We do not generate or inject our own JWT tokens; all token handling is managed by WeatherKit. We have implemented a debug menu with the following actions: Clear WeatherKit JWT tokens from the keychain Clear all related UserDefaults key Clear all app group data and all UserDefaults. Perform a “nuclear” cache clear (removes all app data, keychain, and cached files). We log all WeatherKit fetch attempts and failures, including authentication errors, both in the app and widget and get nothing but code 2. We have attempted all of the above steps, but continue to experience issues with WeatherKit JWT authentication We would appreciate any guidance or insight into what else could be causing persistent WeatherKit JWT/authentication issues, or if there are any additional steps we should try. P.S. - Tested and experiencing the same issues on an iPhone 15 Pro Max and iPhone 15 The Pro Max is on the iOS 26 Beta // and the 15 is on the latest iOS 18
5
5
182
Jun ’25
JSONDecoder enum-keyed dictionary bug
Hello everyone, I think I've discovered a bug in JSONDecoder and I'd like to get a quick sanity-check on this, as well as hopefully some ideas to work around the issue. When attempting to decode a Decodable struct from JSON using JSONDecoder, the decoder throws an error when it encounters a dictionary that is keyed by an enum and somehow seems to think that the enum is an Array<Any>. Here's a minimal reproducible example: let jsonString = """ { "variations": { "plural": "tests", "singular": "test" } } """ struct Json: Codable { let variations: [VariationKind: String] } enum VariationKind: String, Codable, Hashable { case plural = "plural" case singular = "singular" } and then the actual decoding: let json = try JSONDecoder().decode( Json.self, from: jsonString.data(using: .utf8)! ) print(json) The expected result would of course be the following: Json( variations: [ VariationKind.plural: "tests", VariationKind.singular: "test" ] ) But the actual result is an error: Swift.DecodingError.typeMismatch( Swift.Array<Any>, Swift.DecodingError.Context( codingPath: [ CodingKeys(stringValue: "variations", intValue: nil) ], debugDescription: "Expected to decode Array<Any> but found a dictionary instead.", underlyingError: nil ) ) So basically, the JSONDecoder tries to decode Swift.Array<Any> but encounters a dictionary (duh), and I have no idea why this is happening. There are literally no arrays anywhere, neither in the actual JSON string, nor in any of the Codable structs. Curiously, if I change the dictionary from [VariationKind: String] to [String: String], everything works perfectly. So something about the enum seems to cause confusion in JSONDecoder. I've tried to fix this by implementing Decodable myself for VariationKind and using a singleValueContainer, but that causes exactly the same error. Am I crazy, or is that a bug?
1
0
74
Jun ’25
WeatherKit JWT Auth error for SOME customer devices
We have a subscription WeatherKit app which has been on the App Store since December 2023. I am getting intermittent JWT auth failures on customer devices. In the great majority of cases, the request succeeds, but sometimes it fails, and sometimes it fails and never recovers. I’m working with a customer right now who is unable to get any weather data at all, and the logs he sends me show WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors error 2 The app uses the WeatherKit SDK (we are not using the REST API directly). We know we have the project setup as it has been working since launch, and I can verify weatherkit using security cms -D -i embedded.mobileprovision It it not a problem with the specific query, since I can get data for the dates and locations they are requesting. I can’t replicate the problem on my test devices. In case there is a rate limit issue: this app is a bit unusual and downloads an unusual amount of data at once using multiple queries in parallel using a TaskGroup. When the user creates a location, the app downloads a 10 day block of weather (7 days in the past + 3 day forecast) using WeatherService.shared.weather( for: location, including: WeatherQuery.daily( startDate: startDate, endDate: endDate ), WeatherQuery.hourly( startDate: startDate, endDate: endDate ) ) It also downloads about 2 months of daily precipitation data using multiple parallel calls to dailySummary in 10 day blocks: WeatherService.shared.dailySummary( for: location, forDaysIn: DateInterval(start: startDate, end: endDate), including: .precipitation ) In almost every case, including on my test devices, this works. But some users get WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors error 2 on every request. The two users yesterday that had this problem were both on iOS 18.5 for what that's worth, though the app supports 17.2+ Is anyone else seeing this? And can anyone suggest anything else to explore? It's obviously a terrible experience for customers who pay for the service and are unable to get any data. I did submit this info to Apple as FB18276275
5
6
194
Jun ’25
[macos 15.2 (24C101)] Custom input method does not work as expected
Environment: macOS 15.2 (24C101) with Xcode 16.2 (16C5032a) Goal: I am trying to build a simple IMKInputController-based input method. Problem: My .app bundle registers successfully and I can select it as an input source. When selected, it blocks keyboard input, but my handle method does not seem to execute or produce output. I have placed NSLog statements in my controller's init and handle methods. Code for the controller: import InputMethodKit // The IMKTextInput protocol is provided by the framework. // We don't need to define our own bridging protocol for this test. public class HelloWorldController: IMKInputController { public override init!(server: IMKServer!, delegate: Any!, client inputClient: Any!) { super.init(server: server, delegate: delegate, client: inputClient) NSLog("HelloWorldIME: Controller has been initialized.") } public override func handle(_ event: NSEvent!, client sender: Any!) -> Bool { NSLog("HelloWorldIME: handle() method was called.") // ================== FINAL FIX APPLIED HERE ================== // 1. First, we ensure the client is a fundamental Objective-C object. guard let clientObject = sender as? NSObject else { NSLog("HelloWorldIME: Error - client object is not an NSObject.") return false } NSLog("HelloWorldIME: Successfully cast client to NSObject.") // 2. Now that we have an NSObject, we can safely check if it responds to the selector. let selector = #selector(IMKTextInput.insertText(_:replacementRange:)) if !clientObject.responds(to: selector) { NSLog("HelloWorldIME: Error - client object does not respond to the insertText selector.") return false } NSLog("HelloWorldIME: Client responds to insertText. Preparing to insert text.") // 3. Since we've confirmed it responds, we can now safely treat it as an IMKTextInput // and call the method. let client = clientObject as! IMKTextInput let stringToInsert = "A" let replacementRange = NSRange(location: NSNotFound, length: 0) client.insertText(stringToInsert, replacementRange: replacementRange) NSLog("HelloWorldIME: Called insertText with string '\(stringToInsert)'. Action complete.") // ======================================================== return true } }
0
0
57
Jun ’25