Extensions

RSS for tag

Give users access to your app's functionality and content throughout iOS and macOS using extensions.

Posts under Extensions tag

200 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

How to send x,y data from HIDStylusDriver to StylusApp to Pen/Draw
Here is project I am researching: https://developer.apple.com/documentation/hiddriverkit/handling_stylus_input_from_a_human_interface_device I have a Touch screen and I want: can control this screen, I can enable extension and control Touch screen successfully. can pen on this screen. To do this, I need to send X,Y to StylusApp(AppKit) But I Can not send X, Y to Swift StylusApp Eventhough I can log X,Y it by default code: But I don't know how to send it to AppKit to Pen. I have research about communicate Driver and Client: https://developer.apple.com/documentation/driverkit/communicating_between_a_driverkit_extension_and_a_client_app#4324306 but seem HID driver don't support inheritance from IOUserClient:
1
0
46
2d
Extensions in Web Apps?
Testing Sequoia public beta. The latest Safari should now support Extensions in web apps. https://developer.apple.com/documentation/safari-release-notes/safari-18-release-notes#Safari-Extensions But even I have extensions in the main Safari, there is none showing up in any of the web apps. What can be done to resolve this?
0
0
111
3d
sourceAppIdentifier is getting wrong with Sequoia Beta3
HI, I have Mac Sequoia Beta3. I installed Content Filer network extension which is same as https://developer.apple.com/documentation/networkextension/filtering_network_traffic in my machine. When I try to connect a machine through "ssh", NEFilterFlow.description in handleNewFlow(_ flow: NEFilterFlow) is showing "sourceAppIdentifier" (process name) as "Terminal" instead of "ssh". But other Mac OS versions, it is showing as "ssh". Is there any issue with Sequoia Beta3? or Is this expected? Thanks
1
0
124
5d
Notification Service Extension is initialized but never triggered
Hi all, I'm attempting to implement a notification service extension for my app, however I'm running into some troubles with triggering the extension. The service extension is successfully installed with the app, and is initialized when a notification is received (which ive confirmed by attaching a debugger to it), however the didReceive method is never called. In the debugger console, the following message is printed: Service extension base class recieved didReceiveNotificationRequest: . I can confirm that the all the payload requirements are met to trigger the extension, and I was able to create an extension that would trigger in a blank application (using the same payload). It's only this app that prints this message to the console, and does not trigger. The extension code is as follows (I've removed all of the intended functionality at this point to try and pinpoint the issue) class NotificationService: UNNotificationServiceExtension { var contentHandler: ((UNNotificationContent) -> Void)? var bestAttemptContent: UNMutableNotificationContent? override init() { self.contentHandler = nil self.bestAttemptContent = nil print("startup!") } func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) async { let logger = Logger(subsystem: "app.revolt.chat", category: "notificationservice") logger.info("Invoked notification extension") debugPrint(request) self.contentHandler = contentHandler bestAttemptContent = (request.content.mutableCopy() as? UNMutableNotificationContent) guard let bestAttemptContent = bestAttemptContent else { print("content is null") return } bestAttemptContent.title = "beans" if request.content.categoryIdentifier != "ALERT_MESSAGE" { bestAttemptContent.subtitle = "not an alert message" contentHandler(bestAttemptContent) return } contentHandler(bestAttemptContent) } override func serviceExtensionTimeWillExpire() { // Called just before the extension will be terminated by the system. // Use this as an opportunity to deliver your "best attempt" at modified content, otherwise the original push payload will be used. if let contentHandler = contentHandler, let bestAttemptContent = bestAttemptContent { contentHandler(bestAttemptContent) } } }
0
0
152
1w
Share arbitrary struct from HostApp to Extension and get arbitrary result back
I want to share a Transferable (JSON-encoded) data struct from some HostApp with an Extension of my ContainingApp, and get a different Transferable (also JSON-encoded) data struct back on success. Since I want to present my ContainingApp's AppIcon in the sharing sheet to make it easy for the user to find it, I started building a Sharing Extension and not an Action Extension. AFAIK the difference is only in the presentation (Sharing Extension: Icon+name of the ContainingApp vs Action Extension: simple b/w system icon plus a string describing the action (e.g. "Copy", "Save to Files")), and the data flow is identical. Please correct me if I'm wrong. I added the Sharing Extension to my ContainingApp (which are both in the same app group so they can use a shared container to exchange data). The (real) HostApp is from a different company we are collaborating with, and thus is not in our app group. Once everything runs I will add a tailored NSExtensionActivationRule to make sure our Sharing Extension is only shown to our partner's HostApp. Currently I am still using TRUEPREDICATE. The goal is that after the user tapped the "Continue with ContainingApp" (Share-)button in the HostApp, iOS will only show my ContainingApp icon and nothing else, since that's the only useful choice for the user. Side Question 1: The best user experience would be if the HostApp could directly present our extension when the user tapped the "Continue with ContainingApp"-button, without the user needing to choose it manually in the Share-sheet, but I guess this is not possible for privacy/security reasons, right? In the debugger of the HostApp I see this error: Type "com.myapp.shareInput" was expected to be exported in the Info.plist of Host.app, but it was imported instead. Library: UniformTypeIdentifiers | Subsystem: com.apple.runtime-issues | Category: Type Declaration Issues but I definitely want to define and export both ShareInput and ShareResult as UTExportedTypeDeclarations in my extension, and all 3rd-party apps (like this demo HostApp) using my extension need to import them. Side Question 2: Can I just ignore this error? And tell the 3rd-party app developers they also can ignore it? After the user tapped on the ContainingApp icon in the sharing dialog, my Sharing Extension will show its dialog, presenting the shared item it got from the HostApp, and let the user edit the text. When the user taps the "Save"-button in my extension, it creates a ShareResult struct to send back to the HostApp, and dismisses the sheet. This (kinda) works when I share plain text with the 􀈂Text button in my HostApp. My ContainingApp icon is shown together with Mail, Messages, and other apps that can process plain text; with shortcuts to persons and devices (AirDrop targets) in the line above, and with actions (Copy, New Quick Note, Save to Files, Save to Citator, Certificat, Airdrop) below. When I choose my ContainingApp, the extension runs and shows the text it got. ("Kinda" because I am still struggling to send data back. See below...) So the principal operation works... Side Question 3: In the HostApp, can I use ShareLink() to present the Share-sheet and receive the result struct or do I always need to activityViewController!.completionWithItemsHandler = completionHandler windowScene.keyWindow?.rootViewController?.present(activityViewController!, animated: true, completion: nil) and process the result in the completionHandler? If returning (any) data from the extension is possible with ShareLink() also, then how? I didn't find any sample showing this... I implemented the ShareLink() anyway (and ignore the result part for the moment). When I try to share a ShareInput struct with the 􀈂ShareLink button, the same persons are sorted differently, there are less app icons (9 instead of 13), and less actions (only 3: New Quick Note, Save to Files, AirDrop): Note that while the preview correctly shows the preview text provided ("shareInput"), the preview image left of it is blank (instead of arrowshape.right.fill): let preview = SharePreview("shareInput", image: Image(systemName: "arrowshape.right.fill")) When I choose my ContainingApp, the extension runs ... On iOS17, I see that indeed my ShareInput data arrived in my extension: ❗️itemProvider=<NSItemProvider: 0x301b1c460> {types = ( "com.myapp.shareInput" )} Library: ShareExtension | Subsystem: com.myapp.containingdemo.ShareExtensionDemo | Category: ShareSheet However, on iOS 16 it doesn't work: Host[8615:634470] [Type Declaration Issues] Type "com.myapp.shareInput" was expected to be exported in the Info.plist of Host.app, but it was imported instead. Host[8615:634462] [ShareSheet] Couldn't load file URL for Collaboration Item Provider:<NSItemProvider: 0x280f49180> {types = ( "com.myapp.shareInput" )} : (null) That error is shown before I choose the ContainingApp to share with. When I do that, I get: ShareExtension[8774:636786] [ShareSheet] ❗️itemProvider=<NSItemProvider: 0x28243a300> {types = ( "dyn.age8u", "public.file-url" )} which clearly shows the ShareInput struct was not transferred to the extension. But since I don't know how to transfer the ShareResult back to the HostApp when using a ShareLink, I cannot continue this approach anyway. When I try to share a ShareInput struct with the 􀈂JSON button (using present(activityViewController)), I see (both on iOS 16 and iOS 17): My extension (rather, the ContainingApp's icon) is not shown as Sharing target (even though it still has TRUEPREDICATE), which means that my code didn't manage to pack the ShareInput struct for the activityViewController - and thus it doesn't know what to share. I did the same as with the plainText item before: let shareInput = ShareInput(inputStr: "ShareInput as JSON") let preview = SharePreview("shareInput", image: Image(systemName: "arrowshape.right.fill")) VStack(spacing: 25.0) { Text("HostApp!") ShareButton(title: "Text", shareItems: [ItemSource(dataToShare: "sharing some text")]) ShareButton(title: "JSON", shareItems: [ItemSource(dataToShare: shareInput)]) ShareLink("ShareLink", item: shareInput, preview: preview) } (I will continue in the next posting)
7
0
173
16h
Message Filter Extension won't use Basic Auth
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.
1
0
150
5d
Account Authentication Modification Extension on iOS 18
We currently have an Account Authentication Modification Extension in our iOS App so that users can update their passwords directly from within the Passwords section in the iOS Settings App. On iOS 18 beta3 the extension is not executed from the new Passwords app. Instead the URL associated with the credentials is opened when choosing to change a password. Will it still be possible to integrate with the new Passwords app or is this no longer supported? https://developer.apple.com/wwdc24/10125 only mentions https://example.com/.well-known/change-password Also, can we provide the information to the Passwords app that our service does not support verification codes? So that the "set up verification code" option is not displayed for our website in the Passwords app.
0
0
157
1w
Conntent Filter network extension is not working with Sequoia Intel macOS
Hi, I had a Content Filter network extension. It is successfully working until Sonoma. I try to install and activate same network extension on Sequoia beta Intel Mac. But even I haven't got any user consent to activate and allow it. I haven't found any entry in Network settings. Do we need to make any changes in Sequoia MacOs to make it work? Thank you.
3
0
182
1w
IOS BroadcastExtension
Hello, I'm new here, I was developing a screen recording extension for an IOS application, I used the RPSBroadcastSampleHandler livekit as a basis, in tests a few months ago it worked, but after the long wait for publishing authorization the extension stopped working, I noticed which is not just mine but screen sharing from Google Meet, Zoom Mettings and others also don't work, I tested it on iPhone 14 pro and iPhone 6s, nothing worked, the option to select the extension appears but when clicking "start sharing" nothing happens and after a few seconds the sharing button returns to "start sharing", the same behavior in all tested apps, does anyone know what happens? Did you change the way you record and no app has updated? Internal error in IOS? Nothing logs in terminal just doesn't work.
1
0
202
2w
I am unable to debug a Safari extension in Xcode 16 beta 1 on iOS 18 beta
The process to reproduce: Create a new extension with Xcode 16 beta. Run it on the simulator or any iOS device with iOS 18 beta installed. Open Safari on your Mac, then open Develop -> Device you use. Unable to access these menus for iOS 18: 1. Extension - Extension Background Content 2. Extension - Extension Pop-up Page - popup.html However, for iOS 17.4, I can see these options in Develop -> Device iOS(17.4). I have another extension on the App Store that is not working on the iOS 18 beta, but I am unable to debug it because of this issue.
1
0
254
2w
Unable to invoke the host App in ShareExtension
I developed a Share Extension for my App. Using the following code in the extension, I am unable to invoke the main App; however, I noticed that the Bing App can be invoked normally. Therefore, I have two questions; Is there a bug in the invocation code? I used the extensionContext?.open method to invoke, and the callback flag always returns false; the scheme can be invoked normally in Safari How does the Bing App do it? this my code: extensionContext?.open(URL(string: “myappscheme://”)!, completionHandler: { succ in // print(“open (succ)”) // }) Environment: Mac OS: 15.0 Beta (24A5279h) iPad OS : 18 Beta 1 "
2
0
223
2d
Does SystemMemoryReset related to my Application abnormal exit?
Hello, we are currently developing a VPN application. Recently, we have encountered several cases where the Network Extension process terminates unexpectedly. We cannot find any related crash logs on the device, but we can find system SystemMemoryReset logs. The timestamps in these logs closely match (with millisecond accuracy) the times when our VPN process terminated unexpectedly. We have a few questions: 1.How is the SystemMemoryReset event generated, and can this event be avoided? 2.When a SystemMemoryReset occurs, can it cause our VPN background process to be killed or the system to reboot? 3.If the background process can be killed, what conditions need to be met for this to happen, and what methods can we use to prevent the VPN background process from being killed? 4.Based on these logs, does our application have any related issues (the process name is CorplinkTunnel)? Do you have any suggestions for modifications? SystemMemoryReset-2024-06-25-232108.log SystemMemoryReset-2024-06-29-025353.log SystemMemoryReset-2024-07-01-024655.log
1
0
193
2w
iOS dosen't call didActivateAudioSession
PLATFORM AND VERSION iOS Development environment: Xcode 15.0, macOS 14.4.1, Objective-C Run-time configuration: iOS 17.2.1, DESCRIPTION OF PROBLEM I am developing an application that uses NetworkExtension (VoIP local push function). But iOS sometimes doesn't call didActivateAudioSession after following sequence. Would you tell me why iOS doesn't call didActivateAudioSession ? (I said "sometimes", but once it occurs, it will occur repeatedly) myApp --- CXStartCallAction --->iOS myApp <-- performStartCallAction callback --- iOS myApp --- AVAudioSession setCategory: AVAudioSessionCategoryPlayAndRecord --->iOS myApp --- AVAudioSession setMode: AVAudioSessionModeVoiceChat --->iOS myApp <-- didActivateAudioSession callback ----iOS I suspect that myApp cannot acquire an AVAudioSession if another app is already using AVAudioSession. [QUESTION1] Is my guess correct? Should I consider another cause? [QUESTION2] If my guess is correct, how can I prove if another app is already using an AVAudioSession? This issue is based on a customer complaint, but the customer said they don't use any other apps. Best Regards,
5
0
278
1w
"No current extension context; trying most recent context" errors in Safari App Extensions
Hello, I've encoutered an issue with Safari App Extensions. My extension prints lots of suspect error logs in the Xcode console and inside Console.app. This happens basically whenever I make any interaction with the App Extension or with Safari. The most common and predictable error log I get is: No current extension context; trying most recent context (Subsystem: com.apple.SafariServices) However, I also sometimes get the following error messages, albeit less frequently, which may be related: No extension context for best match No extension context for remote object Error connecting back to host for remote object: NSCocoaErrorDomain, code: 4099 No known extension contexts for profile 00000000-0000-0000-0000-000000000000 Most recent extension context B7223E12-B563-45E0-97F8-50500BC6B994 does not have connection back to host; trying best match context I haven't been able to find anything about these error logs in Apple documentation or on the Internet, so I did a bit of empirical investigation. I reproduced the bug in the following basic scenario: I've created a new Safari App Extension project in Xcode by going to File > New > Project > Safari Extension App. I've selected "Safari App extension" for the type and "Swift" for the language. The project comes by default with a "SafariExtensionHandler.swift" file, which includes the following code: override func validateToolbarItem(in window: SFSafariWindow, validationHandler: @escaping ((Bool, String) -> Void)) { validationHandler(true, "") } No issues so far. If I add the following call: override func validateToolbarItem(in window: SFSafariWindow, validationHandler: @escaping ((Bool, String) -> Void)) { validationHandler(true, "") SFSafariApplication.getActiveWindow { window in // code } } There are still no error messages logged in the Console. However, if I do this instead: override func validateToolbarItem(in window: SFSafariWindow, validationHandler: @escaping ((Bool, String) -> Void)) { validationHandler(true, "") DispatchQueue.main.async { SFSafariApplication.getActiveWindow { window in // code } } } Then my Xcode console starts being spammed with "No current extension context; trying most recent context" error logs. With some more testing, it seems that the most common/predictable situation that causes the error log seems to be when calling any Safari API (e.g. SFSafariApplication.getActiveWindow{} or even SFSafariApplication.setToolbarItemsNeedUpdate()) outside of a direct method call provided by the Safari App Extension API. So making API calls directly from inside validateToolbarItem(in:, validationHandler:) or messageReceived(withName:from:userInfo:) calls is fine, but anything else causes "No extension context" logs. The bug even reproduces if you make a Safari API call directly inside of an @IBAction method call caused by a button click inside the Safari popover of the Safari App Extension. With this being the case, it seems to be impossible to make clean Safari API calls in an asynchronous or proactive way, which is problematic for our app extension use case and which seems to defeat the purpose of some of the API calls like SFSafariApplication.setToolbarItemsNeedUpdate(). Also, this seems to be a new issue. I've tested these scenarios on various macOS versions that I had on hand (specifically, on macOS 10.15 Catalina, macOS 13 Ventura and macOS 14 Sonoma) and the bug seems to reproduce only on macOS 14 Sonoma. The Safari App Extension behaves as expected on previous macOS versions, with no suspect error logs. Does anyone know what this issue is about?
3
0
332
2w
Unable to access related file in QuickLook Thumbnail Extension and QuickLook Preview Extension
Hi, I am developing QuickLook Thumbnail Extension and QuickLook Preview Extension which work with embroidery files. To prepare the view, I need to access stitches from the "stitch" file (supplied to my extension by system) and also to read the "colors" from related file (i.e. the file with different extension, but the same filename as "stitch" file). The embrodery is located stored in 2 files: squirrel.dst (stitchs) and squirrel.edr (colors). Is it even possible to extend sandbox in extensions for this task? I have tried to ask user to select folder in main.app (NSOpenPanel), create security-scoped Bookmark in main.app and access it from extension. However, this is not working - in the extension it is not possible to resolve the bookmark created in main.app. I have also tried to use mechanism for accessing related files as shown at https://developer.apple.com/documentation/security/app_sandbox/protecting_user_data_with_app_sandbox, using NSFilePresenter/NSFileCoordinator. It works in main.app, but doesn't work in QuickLook Thumbnail Extension and QuickLook Preview Extension. Is there any mechanism on Mac which would allow me to access more than the "supplied" file URL in QuickLook Thumbnail Extension and QuickLook Preview Extension? Ladislav
0
0
145
3w
Notification Service Extension restrictions
I have an iOS app which uses Notification Service Extension (NSE) to process incoming notifications before it displayed to user. In NSE, as part of initialization of my app, I need to iterate through a 2D array. There are roughly 65k iterations. I've noticed that this iteration fails somewhere in between and the NSE process crashes... I can say it crashes because the logs stopped in between the iterations. This results in 'unmodified notification' getting displayed immediately, whereas NSE is granted 30 sec of background execution. My question is, why does this happen? The above iteration of 2D array works in app, but fails in NSE. Is there some kind of restriction on background extensions? - the documentation only talks about a time limit of 30sec. If there is some kind of restriction (like CPU and memory), how does one know this and code for it... since Apple did not provide any documentation. Or perhaps, there is a completely different reason?
3
1
250
3w
Crash in Widget extension
Hi everyone! I'm seeking help to understand crashes that, as I can see, come from the widget extension. The brief stack trace that I can see under Xcode -> Window -> Organizer -> [My App] -> Crashes is pretty short (see attachment). My widgets do fetch request to Core Data, but the operation is performed on the background thread and data is lightweight. I have been debugging for days, but haven't found any weak code blocks that might take too much memory or crash due to simple language issues. Will appreciate any help! In the crash report file, I see the following logs (highlight a few of them due to lines limit): Incident Identifier: 62A28083-43EE-47F2-A2E0-89A1FA89744A Hardware Model: iPhone13,2 Process: MyAppWidgetsExtension [28359] Identifier: MyAppWidgets Version: 2.16.0 (290) OS Version: iPhone OS 17.4.1 (21E236) Exception Type: EXC_CRASH (SIGKILL) Termination Reason: RUNNINGBOARD 0xdead10cc Thread 0 Crashed: 0 libsystem_kernel.dylib 0x00000001e05c5af8 mach_msg2_trap + 8 (:-1) 1 libsystem_kernel.dylib 0x00000001e05c5890 mach_msg2_internal + 80 (mach_msg.c:201) 2 libsystem_kernel.dylib 0x00000001e05c57a8 mach_msg_overwrite + 436 (mach_msg.c:0) 3 libsystem_kernel.dylib 0x00000001e05c55e8 mach_msg + 24 (mach_msg.c:323) 4 CoreFoundation 0x00000001980a001c __CFRunLoopServiceMachPort + 160 (CFRunLoop.c:2624) 5 CoreFoundation 0x000000019809df04 __CFRunLoopRun + 1208 (CFRunLoop.c:3007) 6 CoreFoundation 0x000000019809d968 CFRunLoopRunSpecific + 608 (CFRunLoop.c:3420) 7 Foundation 0x0000000196f2c4a8 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 212 (NSRunLoop.m:373) 8 Foundation 0x0000000196f2aff0 -[NSRunLoop(NSRunLoop) run] + 64 (NSRunLoop.m:398) 9 libxpc.dylib 0x00000001f40aa26c _xpc_objc_main + 336 (main.m:267) 10 libxpc.dylib 0x00000001f40ac7e4 _xpc_main + 64 (init.c:1294) 11 libxpc.dylib 0x00000001f40ac7a4 xpc_bs_main + 16 (init.c:1310) 12 BoardServices 0x00000001b0d38240 +[BSServicesConfiguration activateXPCService] + 68 (BSServicesConfiguration.m:113) 13 ExtensionFoundation 0x00000001a70bbdf0 -[_EXRunningExtension resume] + 260 (EXRunningExtension.m:298) 14 ExtensionFoundation 0x00000001a70bbc38 -[_EXRunningExtension startWithArguments:count:] + 396 (EXRunningExtension.m:269) 15 ExtensionFoundation 0x00000001a70cfa30 EXExtensionMain + 220 (EXExtensionMain.m:34) 16 Foundation 0x0000000197665ed4 NSExtensionMain + 204 (NSExtensionMain.m:21) 17 dyld 0x00000001bb5bed84 start + 2240 (dyldMain.cpp:1298) Thread 2: 0 libsystem_kernel.dylib 0x00000001e05d381c guarded_pwrite_np + 8 (:-1) 1 libsqlite3.dylib 0x00000001c1ddc158 seekAndWrite + 456 (sqlite3.c:44255) 2 libsqlite3.dylib 0x00000001c1d95908 unixWrite + 180 (sqlite3.c:44333) 3 libsqlite3.dylib 0x00000001c1de4574 pagerWalFrames + 868 (sqlite3.c:66940) 4 libsqlite3.dylib 0x00000001c1d95628 sqlite3PagerCommitPhaseOne + 316 (sqlite3.c:70256) 5 libsqlite3.dylib 0x00000001c1d85d7c sqlite3BtreeCommitPhaseOne + 172 (sqlite3.c:80934) 6 libsqlite3.dylib 0x00000001c1d85944 vdbeCommit + 1136 (sqlite3.c:93952) 7 libsqlite3.dylib 0x00000001c1d5ec74 sqlite3VdbeHalt + 1352 (sqlite3.c:94362) 8 libsqlite3.dylib 0x00000001c1d7fd04 sqlite3VdbeExec + 42952 (sqlite3.c:103728) 9 libsqlite3.dylib 0x00000001c1d74c80 sqlite3_step + 964 (sqlite3.c:97699) 10 CoreData 0x00000001a01ba0e0 _execute + 128 (NSSQLiteConnection.m:4573) 11 CoreData 0x00000001a01e5510 -[NSSQLiteConnection commitTransaction] + 596 (NSSQLiteConnection.m:3250) 12 CoreData 0x00000001a040aac0 _executeBatchUpdateRequest + 1216 (NSSQLCore_Functions.m:1110) 13 CoreData 0x00000001a030a240 -[NSSQLBatchUpdateRequestContext executeRequestCore:] + 32 (NSSQLBatchUpdateRequestContext.m:88) 14 CoreData 0x00000001a01c8508 -[NSSQLStoreRequestContext executeRequestUsingConnection:] + 252 (NSSQLStoreRequestContext.m:183) 15 CoreData 0x00000001a01c82b4 __52-[NSSQLDefaultConnectionManager handleStoreRequest:]_block_invoke + 60 (NSSQLConnectionManager.m:302) 16 CoreData 0x00000001a01c81ec __37-[NSSQLiteConnection performAndWait:]_block_invoke + 48 (NSSQLiteConnection.m:733) 17 libdispatch.dylib 0x000000019ff66dd4 _dispatch_client_callout + 20 (object.m:576) 18 libdispatch.dylib 0x000000019ff762c4 _dispatch_lane_barrier_sync_invoke_and_complete + 56 (queue.c:1100) 19 CoreData 0x00000001a01de8d0 -[NSSQLiteConnection performAndWait:] + 176 (NSSQLiteConnection.m:730) 20 CoreData 0x00000001a019d094 -[NSSQLDefaultConnectionManager handleStoreRequest:] + 248 (NSSQLConnectionManager.m:297) 21 CoreData 0x00000001a019cf64 -[NSSQLCoreDispatchManager routeStoreRequest:] + 228 (NSSQLCoreDispatchManager.m:60) 22 CoreData 0x00000001a019cd68 -[NSSQLCore dispatchRequest:withRetries:] + 172 (NSSQLCore.m:3975) 23 CoreData 0x00000001a01bc034 -[NSSQLCore executeRequest:withContext:error:] + 1208 (NSSQLCore.m:2951) 24 CoreData 0x00000001a01d06a0 __65-[NSPersistentStoreCoordinator executeRequest:withContext:error:]_block_invoke.541 + 4156 (NSPersistentStoreCoordinator.m:2994) 25 CoreData 0x00000001a01cf57c -[NSPersistentStoreCoordinator _routeHeavyweightBlock:] + 264 (NSPersistentStoreCoordinator.m:641) 26 CoreData 0x00000001a01abc48 -[NSPersistentStoreCoordinator executeRequest:withContext:error:] + 1048 (NSPersistentStoreCoordinator.m:2768) 27 CoreData 0x00000001a018bbdc -[NSManagedObjectContext executeRequest:error:] + 700 (NSManagedObjectContext.m:2044) 28 CoreData 0x00000001a0265be8 __116+[NSCKRecordMetadata batchUpdateMetadataMatchingEntityIdsAndPKs:withUpdates:inStore:withManagedObjectContext:error:]_block_invoke + 128 (NSCKRecordMetadata.m:744) 29 CoreFoundation 0x000000019806dfb4 __NSDICTIONARY_IS_CALLING_OUT_TO_A_BLOCK__ + 24 (NSDictionaryHelpers.m:10) 30 CoreFoundation 0x000000019806de2c -[__NSDictionaryM enumerateKeysAndObjectsWithOptions:usingBlock:] + 288 (NSDictionaryM.m:271) 31 CoreData 0x00000001a0265970 +[NSCKRecordMetadata batchUpdateMetadataMatchingEntityIdsAndPKs:
4
0
297
1w
NEFilterManager completion handler not called from Command Line Tool
Hello, I'm experiencing an issue with enabling a Content Filter Network Extension from a command line tool. When I call the LoadFromPreferences method on NEFilterManager.shared() the completion handler is not called. I've tried this with a simple semaphore and tried running it on a RunLoop, but none of this works. Any help would be appreciated. I've tried adding a small demo project illustrating the issue, but the add file option does not seem to work. I'll paste the code here: Semaphore Demo class SemaphoreDemo { let filterManager = NEFilterManager.shared() var semaphore = DispatchSemaphore(value: 0) func demo() { print("Semaphore demo") self.filterManager.loadFromPreferences { (error) in print("Load from preferences callback") if let error = error { print("ERROR \(error.localizedDescription)") return } let config = NEFilterProviderConfiguration() config.filterDataProviderBundleIdentifier = "BUNDLE_IDENTIFIER" config.filterSockets = true self.filterManager.isEnabled = true self.filterManager.localizedDescription = "LOCALIZED_DESCRIPTION" self.filterManager.providerConfiguration = config self.filterManager.saveToPreferences { (error) in if let error = error { print("ERROR \(error.localizedDescription)") } else { print("SUCCESS") } self.semaphore.signal() } } self.semaphore.wait() } } class RunloopDemo { let filterManager = NEFilterManager.shared() func demo() { print("Runloop demo") let currentRunLoop = CFRunLoopGetCurrent() // let currentRunLoop = CFRunLoopGetMain() self.filterManager.loadFromPreferences { [weak currentRunLoop] (error) in print("Load from preferences callback") if let error = error { print("ERROR \(error.localizedDescription)") return } let config = NEFilterProviderConfiguration() config.filterDataProviderBundleIdentifier = "Bundle IDENTIFIER" config.filterSockets = true self.filterManager.isEnabled = true self.filterManager.localizedDescription = "LOCALIZED DESCRIPTION" self.filterManager.providerConfiguration = config self.filterManager.saveToPreferences { (error) in if let error = error { print("ERROR \(error.localizedDescription)") } else { print("SUCCESS") } CFRunLoopStop(currentRunLoop) } } CFRunLoopRun() } } The callback is never called. Thanks.
3
0
223
3w
How to stop Finder from triggering full file download of a file on network share to generate the thumbnail
Default behaviour of the macOS when interacting via Finder with a network share is to create thumbnails to provide a nice user experience. This behaviour is implemented by QuickLook framework. This triggers the full file download and quickly lead to cache using large disk space and even cache trashing. We can disable QuickLook selectively by injecting specially prepared .DS_Store file with instruction/setup to disable thumbnails in that directory but still degrades user's experience only in the network share ecosystem. Is there any way we can provide our own thumbnails or ask Finder to not download full file to generate the thumbnail?
1
0
256
3w
WWDC Lab feedback
I am writing to follow up with my lab in WWDC24. I had 1:1 lab with Mr. Kavin, we had good 30 minutes lab and for follow up questions Kavin asked me to post it using feedback. Following is my questin: We have screenshare in our application and trying to use CFMessagePort for passing CVPixelBufferRef from broadcast extension to Applicaiton. Questions: How to copy planes of IOSurface backed CVPixelBufferRef onto another one without using memcpy, is there a zero-copy method? How to get notified when an IOSurface backed CVPixelBufferRef data get changed by another process. How to send an IOSurface backed CVPixelBufferRef from Broadcast Extension to application. How to pass unowned IOSurfaceRef from the Broadcast Extension to appliction.
0
1
200
Jun ’24