Post

Replies

Boosts

Views

Activity

Changes to light/dark mode aren't detectable within a notification service extension unless the phone is restarted
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)
3
0
1.1k
Nov ’23
Privacy manifests: how to identify which pod a category use is originating from?
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?
3
2
6k
Mar ’24
Its not possible to use a Contact Provider Extension from within a Notification Service Extension
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.
3
0
775
Aug ’24
Are umbrella frameworks possible/discouraged?
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.
3
0
787
Mar ’25
Message Filter Extension: OS behavior with multiple server domains
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
3
0
423
Jan ’25
NSLog doesn't work on iOS 26 when the app is installed from TestFlight
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.
3
0
211
Aug ’25
What is the expected behavior for a notification service extension if the user has not been prompted for requestAuthorization()
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?
3
0
132
Sep ’25
How to use the declared age range API / Comply with Texas law
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/
3
2
297
Oct ’25
For the iOS/Xcode age range validation, what is an invalidRequest error?
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?
3
0
107
Oct ’25
OS terminates app and stops sending Voip pushes even if reportNewIncomingCall() is called
It an app receives a Voip push, but has to terminate the call, then if this happens a few times the OS is terminating the app (Message from debugger: Terminated due to signal 9) and then it stops delivering future pushes to the app.i.e. with code let endCallAction = CXEndCallAction(call: callUUID) let transation = CXTransaction(action: endCallAction) self.callController.request(transation) { (error) in } provider.reportNewIncomingCall(with: callUUID, update: callUpdate) { error in Model.priorityLog("GRUNT reportNewIncomingCall completion error \(String(describing: error))") completion() }
2
0
1.1k
Jun ’23
Sandbox restriction message caused by differing Application Identifier Prefix and Team Identifier in an extension?
I'm working on an out-sourced application for a company and when a version of it built using ids and provisioning profiles from my Apple account it runs without problems. However when it is built and run using the company's ids and provisioning profiles I am seeing an issue with it. What is happening is when a notification service extension uses a call extension then the OS logs: doQueryCallExtensionStatusWithDispatchGroup() COMPLETED WITH ERROR: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.CallKit.CallDirectory was invalidated: failed at lookup with error 159 - Sandbox restriction." UserInfo= NSDebugDescription=The connection to service named com.apple.CallKit.CallDirectory was invalidated: failed at lookup with error 159 - Sandbox restriction. I noticed that in the company's provising profile for the notification service extension the app identier prefix is different from the team identifer. In my own provisioning profile the app identifier prefix and team identifer are the same. Could it be the case that this difference in identifiers within the provisioning profile is leading to the sandbox error message? Attached is the notification service extension provisioning profle provided to me by the company (converted to a .plist for readability)
2
0
7.9k
Sep ’22
Unwanted communication extension is unable to persist data written to defaults
I'm currently using 4 extensions within my app and use a group in combination with UserDefaults.init(suiteName:) to share settings between the extensions and the app. However I've just tried adding an unwanted communications extension and found that data writing to defaults, in the exact same way as the other extensions, isn't saved. At first I noticed data written by the UCE wasn't present when the app tried to read it, so performed an experiment and found that while the extension is running, it can write and read data to user defaults, but the next time the extension runs, all that data has gone. I've tried using the old and now default UserDefaults.synchronize() but it makes no difference. Why is the UC extension different from every other extension? Is it possible to write and persist data from within it? let groupName = "group.com.mycompany.appName" let sharedDefaults = UserDefaults.init(suiteName: groupName) var theValue = sharedDefaults!.value(forKey: "some key") NSLog("\(theValue)") // prints nothing, despite the extension having previously run sharedDefaults!.set("some value", forKey: "some key")) sharedDefaults!.synchronize() theValue = sharedDefaults!.value(forKey: "some key") NSLog("\(theValue)") // prints "some value"
2
1
1.5k
Aug ’22
Background Assets: how to add BAManifestURL | backgroundassets-debug tool doesn't do anything
I've added a background downloads extension to my app and added device console logging to every method in the placeholder code created by XCode, then installed the app to the phone. When I run the following command: xcrun backgroundassets-debug --app-bundle-id com.myCompany.myApp  --device-id 00008110-001E0DDA0AB8801E --simulate --app-update  and watch the console log - there's none of my logging from within the extension. In the OS log I can see this: error 11:24:41.550702-0700 backgroundassets.user Event (1) dropped for client () failed because client Info dictionary is missing its 'BAManifestURL' key. The template generated code says this: "The manifest that is downloaded is determined by BAManifestURL defined in the application's Info.plist" So I tried adding a key of BAManifestURL with a url hoping to initially just get the extension launching. But I still get the error saying the info dictionary is missing the BAManifestURL key. So exactly how should the BAManifestURL key value pair be added to the info.plist?
2
0
1.2k
Oct ’22
How to view TSIs?
In this section of this web site https://developer.apple.com/account/#CodeLevelSupportCard its possible to view a historical list of submitted TSIs, but there's nothing in their content which is clickable. Looking around elsewhere, there doesn't appear to be anywhere or anyway to view the original question and the responses in submitted TSIs? Is that really the case, or is there a bug in the Apple web site and they are supposed to be viewable?
2
0
1.5k
Sep ’23