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 encode / decode Array < Array < SomeStruct > >
I need to encode and decode Array<Array> SomeStruct is multiplexed in an Int The former API did work: if let format = decoder.decodeObject(forKey: someKey) as? Array<Array<SomeStruct>> { } But using the new API if let format = decoder.decodeObject(of: Array<Array<Int>>.self, forKey: someKey) { generates an error: Cannot convert value of type 'Array<Array<Int>>.Type' to expected argument type '[AnyClass]' (aka 'Array<any AnyObject.Type>') encoding is done as follows: var format = Array(repeating: Array(repeating: 0, count: 4), count: 4) // initialize the var coder.encode(format, forKey: someKey) What is the correct syntax ?
2
0
150
1w
Message Filter Extension Impacts
Hello, We are using a Message Filter Extension (ILMessageFilterExtension) to classify SMS/iMessage content (junk vs allow) in our app. After testing on iOS 26.1, we want to confirm whether there are any behavioral, performance, or API-level changes that impact message filtering, such as: Changes in how often the filter extension is invoked Differences in classification accuracy or system overrides New privacy, entitlement, or permission-related restrictions Execution time limits or memory constraints Any changes specific to iMessage vs SMS filtering We did not find any explicit mention of Message Filter Extensions in the iOS 26.1 release notes and would like to confirm whether the existing behavior from previous iOS versions remains unchanged. Has Apple introduced any known or undocumented changes in iOS 26.1 that developers should be aware of when supporting Message Filter Extensions? Sometime I also found unpredictable behaviour on iOS version 18.5 or below, like sometime it works but sometimes starts working. Thanks in advance for any guidance.
0
1
157
1w
Is there any way to control alarm volume independently when using AlarmKit?
Is there any supported or recommended way to achieve user-configurable alarm volume while still using AlarmKit? Hi there! I’m currently building an alarm app on iOS using AlarmKit, and I’m running into a fundamental limitation around volume control. When using AlarmKit, alarm sounds are played at the system ringer volume. My goal is simple in concept: Allow users to set an alarm volume inside the app, and have the alarm sound play at that volume when triggered. However, AlarmKit does not provide any API to control or override the alarm volume. I’ve explored several approaches(AVSystemController, MPVolumeView...), but none achieved the desired result. Is there any supported or recommended way to achieve user-configurable alarm volume while still using AlarmKit? Any insights from developers who’ve shipped alarm apps, or from Apple engineers, would be greatly appreciated. Thanks in advance 🙏
1
0
93
1w
App Logout / Termination Behavior When Changing Bluetooth Settings With and Without Multitasking
I would like to share an issue observed during app development. When changing Bluetooth settings from the system Settings app without using multitasking, the app does not terminate but instead logs the user out. However, when changing Bluetooth settings while using multitasking, the app terminates completely. In this context, I would like to understand: Whether there is any system behavior that causes the app to refresh or restart when Bluetooth settings are changed And why the app behavior differs in a multitasking environment, particularly in terms of app lifecycle handling Any insights into these behaviors would be greatly appreciated.
3
0
83
1w
NSKeyedArchiving issue
I have a large code that I try to update to change deprecated APIs. In the former version, I used forWritingWith and forReadingWith let data = NSMutableData() let archiver = NSKeyedArchiver(forWritingWith: data) archiver.encode(myObject, forKey: theKey) if let data = NSMutableData(contentsOf: anURL) { let unarchiver = NSKeyedUnarchiver(forReadingWith: data as Data) let myObject = unarchiver.decodeObject(forKey: theKey) as! TheObjectType // <<-- returns the object That I changed to let data = NSMutableData() let archiver = NSKeyedArchiver(requiringSecureCoding: true) archiver.encode(myObject, forKey: theKey) if let data = NSMutableData(contentsOf: anURL) { do { let unarchiver = try NSKeyedUnarchiver(forReadingFrom: data as Data) let myObject = unarchiver.decodeObject(forKey: theKey) as? TheObjectType // <<-- This returns nil This builds correctly. But on execution, unarchiver.decodeObject now returns nil. I have searched extensively to find the cause to no avail. I may probably change the design to avoid NSKeyedArchiver, but that would be a huge refactoring. I probably miss something obvious. Could someone hint at the possible cause ?
3
0
116
1w
Apple Media Service T&C pop-up
I had published an App which App Clip is supported. I have receipt complaints from user where the user will keep showing the "Apple Media Services Terms and Conditions Have Changed" right after user click on the "Open" button in the App Clips. What I had tried: Let user switch the current logged in Apple Id region to one of our support region. Log out and log in with an Apple Id which had no issue.
0
1
36
1w
Can't show screen time data
I am getting this error when I try to show device activity report view by this DeviceActivityReport(appsContext, filter: filter) Attempt to map database failed: permission was denied. This attempt will not be retried. I have taken access by this way. AuthorizationCenter.shared.requestAuthorization(for: .individual) Detailed errors: LaunchServices: store (null) or url (null) was nil: Error Domain=NSOSStatusErrorDomain Code=-54 "process may not map database" UserInfo={NSDebugDescription=process may not map database, _LSLine=72, _LSFunction=_LSServer_GetServerStoreForConnectionWithCompletionHandler} Attempt to map database failed: permission was denied. This attempt will not be retried.
0
0
65
1w
SensorKit - didFetchResult never get called.
We tried to fetch the recorded PPG data using SensorKit with the following code, however the didFetchResult callback method is never called. let ppgReader = SRSensorReader(sensor: .photoplethysmogram) let request = SRFetchRequest() let nowDate = Date() let toDate = nowDate.addingTimeInterval(-25 * 60 * 60) let fromDate = toDate.addingTimeInterval(-24 * 60 * 60) request.from = SRAbsoluteTime.fromCFAbsoluteTime(_cf: fromDate.timeIntervalSinceReferenceDate) request.to = SRAbsoluteTime.fromCFAbsoluteTime(_cf: toDate.timeIntervalSinceReferenceDate) ppgReader.delegate = self; ppgReader.fetch(request) The delegate called the didComplete successfully: func sensorReader(_ reader: SRSensorReader, didCompleteFetch fetchRequest: SRFetchRequest) But never called the didFetchResult func sensorReader(_ reader: SRSensorReader, fetching fetchRequest: SRFetchRequest, didFetchResult result: SRFetchResult<AnyObject>) -> Bool Any ideas why ? (I am wearing the watch for couple days and ensure it has the data for the time period I am querying) One thing I notice is when Apple granted us the entitlement, it uses Uppercase for ECG and PPG, however the document use Lowercases in the plist https://developer.apple.com/documentation/sensorkit/srsensor/photoplethysmogram Dose it matter ?
0
0
63
1w
How to authenticate ILMessageFilterExtension network requests using tokens from the containing app?
Hi everyone, I am building an SMS filtering app using the IdentityLookup framework. My main application handles the user login and receives a JWT. I need my ILMessageFilterExtension to use this JWT to authenticate its backend requests via context.deferQueryRequestToNetwork. Since the extension is sandboxed and doesn't share a URLSession or standard Keychain with the main app, I am trying to use the Shared Web Credentials mechanism as suggested in the documentation. My Questions: Is SecAddSharedWebCredential still the recommended way to "bridge" a token from the main app to the messagefilter service in 2026? If the backend returns a 401 Unauthorized with a WWW-Authenticate: Basic realm="api.mydomain.com" header, will iOS automatically retry the request with the stored token? Are there any specific AASA (Apple App Site Association) requirements for the messagefilter key? Does it need to be a separate top-level object or nested? Current Setup: Entitlements: Both Main App and Extension have messagefilter:api.mydomain.com and webcredentials:api.mydomain.com. Main App Code: Swift SecAddSharedWebCredential("api.mydomain.com" as CFString, "UserAccount" as CFString, "my_jwt_token" as CFString) { error in // Returns nil (success) } AASA File: JSON { "messagefilter": { "apps": ["TEAMID.bundle.id"] } } Despite this, I see the first 401 in my server logs, but the automatic retry with the Authorization header never happens. Has anyone successfully implemented this "silent" handshake recently?
1
0
158
2w
IdentityLookup ILMessageFilterExtensionConfigurationManager Scope
I'm working on building a Text Messages Filter Extension app and currently facing the below error: "Cannot find 'ILMessageFilterExtensionConfigurationManager' in scope". As required the app includes MessageFilterStatusManager.swift file, with the host app designated as the Target Membership. App minimum deployment is set to iOS 17.6 and I'm working with Xcode Version 26.2. If anyone has encountered this error I'd appreciate your feedback.
5
0
159
2w
AlarmKit - On non-Dynamic Island devices, when the screen is on, tapping the alarm banner has no response.
Issue Description: On non-Dynamic Island devices, when the screen is on, tapping the alarm banner does not open the app or trigger any action. Steps to Reproduce: Set a regular alarm. Wait until the alarm goes off. Keep the screen on. A banner appears with options (e.g., dismiss or a secondary action). Tap anywhere on the banner area that would normally open the app. Expected Behavior: Tapping the banner should open the app. Actual Behavior: Tapping the banner has no response.
1
0
77
2w
AlarmKit - Snooze Alarm Rings Briefly Then Goes Silent When Set Time Matches
Issue Description: When the snooze alarm and a set alarm share the same time, the behavior differs between locked and unlocked screen states. The current issue occurs when the screen is unlocked and the device is on the home screen before the alarm goes off: Alarm A is set for 17:23, and the snooze button is tapped when it rings. Alarm B is set for 17:25. At 17:25, Alarm B first vibrates and then rings (no buttons are pressed at this time). A few seconds later, it vibrates a second time. After that, the alarm becomes silent. If dynamic/notification alarms are disabled, the next scheduled alarm rings normally.
0
0
39
2w
AlarmKit - Alarm not triggered after manual time adjustment
Issue Description: When an alarm is set for a time earlier than the current system time, and the system time is manually adjusted back to before the alarm time, the alarm does not ring when the scheduled time is reached. Steps to Reproduce: Current time is 23:34 Set an alarm for 23:30 (earlier than the current time) Manually change the system time to 23:28 Wait until the time reaches 23:30 The alarm does not ring Device: iPhone 14 Pro / iOS 26.2
0
0
29
2w
Can't get DeviceActivityReportExtension to work
DeviceActivityReportExtension issues Hi, I am currently working on a project and hoping to use DeviceActivityReportExtension. I have already successfully set up the DeviceActivityMonitorExtension and that is working correctly, but can't get this to reproduce. I initially had a complex capacitor project which displayed a native UI screen which (tried to) display the screen time report though it was failing silently. I tried a much simpler setup with a pure swift project (not an iOS dev so forgive my poor code quality) and still having an issue getting this to render on my computer. Here is a reproduction: https://github.com/ethanmichel0/screen-time-report-bug-recreation/tree/main Does this code work for others? and if not do you know how I can set this up? idk if my Xcode or iOS versions are incompatible (see versions in that link). Would be super grateful for some help, thanks so much.
2
0
202
2w
Missing child's apps in the Family Activity Picker on the guardian's/parent's device
The Problem The Family Activity Picker shows only the child's app categories on the guardian's/parent's device. The application names from the child's device are not showing on the guardian's/parent's device. The authorization is done on the child's device via try await AuthorizationCenter.shared.requestAuthorization(for: .child) Usage of the family activity picker on the guardian's/parent's device struct ContentView: View { @State private var isPresented = true @StateObject private var familyControlsHelper = FamilyControlsHelper.shared var onClose: () -> Void var body: some View { ZStack { Color.black.opacity(0.1).ignoresSafeArea() } .familyActivityPicker( isPresented: $isPresented, selection: $familyControlsHelper.familyActivitySelection ) .onChange(of: isPresented) { _ in if !isPresented { onClose() } } } } IMPORTANT Both devices are real (not simulators), and the app has granted distribution Family Controls entitlement. Question Is this the expected behavior? Or the child's app should appear on the guardian's device? Thanks.
0
0
56
2w