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.

Post

Replies

Boosts

Views

Activity

Widget Configuration's Selected Parameter Always Reverts to Default
I created an intent for a configurable widget that lets users choose an option for a parameter called "domain." I've successfully loaded the selectable items for this parameter using the following code: import Intents class IntentHandler: INExtension, ConfigChartIntentHandling { func provideDomainOptionsCollection(for intent: ConfigChartIntent) async throws -> INObjectCollection<Domain> { let prefs = UserDefaults(suiteName: "group.name") let domains = prefs?.stringArray(forKey: "domains") if let domains { let optionsCollection = domains.map { Domain(identifier: $0, display: $0) } return INObjectCollection(items: optionsCollection) } else { // If no options, provide an empty list or a default option return INObjectCollection(items: []) } } } The issue occurs when I select a value for the "domain" parameter. Each time I select a value and then reopen the configuration modal, the field reverts back to "Choose." Here's a screenshot illustrating the behavior: Additionally, the widget doesn’t refresh after I change the "domain" value. However, another parameter using an enum ("Stats Type") works as expected. Is there something I might be missing? My Environment: MacOS Sonoma XCode 15.4
0
0
112
2w
iOS Message Filter Extension - deferQueryRequestToNetwork(completion:) error
iOS Message Filter Extension - deferQueryRequestToNetwork(completion:) error I made a test app using the iOS App template and added a target using the Message Filter Extension template which invokes deferQueryRequestToNetwork(completion:) when receiving an SMS. The app and the extension have same "Associated Domains Capabilities" with "messagefilter" pointing to a server which receives query requests and returns proper responses. The extension has the "ILMessageFilterExtensionNetworkURL" key in Info.plist file which specifies the server URL. deferQueryRequestToNetwork(completion:) throws a com.apple.calls.messagefilter error which reads "Extension's containing app (appID ) unauthorized to defer requests to host "
0
0
109
2w
NSItemProvider throwing exception related to secure coding
Our app has a share extension. And we recently noticed something with iOS 17.3.1. From Safari, when we receive the plist and try to load it, we are seeing exceptions for classes not allowed to be unarchived. [itemProvider loadItemForTypeIdentifier:[UTTypePropertyList identifier] options:nil completionHandler:^(NSDictionary *jsDict, NSError *error) { } We see these exceptions: value for key 'NS.keys' was of unexpected class 'NSString' (0x1ee7d2970) [/System/Library/Frameworks/Foundation.framework]. Allowed classes are: {( "'NSDictionary' (0x1ee7cad38) [/System/Library/Frameworks/CoreFoundation.framework]" )} (null) Our preprocessing javascript file is basic, and only passes a title and URL as part of the payload. arguments.completionFunction({ "URL": document.URL "title": document.title, });
27
0
2.5k
Feb ’24
Data sharing between WidgetWatchExtension and watchOS/iOS app
When I try to access the data in my IntentTimelineProvider in the recommendations function using App Groups, it is always empty "no data". func recommendations() -> [IntentRecommendation<IndicatorIntent>] { if let sharedUD = UserDefaults(suiteName: "group.measurements") { let jm = JanitzaMeasurementValue(identifier: "1", display: "2") let intent = IndicatorIntent() intent.indicatorWidgetData = jm let desc = sharedUD.string(forKey: "string") ?? "no data" return [IntentRecommendation(intent: intent, description: desc)] } return [] } Although I write this in both the watchOS and iOS app using App Groups. if let sharedUD = UserDefaults(suiteName: "group.measurements") { sharedUD.set("test", forKey: "string") } What is the right way to dynamically implement the widgets for Complications in watchOS? Like for example in Shortcuts App. **Thanks for support **
3
2
257
Oct ’24
UIApplication.shared.open
In iOS 17, the call to "UIApplication.shared.open("App-prefs:ACCESSIBILITY&path=HEARING_AID_TITLE")" was opening the device Settings and going to Accessibility and then Hearing Device which is very helpful. Now in iOS 18, this call only opens the device Settings at the root. I would like to know how to replace the URL so that it works like before. canOpenUrl does return true, so I'm wondering if something is broken, or if canOpenUrl is kind of lying a bit. I also tried other paths to go to other screens and they don't work either.
1
0
277
3w
INPlayMediaIntentHandling, Unable to Trigger App to Play Specific Podcast
I have an app that's capable of playing podcasts via Siri requests, e.g. "Hey Siri, play [Podcast Name]". I’m using INPlayMediaIntentHandling, that is, the SiriKit domain intents, as opposed to the newer AppIntents framework for its ability to select my app for audio playback without the need to specify the name of the app in the user's request to Siri. This works great overall for the many podcasts I’ve tested the app with, with the exception of one. There's a podcast called "The Headlines", and I when I test the app with the request "Hey Siri, play The Headlines", my app is never selected. Instead, Apple Podcasts begins playback of a show called "NPR News Now". Oddly, if the Apple Podcasts app is deleted, my app will still not be selected by the system, and instead, Siri responds with "I don’t see an app for that. You’ll need to download one" with a button to open the App Store. Additionally, if I do add the app name to the request using this style of intent, Siri responds with "[App Name] hasn’t added support for that with Siri." However, I’d still like to accomplish this without requiring the app name in the Siri request. There's nothing complex in my setup: The target declares one supported intent, INPlayMediaIntent, with "Podcasts" selected as a supported media category. The Siri entitlement is enabled. My INSiriAuthorizationStatus is .authorized. My intent handler is specified in my AppDelegate as follows: func application(_ application: UIApplication, handlerFor intent: INIntent) -> Any? { return IntentHandler.shared } My intent handler is simple: final class IntentHandler: NSObject, INPlayMediaIntentHandling { static let shared = IntentHandler() func handle(intent: INPlayMediaIntent) async -> INPlayMediaIntentResponse { print("IntentHandler: processing intent: \(intent)") /** code to start playback based on information found in `intent` **/ } When requesting Siri to "Play The Headlines", my handler code is not called at all. For all other supported shows, the print statement executes, and playback begins as expected. Is there any way I can get my app to be selected instead of Apple Podcasts for this request?
1
0
135
3w
App unexpectedly crashes after installation from testflight
I've an app running for some time in the Appstore now. Recently I had to renew my singing certficicates to be able to publish my app again. I renewed the certificates, updated my provisioning profile and signed a new app version to publish only to find out that the app crashes during the splash screen. I added new features to the app so my first thought was that there would be an issue there. To test that, I built the latest stable version of the app and signed it with the new profivisioning profile. The result was exactly the same crash as the new build. My assumption is that the crash is caused by bad signing (?) but I am not sure because I'm lacking experience on that front. I do have a crash report from testflight and logs from the device where the app crashed. Testflight crash: TestFlight crashlog Device error logs: Device error logs Hope someone can help my out because I'm at a dead end :(
1
0
168
3w
How to force update data from child phone ? FamilyControls / Screen Time Api / DeviceActivity
The data displayed about a child’s apps can be outdated (DeviceActivityReport), leading to misinformation for the user. When I access the “Screen Time” section (for child in the parent device) in the iPhone settings, I see there is an update functionality to force load the actual data. I have tried various workarounds, such as attempting to force an update on the child’s device to call DeviceActivityReport and opening system settings, but none of these have been successful :( How can I implement something similar? Is there a way to force update this data ?
0
2
176
3w
How to add a Sticker App Extension to an existing app with an iMessage Extension?
I have a working iMessage app in the app store that does NOT have a companion app. iMessage app only. I now want to add stickers to it. I cannot get this to work; stickers do not show up in the stickers section, nor in the "Manage Sticker Apps" section. Problem exists on Xcode 16, latest OS, on all simulators and devices. I tried adding a new "Sticker App Extension" target to the project. I tried adding just the Stickers.xcassets file to the exsisting iMessage extension and the app itself. I tried googling but all examples and tutorials show how to create a complete stickers app, which works correctly. But I do not want the app. Notable mention: If I create a new "Stickers app" project it works, but if I then try to add an iMessage app extension, THAT does not work so I then have a reverse situation in which the stickers extension DOES work but the iMessage app doesn't. I somehow have the feeling that an app cannot have both an iMessage Extension and a Stickers App Extension but the documentation is, of course, in true Apple style, lacking. So how to add a Sticker App Extension to an existing app with an iMessage Extension?
1
0
266
Oct ’24
Family Controls Entitlement Request: How Long for Approval?
A few weeks ago, I submitted a request for the Family Controls & Personal Device Usage Entitlement to enable my app to access the Managed Settings and Device Activity frameworks in the Screen Time API. The app is nearly complete, with the only remaining component being the Family Controls capability. As of now, I haven’t received a response regarding the request. I’m wondering if anyone else has experienced a similar situation or can provide insight into the following: • How long does it typically take to receive feedback on this type of entitlement request? • Is there a way to check if a request is still active and under review? • Is a finished website required for the entitlement to be granted? Any information or guidance would be greatly appreciated!
2
1
273
Sep ’24
Screentime Apps - get notified when etabled or disabled
Quibr question for Apple - Context: We are developing an app that via screentime access blocks restricted sites for gamblers. However our blocking can be bypassed by going into settings→screentime-&gt;Apps With Screen time access" and toggling off access to screentime with device’s FaceID (and not the screentime passcode.) Then they can browse whatever blocked site and delete our app if they wish. Question: We would like to know if there is a way to get the information when and how many times the toggle of our app under the “Apps with screen time access” has been pressed, or its current status. 3rd waay: Alternatively is there a way to monitor if the app is still installed on the device?
1
1
244
Aug ’24
Mock Screen Time for Testing
Hi everyone, I'm trying to find out if there's a way to mock Screen Time for a specific app (either on a real device or in a simulator). Specifically, I need to set the usage time of an app to something like 15 minutes. I'm not looking to alter the total Screen Time, just the usage time for a single app. Currently, I'm manually keeping the app open for 15 minutes before I can start testing to see if the desired behavior occurs, but this process is slow and frustrating. Unfortunately, I can't reduce the 15-minute threshold, as Apple doesn't allow it for this particular use case. Any advice or solutions would be greatly appreciated!
1
0
275
Aug ’24
Schedule a Screenlock for a time in the future? (ScreenTime API))
Hello! I'm currently making an app that requires the ability to activate a screenlock for a point in the future. I currently have my project setup so that I can set a screenlock through a DeviceActivityMonitorExtension (DAM) but regardless of the time interval I use for intervalDidStart and intervalDidEnd the screenlock just seems to apply instantly. I'm under the impression that I'm missing something outside of just passing the interval to the DAM functions. Has anyone accomplished this? Thank you!
1
0
321
Aug ’24
iPhone mirroring screen switching (request & question)
iPhone mirroring is available from macOS 15. When running an app with iPhone mirroring Can I know whether the app currently being mirrored is running at the top of the Mac app or screen? Or is there a way to know whether it is hidden by another app on the Mac or re-displayed? If not, I hope it will be added in a future update. And I hope there is an API that can tell whether the current app is connected to iPhone mirroring or not.
0
0
140
3w