UPDATE:
So I discovered that if UIScreen.main.traitCollection.userInterfaceStyle is called in a notification service extension then it doesn't detect any change to the iPhones light/dark mode unless the phone is restarted.
(I tried with other extensions, changes are detected immediately in other extensions, however not with a notification service extension nor in a notification content extension).
ORIGINAL POSTING:
I've got a notification service extension which is populating the notification with images before it's displayed.
The images are part of an image set with different images for light and dark modes.
What I've discovered is that which image is displayed in the notification depends upon whatever mode the phone was in when the app was installed or when the phone was restarted and it will stay like that for any subsequent posted notifications forever regardless of what the phone's light/dark mode setting is, unless the phone is restarted.
Here's an example to illustrate what I mean, here's an image set in the Media.xcassets for the extension, its called "Grunt".
And here's some code in the extension:
notificationContent!.title = "GRUNT"
if let url = URL(forImageResource: "Grunt") {
do {
let attachment = try UNNotificationAttachment(identifier: "imageAttachment", url: url)
notificationContent!.attachments = [attachment]
} catch {
NSLog("error")
}
}
contentHandler(notificationContent!)
When the app is installed, if the phone is set to light mode, then when a notification is posted the 2x Light image is displayed in the notification. If the phone's setting is then changed to dark, then the 2x Light image still continues to displayed in all subsequent notifications that get posted.
Conversely, if the phone is set to dark mode when the app is installed then the 2x Dark image is displayed in a notification, similarly if the phone's settings are changed to Light, the Dark image continues to be displayed for any new notifications posted.
Until the phone is restarted - then any new notification display in accordance with whatever the phone's dark mode is set to at the time the phone is restarted.
In other words, if the phone's light/dark mode setting is changed, new notifications posted don't display the appropriate light/dark image from the image set unless the phone is restarted.
(Occurs with both iOS 16 and 17)
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I want to observe/capture logging from my iPhone app when its not running via Xcode.
However when using either the Mac's console app, or the console functionality within Apple Configurator, after about 2 or 3 seconds the logging disappears off the console.
How can it be prevented from doing so?
I received an email from Apple saying the app is using:
NSPrivacyAccessedAPICategoryDiskSpace
NSPrivacyAccessedAPICategoryFileTimestamp
NSPrivacyAccessedAPICategorySystemBootTime
I'm not directly calling (afaik) any API that might be involved in getting the disk space, file timestamp, nor system boot time, so presumably these are indirectly originating in a pod whose api I'm using.
However I have about 100 pods in the app, how can I know which one these are originating from?
(100 seems a lot, but its a React Native app and that alone pulls in dozens and dozens of pods implicitly in addition those specified explicitly in a pod file)
I can try and update all the pods to the latest version, but if the offending pod(s) hasn't added a manifest file, then I have no way of knowing which one it is - therefore I can neither contact them to ask when they will release a new version, nor can I attempt to try and remove the pod, because I just don't know which one might be causing the manifest warning.
So what are we supposed to do in this situation?
A Notification Service Extension is one of the more capable extensions, and there's a lot that can be done within it (for example, it can invoke a Call Extension).
However its not possible to use a Contact Provider Extension within it.
If a CPE has been enabled by the main app, then if a push is sent to the NSE, then within the NSE the ContactProviderManager class reports that the CPE is disabled and its not possible to anything with it. For example a call to ContactProviderManager.signalEnumerator() will hang and not complete.
I was hoping to create a contact and make it available to the system on receipt of a push, but this isn't going to possible.
Is this intentional and by design, or just due to the immaturity of this feature/iOS beta?
The documentation of a Contact provider Extension says:
"signalEnumerator() An example of using this call is to handle a push notification to your app when the provided contacts from your server update"
It therefore seems strange that the main cited use case for ContactProviderManager.signalEnumerator() isn't actually possible if the push is delivered to an extension rather than the app.
I want to release a Framework F, containing several other frameworks (such as Realm, Appetitive, Cocoalumberjack, PhoneNumberKit) for use by app A.
According to this article: https://medium.com/@bittudavis/how-to-create-an-umbrella-framework-in-swift-ca964d0a2345
They write, without referencing a source: "Although Apple discourage creating umbrella framework".
Is that true, do Apple discourage umbrella frameworks, if so why and is it a very strong discourage or a mild one?
If not discouraged, then how can this be achieved with Xcode 16?
I've been attempting to follow a few tutorial to achieve this, such as https://medium.com/john-lewis-software-engineering/adding-a-third-party-framework-inside-a-first-party-framework-in-xcode-3ba58cfd08da
however so far without any success. This last article mentions the Link Binary With Libraries section, which doesn't exist in Xcode 16.
There's the Frameworks, Libraries, and Embedded Content section where I have been attempting to add the frameworks into my Framework F (choosing Embed without Signing).
I'm able to successfully build Framework F, but when app A attempts to use it (adding F to the Frameworks, Libraries, and Embedded Content section with option embed and sign, or embed and don't sign, makes no difference) then I get run time errors about the umbrellaed frameworks not being able to be found.
I have a question regarding specifying URLs for a Message Filter App Extension.
https://developer.apple.com/documentation/identitylookup/creating-a-message-filter-app-extension
The documentation states “If you have servers that can help your app extension determine how to handle a message, you must add the Associated Domains capability to your Xcode project and specify those domains.”
The term servers and domains is specified in the plural, and adding two occurrences of ILMessageFilterExtensionNetworkURL to the info.plist doesn’t cause a build error.
So the first question is:
1.What is the behaviour of the OS when two instances of ILMessageFilterExtensionNetworkURL but specifying different urls is defined?
Does the OS, for example always try one url first, and if that doesn’t respond after N seconds, it attempts the second one?
Can the Message Filter Extension indicate which of multiple defined ILMessageFilterExtensionNetworkURL should be used at run time?
3.How does the OS behave if a URL specified for ILMessageFilterExtensionNetworkURL resolves to two VIPs? Will the OS retry if the first VIP is not accessible (similar to any typical browser or web application behavior).
Thank you
I've noticed that NSLog() doesn't do anything on iOS 26 when an app is downloaded from TestFlight.
I've got an app uploaded with a liberal sprinkling of NSLog lines in it for debugging purposes - if I download that onto an iOS 18 devices, and use Apple Configurator's console or the Mac's console app, then the logging output is verbose and as expected.
But if I download that same app onto an iOS 26 handset, there's nothing.
Logging is visible in the Xcode console, however sometimes there are situations where you need console logging with a TestFlight build.
What happened? Was this an intentional change? Why. This is a major hindrance in diagnosing issues / bugs etc.
If an iOS application has a notification service extension which gets sent a push, but the user has not been prompted for notification authorization via requestAuthorization() then what is the expected behavior?
Will the push get delivered to the NSE but the resulting notification not displayed? Or will the push not get delivered at all to the NSE?
What are guidelines for apps being released in the US App Store in order to comply with The Texas App Store Accountability Act?
I mean there's no way to differentiate an app downloaded in Texas from the other states and it would be ridiculous to add location awareness to an app to comply with this, so effectively it means any developer of any app for release in the US must comply with this in case it might be being used in Texas?
This new Apple API has zero background, zero context, zero example of usage, zero guidelines about how to use it in practice:
https://developer.apple.com/documentation/declaredagerange/
One of the responses to a call to AgeRangeService.shared.requestAgeRange is AgeRangeService.Error.invalidRequest.
This has no documentation. What on earth is an invalid request - I mean the app just calls the API, there's no parameters supplied or anything, how can the request ever be invalid?
If the app calls AgeRangeService.shared.requestAgeRange and gets this as a response then what is the app supposed to do with that?
Topic:
App & System Services
SubTopic:
General
I've got an iOS app with lots of extensions, some of them complex and doing a lot of stuff.
After a bug I'd like to be able to use OSLogStore to get a holistic picture of logging for the app and its extensions and send that to a debugging server to retrospectively view logs for the app and its extensions.
The constructor is OSLogStore.init(scope: OSLogStore.Scope), however scope only has one value .currentProcessIdentifier.
Implying if that is called from within the app it can only get access to logging for its process only. I tried it out to confirm this is the case - if I log something in an extension (using Logger), then run the app with code like this:
let logStore = try! OSLogStore(scope: .currentProcessIdentifier)
let oneHourAgo = logStore.position(date: Date().addingTimeInterval(-3600))
let allEntries = try! logStore.getEntries(at: oneHourAgo)
for entry in allEntries {
look at the content of the entry
Then none of the entries are from the extension.
Is there anyway from within the app I can access logging made within an extension?
This is a problem that has occurred, been fixed, occurred, been fixed.... multiple times over the years.
And its happening again - there's no option to download dSYMS from Testflight/App Store.
Apple, can please sort this out. Again.
If you go to https://feedbackassistant.apple.com and create a new feedback (for iOS and iPad) item, then these are the types of feedback choices:
Incorrect/Unexpected Behavior
Application Crash
Application Slow/Unresponsive
Battery Life
Suggestion
A suggestion sounds more like something an iPhone user want so suggest as a feature, not how a developer might request an API feature. Is that really what, as a developer, you are supposed to use to make a development feature request?
This is about the 3rd time I've seen this now (in about 5 years of using notification service extension, however all the occurrences have been in the past couple of months so presumably its some recent instability).
What happens is a push is sent to the handset and is meant to get intercepted by a notification extension, except that doesn't happen - not due to an error with the app - something internally has gone wrong with the OS.
Once this starts the notification service extension can never receive pushes again until the phone is restarted after with the extension starts to receive the pushes again.
I got log from the OS when it did this and found there was an RBSRequestErrorDomain Code=5 error
[u A0F3A639-F287-4B0C-AADE-A6F547D91404:m (null)] [<private>(<private>)] Failed to start plugin; pkd returned an error: Error Domain=PlugInKit Code=4 "RBSLaunchRequest error trying to launch plugin com.theCompany.app.NotificationServiceExtension(A0F3A639-F287-4B0C-AADE-A6F547D91404): **Error Domain=RBSRequestErrorDomain Code=5 "Launch failed**." UserInfo={NSLocalizedFailureReason=Launch failed., **NSUnderlyingError=0x5faa61190 {Error Domain=NSPOSIXErrorDomain Code=111 "Unknown error: 111"** UserInfo={NSLocalizedDescription=**Launchd job spawn failed**}}}" UserInfo={NSLocalizedDescription=RBSLaunchRequest error trying to launch plugin com.theCompany.app.NotificationServiceExtension(A0F3A639-F287-4B0C-AADE-A6F547D91404): Error Domain=RBSRequestErrorDomain Code=5 "Launch failed." UserInfo={NSLocalizedFailureReason=Launch failed., NSUnderlyingError=0x5faa61190 {Error Domain=NSPOSIXErrorDomain Code=111 "Unknown error: 111" UserInfo={NSLocalizedDescription=Launchd job spawn failed}}}}
Can file a radar but just posting here first just in case anybody from Apple know what the OS error code and hence the reason.
(longer console log available)
This has been a continual headache for months, ever since Xcode 15 came out.
Everything is working just fine, you just made a code change, built and run it, and Xcode installs to the phone nice and quickly and runs it.
But them bamn, next time you do the same thing, Xcode displays "Installing to " forever. It just never finishes.
I've had this occur numerous times every day, with different versions of Xcode, multiple different iPhones, running multiple different versions of iOS, and even with different Macs.
Always the same. It'll be working just fine, then out of the blue, without changing anything, Xcode will suddenly just decide to get into this state where it just hang and during installation, and won't recover even after terminating and restarting Xcode.
Please somebody from Apple, what is going on? Is there a work around, how can it stopped from happening?
Deleting the app doesn't fix it, restarting Xcode doesn't fix it. Unplugging the usb cable doesn't fix it, Restarting the phone doesn't fix it. What will?
Wasted sooo much time with this happening every day for that several months.
I've asked this question before and was met with total silence. Must I really raise an official support ticket to get an answer to this?
Surely I'm not the only one this is happening to?
And if its not "Installing to " that hangs forever then its "Attaching to on <name of phone" that hangs forever, usually both at the same time.
(Currently running Xcode 15.2, iPhones are connected via usb).