I decode an object with NSKeyedArchiver (SecureCoding):
typealias BoolArray = Array<Array<Bool>>
let val = decoder.decodeObject(of: NSArray.self, forKey: someKey) as? BoolArray
I get the following log:
*** -[NSKeyedUnarchiver validateAllowedClass:forKey:] allowed unarchiving safe plist type ''NSNumber' (0x204cdbeb8) [/System/Library/Frameworks/Foundation.framework]' for key 'NS.objects', even though it was not explicitly included in the client allowed classes set: '{(
"'NSArray' (0x204cd5598) [/System/Library/Frameworks/CoreFoundation.framework]"
)}'. This will be disallowed in the future.
I changed by adding NSNumber.self in the list :
let val = decoder.decodeObject(of: [NSArray.self, NSNumber.self], forKey: someKey) as? BoolArray
No more warning in log.
Is there a reason for this ?
General
RSS for tagDelve 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.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I get several warnings in log:
*** -[NSKeyedUnarchiver validateAllowedClass:forKey:] allowed unarchiving
safe plist type ''NSNumber' (0x204cdbeb8)
[/System/Library/Frameworks/Foundation.framework]' for key 'NS.objects',
even though it was not explicitly included in the client allowed classes set: '{(
"'NSArray' (0x204cd5598) [/System/Library/Frameworks/CoreFoundation.framework]"
)}'. This will be disallowed in the future.
I am not sure how to understand it:
I have removed every NSNumber.self in the allowed lists for decode. To no avail, still get the avalanche of warnings.
What is the key NS.objects about ?
What may allowed classes set: '{(
"'NSArray' be referring to ? An inclusion of NSArray.self in a list for decode ? The type of a property in a class ?
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.
I have defined a class :
class Item: NSObject, NSSecureCoding {
var name : String = ""
var color : ColorTag = .black // defined as enum ColorTag: Int
var value : Int = 0
static var supportsSecureCoding: Bool {
return true
}
Its decoder includes the following print statement to start:
required init(coder decoder: NSCoder) {
print(#function, "item should not be nil", decoder.decodeObject(of: Item.self, forKey: someKey))
Another class uses it:
class AllItems: NSObject, NSSecureCoding {
var allItems : [Item]?
static var supportsSecureCoding: Bool {
return true
}
and decodes as follows
required init(coder decoder: NSCoder) {
super.init() // Not sure it is necessary
allItems = decoder.decodeObject(of: NSArray.self, forKey: mykey) as? [Item]
print(#function, allItems) // <<-- get nil
}
I note:
decoder returns nil at line 5
I have tried to change to
decoder.decodeObject(of: [NSArray.self, NSString.self, NSColor.self, NSNumber.self], forKey: mykey))
Still get nil
And, decoder of class Item is not called (no print in the log)
What am I missing ?
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.
“while using multitasking” means reducing the app’s size and displaying it side by side with the Settings screen at the same time. For better understanding, I will attach an image.
Additionally, I found that YouTube also terminates when the “Allow Tracking” permission is changed in Settings while using the multitasking interface.
We recently released an update to our app to prepare for TX SB2420.
Almost immediately on release, we started getting crash reports of crashes when calling isEligibleForAgeFeatures.
Crashed: com.apple.root.user-initiated-qos.cooperative
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000004
Is it possible that these are beta users that have IOS 26.2 RC or is there a bug in the release version of IOS 26.2?
Note: The crash reports are coming from Crashlytics so we are not getting OS build identifiers other than version "26.2"
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 ?
Hi, Submitted Family Controls entitlement requests yesterday for a
digital wellness app (main app + 3 extensions).
For those who've been through this:
How long did approval take?
Did Apple ask for more info?
Any tips?
Thanks!
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 🙏
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.
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 ?
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?
Is there a way to enumerate all files within a folder of an asset pack or just all files in general?
My application is using the Apple demo code to load a file from an Apple hosted asset pack:
let descriptor = try AssetPackManager.shared.descriptor(for: "NAV/NavData.db3")
defer {
try descriptor.close()
}
if let path = path(for: descriptor) {
self.database = try Database(path: path)
}
As my "Navigation Data" is updated each month with an updated asset pack I would like to have the name of the .db3 file reflect the current data cycle (e.g. NAV2601.db3, NAV2602.db3, ...)
Ideally I would like to iterate over all files within the NAV folder of the current asset pack and pick the most recent one.
Unfortunately, neither the AssetPackManager nor the AssetPack object seem to include an API for this.
It would be cool to have something like:
let files = try AssetPackManager.shared.files(for: "NAV/")
for file in files {
//Check and load
}
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.
On iOS 26.2 (23C55), DeviceActivityMonitor.eventDidReachThreshold fires intermittently for a daily schedule (00:00–23:59) even when iOS Screen Time shows 0 minutes for the selected apps that day. This causes premature shielding via ManagedSettings.
Environment: iPhone 13 Pro Max, iOS 26.2 (23C55). Event selection: 2 apps. Threshold: 30 minutes. Multiple TestFlight users report the same behavior across various app selections and thresholds. Intermittent (~50% of days); sometimes multiple days in a row. Not observed in testing prior to iOS 26.2.
Evidence: sysdiagnose + Screen Time screenshots (with 0 screen time on selected apps) + unified logs show UsageTrackingAgent notifying the extension that “unproductive from activity daily reached its threshold,” followed immediately by ManagedSettings shield being applied (extension reacting to the callback).
Filed Feedback Assistant: FB21450954.
Questions: Are others seeing this on 26.2? Does it correlate with restarting monitoring at interval boundaries or includesPastActivity settings?
Topic:
App & System Services
SubTopic:
General
Tags:
Family Controls
Device Activity
Managed Settings
Screen Time
Hi,
I got family controls (distribution) approved for my main app and assumed this would carry over to my extensions but it did not. Do I need to re-request for other the deviceactivitymonitorextension and deviceactivityreportextension?
I am trying to set up a message filter extension that will use shared web credentials for basic auth when calling to its ILMessageFilterExtensionNetworkURL.
I have associated domains set up for both "messagefilter:" and "webcredentials:" and the message filter IS correctly calling the ILMessageFilterExtensionNetworkURL with each message - so that part is working.
As detailed here, I have set up Shared Web Credentials and my view controller is using SecAddSharedWebCredential() to save the creds to the correct domain. Using Authorization services, the creds are auto-filled into my app's login screen. When I go under Settings > Passwords, I see the creds are saved and they are the correct creds to the corrent website that matches ILMessageFilterExtensionNetworkURL.
Regardless of all of this, the deferQueryRequestToNetwork() refuses to use the creds and implement Basic Auth in its URL call. It makes the call to the correct URL, it just won't use the Shared Web Creds for basic auth.
Any help would be greatly appreciated.
Topic:
App & System Services
SubTopic:
General
Tags:
Extensions
Messages
SMS and Call Reporting
Authentication Services
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.
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)
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)