Extensions

RSS for tag

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

Posts under Extensions tag

191 Posts
Sort by:
Post not yet marked as solved
2 Replies
723 Views
Hello, I am currently facing an issue with my iOS app and its associated Preview extension. I am trying to save a file to a shared container using App Groups, so that my main app can read the file. The code works perfectly on the iOS simulator, but when I run the app on a physical device I encounter a "You don't have permission to save the file" error. Here's the relevant code snippet: let appGroupIdentifier = "group.com.yourcompany.yourapp" func saveDataToSharedContainer(fileName: String, data: Data) -> Bool { guard let containerURL = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: appGroupIdentifier) else { print("Error: Unable to access the shared container.") return false } let fileURL = containerURL.appendingPathComponent(fileName) do { try data.write(to: fileURL, options: .atomic) print("Data saved to shared container successfully.") return true } catch { print("Error: Unable to save data to shared container. \(error)") return false } } I have already verified the following: App Groups capability is enabled for both the main app target and the extension target. The App Group identifier is consistent in both the main app target and the extension target, as well as in the Swift code. Provisioning profiles and signing certificates are up-to-date, and the issue persists after cleaning the project and resetting the provisioning profiles. Despite trying these steps, the issue remains unresolved. This error is reproducible in a new project with a Preview extension. I would greatly appreciate any insights or suggestions from the community to help me resolve this issue. Thank you in advance!
Posted Last updated
.
Post not yet marked as solved
0 Replies
127 Views
Our keyboard extension can be accessed independently in China region with native app like Notes or Safari, however the keyboard can only be opened in the app under same project in Taiwan region. I've checked some articles about how MDM managing extensions, also make sure our RequestOpenAccess option of keyboard extension info.plist also set to Yes. I'm not sure is there anything I missed, or I just need to inform client that they need to reach out their MDM manager and modify some restrictions? If keyboard supports mobile device management (MDM), it can work with managed apps. App extensions give third-party developers a way to provide functionality to other apps or even to key systems built into the operating systems Allow full access to custom keyboard in iOS
Posted
by Rimbaud.
Last updated
.
Post not yet marked as solved
1 Replies
83 Views
Hi, in my Extension FilterDataProvider class that is inherited from NEFilterDataProvider i am trying to insert logs into my CoreData entity, but when i insert it gives me error "NSCocoaErrorDomain: -513 "reason": Unable to write to file opened Readonly Any suggestions please to update the read write permission i already have tried this way but no luck let description = NSPersistentStoreDescription(url: storeURL) description.shouldInferMappingModelAutomatically = true description.shouldMigrateStoreAutomatically = true description.setOption(false as NSNumber, forKey: NSReadOnlyPersistentStoreOption) ?
Posted
by mabubakar.
Last updated
.
Post not yet marked as solved
0 Replies
65 Views
I'm using core data in app, widget extension and intent, but I found the data is not updated between targets. such as I added a new record in app, the widget is not updated unless remove the widget and re-add it. I added a new record in intent, the data in app is not updated unless I run the app again. I have set container.viewContext.automaticallyMergesChangesFromParent = true but it doesn't work. So how can I make the data is updated no matter it is modified any targets.
Posted
by WWWang.
Last updated
.
Post not yet marked as solved
8 Replies
622 Views
Since updating to iOS v17.4.1 our safari extension no longer functions as it used to We are experiencing issues where our content script is not getting initialized, On devices running iOS 17.4.1, the content script included in our extension does not appear to run. There are no logs from the content script in the console, whereas on other versions and devices, it operates as expected. Our Extension relies con communication between the background and content scripts in order for us to render various popups to our users, based on our logs as of iOS 17.4.1 this communication is not successful, we can see messages being sent from the background script but as mentioned above nothing on the content script side. This behavior happens majority of the time and on random sites, sometimes opening the same site in a new tab would work but not always. There are also times where we would only receive our popups after opening the safari menu and interacting with our extension via this menu. Please assist with a way forward
Posted Last updated
.
Post marked as solved
2 Replies
163 Views
https://developer.apple.com/documentation/xcodekit/creating_a_source_editor_extension I created new MacOS project and added a Xcode Source Editor Extension target to the project. I run the extension in debug mode with extension target, but the extension is not show up in Editor menu debug mode Xcode. Xcode version is 15.3(released) MacOS version is 14.4.1 Sonoma
Posted Last updated
.
Post not yet marked as solved
0 Replies
135 Views
Both view and modifier versions of the FamilyActivityPicker crash randomly when selecting some items (usually the other option) throwing these in the console: [com.apple.FamilyControls.ActivityPickerExtension(1150.1)] Connection to plugin invalidated while in use AX Lookup problem - errorCode:1100 error:Permission denied portName:'com.apple.iphone.axserver' PID:22091 ( 0 AXRuntime 0x00000001c603b0fc _AXGetPortFromCache + 800 1 AXRuntime 0x00000001c603cce0 AXUIElementPerformFencedActionWithValue + 700 2 UIKit 0x0000000230de3ec8 DDE6E0C5-2AC3-3C73-8CFE-BC88DE35BB5F + 1453768 3 libdispatch.dylib 0x0000000103ef0b98 _dispatch_call_block_and_release + 32 4 libdispatch.dylib 0x0000000103ef27bc _dispatch_client_callout + 20 5 libdispatch.dylib 0x0000000103efa66c _dispatch_lane_serial_drain + 832 6 libdispatch.dylib 0x0000000103efb408 _dispatch_lane_invoke + 408 7 libdispatch.dylib 0x0000000103f08404 _dispatch_root_queue_drain_deferred_wlh + 328 8 libdispatch.dylib 0x0000000103f07a38 _dispatch_workloop_worker_thread + 444 9 libsystem_pthread.dylib 0x00000001f0824f20 _pthread_wqthread + 288 10 libsystem_pthread.dylib 0x00000001f0824fc0 start_wqthread + 8 ) This also happens in production apps like the Opal. The questions are: At least how to detect it to be able to manually reload the sheet (like what Opal does and shows an alert when this happens) How to prevent it in the first place? I really appreciate any help you can provide.
Posted
by s.mojtaba.
Last updated
.
Post not yet marked as solved
0 Replies
134 Views
There is an inconsistent issue when views are rendered from the Device Activity Report Extension. This issue is noticeable only on release versions and it works fine in debug mode. Around 80% of the times, the Report Views return blank screen and this is only the case when a weekly/monthly filter is used. Although, it works as expected for daily report views. My questions are: How are all the Report Activity Views working fine in debug mode but not in release mode? How the daily activity filter works fine in the release mode but the weekly/monthly filters don't work? Is this because of a memory limit issue in the extension? As of now, I have the family-controls(distribution) entitlement only for the app and for the extensions I only have family-controls(development) entitlement. Do I need to request for family-controls(Distribution) entitlement even for the extensions? I have seen threads on the forum mentioning the blank screen issue associated with the DeviceActivityReport but haven't found a solution to it. Any suggestions/feedback would be of great help, thanks.
Posted Last updated
.
Post not yet marked as solved
1 Replies
623 Views
Our app uses DeviceActivityReport to display the user’s screen time. The performance of DeviceActivityReport is often very poor. These issue occur commonly: Screen time is reported as 0 minutes DeviceActivityReport View appears completely blank The host app loses connection with the DeviceActivityReport altogether I have implemented several workarounds which only slightly improve the performance, to varying degrees depending on the device iOS: Inside the DeviceActivityReport code - retry fetching screen time data until it returns a non-zero result Implement a “refresh” button which reloads the DeviceActivityReport view from the host app However, due to the sandboxed nature of DeviceActivityReport, there is no way for the host application to tell if the DeviceActivityReport extension is experiencing these performance issues. It results in a really bad user experience. I am building the app with Xcode 14 due to another issue where DeviceActivityReport fails to load for all iOS 16 devices when built with Xcode 15 (this is a know issue, here’s a link to a discussion on the developer forums: https://developer.apple.com/forums/thread/735915). However, when testing on iOS 17 devices with Xcode 15 builds, the above issues still occur. I have received no crash reports from DeviceActivityReport. These issues are known bugs and have been discussed on the developer forums, but I haven't yet seen a solution. Other screen time apps exist that use the DeviceActivityReport seemingly flawlessly, so I know that there is a way to improve the performance of DeviceActivityReport in my app. Please help! I have been dealing with this poor performance for a long time now with almost no improvement!
Posted Last updated
.
Post not yet marked as solved
2 Replies
849 Views
There have been several posts (i.e. here, here) about the lagginess of the DeviceActivityReport extension. Often it takes a few seconds for the view to load, or sometimes doesn't show up at all. I've confirmed this is not a case of excessive memory usage in the extension (exceeding 100MB), because I've profiled the extension and it consistently maxes out at 10MB. I've placed a loading screen behind the DeviceActivityReport inside a ZStack in the host app in order to see if the lag is because it takes some time for the extension to spin up - but the loading screen does not appear, indicating that the extension is running right away, but receiving the view from the extension in the host app is where the lag happens. It's been extremely difficult to debug because the lag only occurs a fraction of the time, and DeviceActivityReport is pretty much a black box. There's no documentation about how the host app and extension actually communicate. I've also combed through the logs using the Console app on Mac with no indication of any issues, (but I do see the message "Connection to view service was invalidated" coming from the extension even when there is no lag). I'm pretty convinced that the problem lies in the host app, because when I strip everything away from the host app, DeviceActivityReport never lags. I suspect that there are processes running (network requests, async tasks, or state updates) that block the report view from being received in the host app. Could you please help me understand why this could be happening, with as many details as you could provide? Any details on how the host and extension communicate, what processes could block the view from appearing, or anything else. Seems like this is a common issue but plenty of apps also don't experience it. Any guidance you can provide would be extremely helpful, as I've been trying to fix this bug every since I've been working with this API with no luck. Thanks in advance!
Posted Last updated
.
Post not yet marked as solved
0 Replies
255 Views
I created a new iOS app with a keyboard extension. I added a UITextView to it, but when I tap on it, it crashes somewhere in outside of my code. This is pretty much the keyboard extension template with the UITextView added: (In KeyboardViewController):         super.viewDidLoad()                  // Perform custom UI setup here         self.nextKeyboardButton = UIButton(type: .system)                  self.nextKeyboardButton.setTitle(NSLocalizedString("Next Keyboard", comment: "Title for 'Next Keyboard' button"), for: [])         self.nextKeyboardButton.sizeToFit()         self.nextKeyboardButton.translatesAutoresizingMaskIntoConstraints = false                  self.nextKeyboardButton.addTarget(self, action: #selector(handleInputModeList(from:with:)), for: .allTouchEvents)                 self.view.addSubview(self.nextKeyboardButton)                  self.nextKeyboardButton.leftAnchor.constraint(equalTo: self.view.leftAnchor).isActive = true         self.nextKeyboardButton.bottomAnchor.constraint(equalTo: self.view.bottomAnchor).isActive = true                  self.textView = UITextView(frame: .zero)         guard let textView = self.textView else { return }                  textView.attributedText = NSAttributedString(string: "test keyboard")         textView.translatesAutoresizingMaskIntoConstraints = false         textView.layer.borderColor = UIColor.blue.cgColor         textView.layer.borderWidth = 2                  view.addSubview(textView)                  NSLayoutConstraint.activate([             textView.topAnchor.constraint(equalTo: view.topAnchor, constant: 10),             textView.bottomAnchor.constraint(equalTo: view.bottomAnchor, constant: 10),             textView.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 10),             textView.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: 10),         ])     } What’s interesting is that in my actual app, the same code works as long as Full Access is granted for the keyboard. From what I understand, UITextViews should work even if Full Access isn’t granted. Has anyone had any experience with putting a UITextView into a keyboard extension not running with Ful Access?
Posted
by leftspin.
Last updated
.
Post not yet marked as solved
0 Replies
165 Views
My how things have changed! Right? I cannot even describe how much time and effort my copilot has saved me. I code with the Mac version of VSCode and have been using Pieces for Developer's - a free plugin from the VSCode Marketplace. Talk about blown away. I've used ChatGPT for a year in my browser, even GitHub Copilot, Tabnine, Cody and others... but having the Pieces copilot integrated into my editor as well as my entire toolchain has been insane. On top of that, the Pieces Desktop (https://pieces.app/) that comes with the plugin is free too and does absolute magical things for my workflow. My work is transformed because my copilot is like my own employee that does my work for me in a fraction of time. Looking to hear what copilot experiences you are enjoying. Reply with a link to what you are using. If it's better than Pieces Copilot then I'll be retiring soon! Rich
Posted
by Rknott33.
Last updated
.
Post not yet marked as solved
1 Replies
178 Views
The devs really hate this things, but as a project manager I need to know the time estimates. So in development favour I really want to know the time estimate to setup and XCode project, considering project as an average case (includes complexity). So I can really know hpow much time do they actually take or they are just giving over estimates.
Posted Last updated
.
Post not yet marked as solved
0 Replies
141 Views
when i was develop ShareExtension, and I donate a intent to share suggestion, and it appeared on my share sheet, but I launched the ShareExtension by clicked icon in suggestion list. and i executed the following code in my project, i got nil of intent. and extensionContext is not nil. '''self.extensionContext.intent''' I would greatly appreciate some insight of what could be possible going wrong here. Thanks in advance!
Posted
by GuidoPu.
Last updated
.
Post not yet marked as solved
15 Replies
1.1k Views
I am developing a Mac app which provides a Credential Provider extension and I'm having trouble with passkey integration. I wrote here about the issue I'm having with the iOS app. On the Mac I'm experiencing a different issue. As opposed to the iOS app (where I'm not even able to use my extension to create a new passkey in the first place) on the Mac I'm able to use my extension to create a passkey. I save the credential identity into the system AutoFill suggestions store without error. The problem is that when I attempt to authenticate on the same site the system does not offer my app's credential as a suggestion. Standard passwords are working fine. Can anyone help me understand how I can troubleshoot this type of problem? Thanks! -Jeremy
Posted Last updated
.
Post not yet marked as solved
0 Replies
236 Views
My Safari Web Extension app for iOS sometimes exhibits an issue where the request to SafariWebExtensionHandler sometimes doesn't return. This never happens on the simulator, and never happens when I'm actively debugging the SafariWebExtensionHandler process. It only happens on a physical device, and it only happens about 5% of the time. Note that the request happens RIGHT when the page loads (document_start), so I wonder if there's some kind of race condition happening, or a bug in iOS. No errors are thrown, and I've pared back the logic to be extremely simple, and I still see the issue persist. I'm PRETTY sure it's the SafariWebExtensionHandler because I've tested bypassing it completely (returning a dummy response from background.js), and when I do, the issue never happens. I've seen this issue posted before:, but without a resolution. SafariWebExtensionHandler.m?: - (void)beginRequestWithExtensionContext:(NSExtensionContext *)context { NSExtensionItem *response = [[NSExtensionItem alloc] init]; response.userInfo = @{ SFExtensionMessageKey: @{ @"op2": @(YES), @"op3": @(YES), @"op4": @(YES), @"op5": @(YES), @"op6":@(YES), @"op1": @(NO) } }; [context completeRequestReturningItems:@[ response ] completionHandler:nil]; } background.js (removed proprietary logic so excuse syntax errors): browser.runtime.onMessage.addListener((request, sender, sendResponse) => { console.log("Received request: ", request); if (request.action === "getUserSettings") { var payload = JSON.stringify({cmd: "getUserSettings"}); sendMessageToNative(payload, async function(response) { sendResponse(response); }); return true; } return true; }); content.js browser.runtime.sendMessage({ action: "getUserSettings" }).then((response) => { ... }); I've worked around this by waiting for a few seconds and then resending the request if I never got a response (and this workaround works!), but this results in a bad UX. So, does anyone have any tips, pointers, etc?
Posted Last updated
.