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

Installing Keyboard Extension changes the iOS system language to Corsican based on bundle ID
I have built an iOS keyboard extension, before it is installed the system prefered language is "English" like so: After installing the keyboard extension the system language is set to "Corsican", like so: Corsican is being set because the bundle identifiers start with co. which maps to the ISO 639-1 language code for Corsican co. I've verified that my PrimaryLanguage is en-US, see below a section of Info.Plist. I've verified the bundle ID is the root cause by changing the bundle ID to something not starting with co and this behaviour disappears. ... <key>NSExtension</key> <dict> <key>NSExtensionAttributes</key> <dict> <key>IsASCIICapable</key> <false/> <key>PrefersRightToLeft</key> <false/> <key>PrimaryLanguage</key> <string>en-US</string> <key>RequestsOpenAccess</key> <false/> </dict> <key>NSExtensionPointIdentifier</key> <string>com.apple.keyboard-service</string> <key>NSExtensionPrincipalClass</key> <string>$(PRODUCT_MODULE_NAME).KeyboardViewController</string> </dict> ... This seems like a bug in iOS. Any suggestions what to try?
2
0
570
Apr ’23
PMSessionValidatePrintSettings never change on macOS
Hello, PMSessionValidatePrintSettings return always "false" on macOS PMPrintSettings settings; PMPrintSession session; Boolean result; PMCreateSession(&session); PMSessionSetCurrentPMPrinter(session, printer); PMCreatePrintSettings(&settings); PMSessionDefaultPrintSettings(session, settings); PMSetDuplex(settings, kPMDuplexTumble); PMSessionValidatePrintSettings(session, settings, &result); PMRelease(session); PMRelease(settings); if (result) NSLog (@"%@", @"changed"); else NSLog (@"%@", @"not changed"); Thanks
0
0
170
2w
Live Activity Does Not Appear on devices running iOS 17, built with Xcode 16
We are facing a serious issue affecting the Live Activity of the our app. If the app is built with Xcode 16 (16A242) the Live Activity does not appear on devices running iOS 17. The live activity does appear on devices running iOS 18 RC. If we build the code with Xcode 15, the Live Activity appears on iOS 17 as expected. To investigate this we also prepared a demo bare-bones project to make sure the Live Activity presence is not affected by part of the existing code. Again the issue appears even of the demo app. Is this a known issue with Xcode16/iOS 18?
5
0
305
2w
Setting a sub action in message filter extension causes a crash on iOS 18
The following code runs fine on iPhone with iOS < 18 However with iOS 18 (Release Candidate) it causes a crash of the extension extension MessageFilterExtension: ILMessageFilterQueryHandling, ILMessageFilterCapabilitiesQueryHandling { @available(iOSApplicationExtension 16.0, *) func handle(_ capabilitiesQueryRequest: ILMessageFilterCapabilitiesQueryRequest, context: ILMessageFilterExtensionContext, completion: @escaping (ILMessageFilterCapabilitiesQueryResponse) -> Void) { let response = ILMessageFilterCapabilitiesQueryResponse() response.promotionalSubActions = [ILMessageFilterSubAction.promotionalOffers] completion(response) } The problem specifically is the line: response.promotionalSubActions = [ILMessageFilterSubAction.promotionalOffers] Attempting to set a promotionalSubAction (or a transactional sub action) results in an exception with error: '/usr/lib/swift/libswiftIdentityLookup.dylib' (no such file)` This only occurs with iOS 18, and it doesn't occur if no subactions are set
1
0
167
2w
Can't get assistive access - error using system events in AppleScript
We have a sandboxed Final Cut Pro (FCP) workflow extension that needs to control FCP to export the current video project. When executing an AppleScript, we encounter the error: "System Events got an error: FCPExtension (Final Cut Pro) is not allowed assistive access." This occurs despite the container app having been granted automation and accessibility permissions by the user. What could be missing from the project to ensure the script runs without issues? AppleScript: shareDestination("Destination") on shareDestination(_dest) tell application "Final Cut Pro" activate end tell tell application "System Events" set frontmost of process "Final Cut Pro" to true tell process "Final Cut Pro" perform action "AXRaise" of (first window whose name contains "Final Cut Pro") click menu bar 1 tell menu bar 1 tell item 3 of menu bar items tell menu 1 tell menu item 12 tell menu 1 set menuItems to menu items whose title is (_dest & "…") if length of menuItems > 0 then set targetMenuItem to item 1 of menuItems if enabled of targetMenuItem then try click targetMenuItem on error errMsg number errNum error errMsg end try else error "Share destination is not enabled." & return & "Please try selecting an item in Final Cut Pro." end if else error "Share destination not found." end if end tell end tell end tell end tell end tell end tell end tell end shareDestination As soon as the script reaches set frontmost of process "Final Cut Pro" to true it launches the error.
0
0
110
2w
Migrating custom intents to App Intents
Hi, I am trying to migrate my custom intents to App Intents, and was running into some issues. My current intentdefinitions file and all intent handling code are in a framework that is shared with my app target. I went through the migration assistant and added the App Intents codes directly to my main app target. When I run a shortcut with the App Intent, it doesn't work ... I get some messages in the console that say: Could not find an intent with identifier MyCustomAddContactIntent, mangledTypeName: Optional("") I guess the old custom intents and new App Intents should both live in the same package to see each other. In this case, I'm not sure if all the existing custom intents file and all the intents handler logic should be moved into the main app bundle (and removed from framework), or should I add the new App Intents handlers into the framework (in addition to the main app)? Also, will the custom framework even be needed or run in iOS16+? Thanks.
1
1
457
Jun ’24
Could not find intent for LiveActivity Button
I show some content in LiveActivity Dynamic Island and added a button. As buttons work with App Intent I created an Intent. When the button is clicked I get the following error Could not find an intent with identifier MyIntent, mangledTypeName: Optional("19LiveWidgetExtension10MyIntentV") MyIntent.swift import Foundation import AppIntents struct MyIntent: LiveActivityIntent { public init() { } func perform() async throws -> some IntentResult { print("click") return .result() } } MyLiveActivity.swift ... DynamicIslandExpandedRegion(.bottom) { HStack(alignment: .top) { Button(intent: MyIntent()) { Image(systemName: "bolt.fill") } } .tint(.white) .padding() } .... The Intent is added to all targets. Any ideas?
3
1
549
Feb ’24
WidgetKit with Intent on iOS 17
I have edited the default widget with Intent, but am being hit with the following errors… it runs perfectly fine if I don’t use an Intent in a static widget Could not find an intent with identifier ConfigurationAppIntent, mangledTypeName: Optional("27trainWidgetsConfigExtension22ConfigurationAppIntentV") associateAppIntent(forUserActivity:) Error converting INIntent to App Intent: AppIntents.PerformIntentError.intentNotFound I think it may be something to do with Info.plist?
4
2
1.7k
Nov ’23
WidgetKit Not running in iOS 14/15 (FBSOpenApplicationServiceErrorDomain)
I was adding WidgetExtension target for my old project. The widget target is running fine in iOS 17, In my case, widget need to support iOS 14 and above, so I updated my widget code to old style, To removing WidgetConfigurationIntent and AppIntentTimelineProvider. import WidgetKit import SwiftUI struct Provider: TimelineProvider { func placeholder(in context: Context) -> SimpleEntry { SimpleEntry() } func getSnapshot(in context: Context, completion: @escaping (SimpleEntry) -> Void) { completion(SimpleEntry()) } func getTimeline(in context: Context, completion: @escaping (Timeline<SimpleEntry>) -> Void) { completion(Timeline(entries: [SimpleEntry()], policy: .never)) } typealias Entry = SimpleEntry } struct SimpleEntry: TimelineEntry { let date: Date = Date() } struct NCWidgetEntryView : View { var entry: Provider.Entry var body: some View { VStack { Text("Time:") Text(entry.date, style: .time) } } } struct NCWidget: Widget { let kind: String = "NCWidget" var body: some WidgetConfiguration { StaticConfiguration(kind: kind, provider: Provider()) { entry in NCWidgetEntryView(entry: entry) } .configurationDisplayName("DisplayName") .description("description") } } In my case, the code was working fine in iOS 17 simulator, But if I try to run in iOS 15, it returns the below error code-SendProcessControlEvent:toPid: encountered an error: Error Domain=com.apple.dt.deviceprocesscontrolservice Code=8 "Failed to show Widget 'com.name-pprd.NCWidgetExtension' error: Error Domain=FBSOpenApplicationServiceErrorDomain Code=5 "The request to open "com.apple.springboard" failed." UserInfo={NSLocalizedDescription=The request to open "com.apple.springboard" failed., NSLocalizedFailureReason=Unexpected error type., NSUnderlyingError=0x600003570b40 {Error Domain=BSServiceConnectionErrorDomain Code=3 "XPC error received on message reply handler" UserInfo={BSErrorCodeDescription=OperationFailed, NSLocalizedFailureReason=XPC error received on message reply handler}}, BSErrorCodeDescription=InvalidResponse}." UserInfo={NSLocalizedDescription=Failed to show Widget 'com.name-pprd.NCWidgetExtension' error: Error Domain=FBSOpenApplicationServiceErrorDomain Code=5 "The request to open "com.apple.springboard" failed." UserInfo={NSLocalizedDescription=The request to open "com.apple.springboard" failed., NSLocalizedFailureReason=Unexpected error type., NSUnderlyingError=0x600003570b40 {Error Domain=BSServiceConnectionErrorDomain Code=3 "XPC error received on message reply handler" UserInfo={BSErrorCodeDescription=OperationFailed, NSLocalizedFailureReason=XPC error received on message reply handler}}, BSErrorCodeDescription=InvalidResponse}., NSUnderlyingError=0x600003570bd0 {Error Domain=FBSOpenApplicationServiceErrorDomain Code=5 "The request to open "com.apple.springboard" failed." UserInfo={NSLocalizedDescription=The request to open "com.apple.springboard" failed., NSLocalizedFailureReason=Unexpected error type., NSUnderlyingError=0x600003570b40 {Error Domain=BSServiceConnectionErrorDomain Code=3 "XPC error received on message reply handler" UserInfo={BSErrorCodeDescription=OperationFailed, NSLocalizedFailureReason=XPC error received on message reply handler}}, BSErrorCodeDescription=InvalidResponse}}} Domain: DTXMessage Code: 1 User Info: { DVTErrorCreationDateKey = "2024-07-20 17:30:58 +0000"; } -- System Information macOS Version 14.5 (Build 23F79) Xcode 15.0.1 (22266) (Build 15A507) Timestamp: 2024-07-20T23:00:58+05:30 In widget target Minimum target is 14.0 In App target Minimum target is 13.0
5
0
509
Jul ’24
ASWebAuthenticationSession with https callback works with real device but not on simulator
I'm working on Authenticating a User Through a Web Service and using https callback. When running the project on real device all works as expected, but when I run the same project with the same config on simulator I get this error: Login failed: Error Domain=com.apple.AuthenticationServices.WebAuthenticationSession Code=1 "Application with identifier bundle_id is not associated with domain my_domain. Using HTTPS callbacks requires Associated Domains using the webcredentials service type for my_domain." UserInfo={NSLocalizedFailureReason=Application with identifier bundle_id is not associated with domain my_domain. Using HTTPS callbacks requires Associated Domains using the webcredentials service type for my_domain.} Xcode 15.4 iOS 17.5 @available(iOS 17.4, *) public init(url URL: URL, callback: ASWebAuthenticationSession.Callback, completionHandler: @escaping ASWebAuthenticationSession.CompletionHandler)
0
0
171
2w
[iOS 18] Screen Time Passcode is still NOT compatible with screen time permissions for 3rd party-apps
⬇️ ANYONE ON APPLE'S SCREEN TIME TEAM, PLEASE READ THIS ⬇️ Let's summarize the situation. 3rd-party apps with screen time access can be disabled by going to Settings > Screen Time > Apps with Screen Time Access. That's fine. Now, if I want to make it harder to remove my restrictions, I can ask a friend to enter a Screen Time Passcode for me. Great idea! The problem is my Screen Time Passcode isn't requested when disabling permissions for a third-party app. It's required for modifying any other Screen Time setting EXCEPT permissions for 3rd party apps. This is frustrating. The Screen Time passcode is a great feature. Making it compatible with permissions granted through the Family Controls framework is our NUMBER ONE REQUEST from tens of thousands of users. This feature has been requested for a long time (iOS 16, iOS 17, …): https://forums.developer.apple.com/forums/thread/714651 https://forums.developer.apple.com/forums/thread/727291 https://discussions.apple.com/thread/255421819 FB13548526
 If you're a developer working on Screen Time, share your feedback below or file one using Feedback Assistant. It is very disappointing to see it wasn't implemented for iOS 18. I can't believe this would require tremendous work from the Screen Time team to make it happen, but it would be a significant improvement for the Family Controls Framework and a ray of sunshine for all the developers who have worked really hard to deliver high-quality apps using the Screen Time API. Could an Apple engineer or a Screen Time team member give us any updates? Implementing this before the public release of iOS 18 would make A LOT of developers happy.
7
8
1.2k
Jun ’24
Trouble deving universal links, only error is enterprise managed device
iOS 16.4 and 17.2.1 Hello, I've been developing the universal link for my mobile application and I can't actually get the app to open when the link is tapped. I went through some trial and error.. but here's my current status: testing my url in settings -> developer -> associated domains shows that my link should open an installed application sysdiagnose logs show that everything looks good there: Service: applinks App ID: 1234abcd.com.example Domain: example.com User Approval: unspecified Site/Fmwk Approval: approved Last Checked: 2023-08-24 10:09:00 +0000 Next Check: 2023-08-18 21:00:19 +0000 The only thing that indicates an error of some kind is the console logs during install.. when filtering on swcd it shows an error for Error getting enterprise-managed associated domains data. If this device is not enterprise-managed, this is normal: Error Domain=SWCErrorDomain Code=1701 UserInfo={Line=231, Function=<private>} I'm not sure if this is a managed device - my understanding is that managed devices allow enterprise businesses to operate the device remotely essentially (send files, run commands, etc). To my knowledge, this isn't enterprise managed device. It is listed in the devices page in my company's developer account, but we are a smaller shop, definitely not enterprise. I added the associated domain/app link via xcode, and it generated the entitlements file for me. <key>com.apple.developer.associated-domains.mdm-managed</key> <true/> switching that to false breaks the build: Provisioning profile "iOS Team Provisioning Profile: <mydomain>.<myapp>.dev" doesn't match the entitlements file's value for the com.apple.developer.associated-domains.mdm-managed entitlement. Profile qualification is using entitlement definitions that may be out of date. Connect to network to update. Removing it all together builds fine but doesn't allow me to open the app with a link. The other thing that looks off is an output in the logs filtered on swcd for Developer mode enabled: No but clearly I've enabled developer mode on the phone. I've pasted my link into my notes app and am attempting to open it from there If anyone can help me figure out what the disconnect is here, it would be greatly appreciated!
1
0
571
Jan ’24
DeviceActivityMonitor is overcounting screen time for users on iOS 17.6.1
Our app uses a 24-hour DeviceActivityMonitor repeating schedule to send users notifications for every hour of screen time they spend on their phone per day. Notifications are sent from eventDidReachThreshold callbacks at 1, 2, 3, etc, hour thresholds to keep them aware of their screen time. We have recently received an influx of emails from our users that after updating to iOS 17.6.1 their DeviceActivityMonitor notifications are saying their screen time was much higher than what is shown in DeviceActivityReport and their device's Screen Time settings. These users have disabled "Share Across Devices" - but I suspect the DeviceActivityMonitor is still getting screen time from their other devices even though that setting is turned off. Has anybody else noticed this, understands what is causing this, or could recommend a fix that we can tell our users to do?
4
3
281
2w
CPVoiceControlState repeating image?
I am trying to use CPVoiceControlState and include an animated image, but for the life of me I cannot figure out what sort of image it wants. I have tried animated .gif, .png, a static image, an image sequence and none seem to animate. Here is what I am using with an animated .png: func showLoadingTemplate() { enum VoiceControlStates: String { case loading = "loading" } let spinner = UIImage(named: "spinner") loadingTemplate = CPVoiceControlTemplate(voiceControlStates: [ CPVoiceControlState(identifier: VoiceControlStates.loading.rawValue, titleVariants: [NSLocalizedString("Loading...", comment: "CarPlay: Loading")], image: spinner, repeats: true) ]) loadingTemplate?.activateVoiceControlState(withIdentifier: VoiceControlStates.loading.rawValue) if let loading = loadingTemplate { currentInterfaceController?.presentTemplate(loading, animated: true, completion: { (result: Bool, error: Error?) in }) } } This shows the image but it isn't animating. Can anyone let me know what sort of image needs to be used in order to get it to animate? I have seen animated images working in Waze and Google Maps so if must be possible.
1
0
159
2w