Extensions

RSS for tag

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

Posts under Extensions tag

188 Posts
Sort by:
Post not yet marked as solved
1 Replies
133 Views
I have an iOS SwiftUI app which uses some extensions like NotificationServiceExtension, NotificationContentExtension, WidgetExtension etc. I noticed that each extension uses its own process and has its own bundle with the .appex extension... and is packaged within the app bundle, with .app extension. In my case, most of my logic is in C++ and when the app starts up, it needs to 'startup' the C++ layer. Now, in WidgetExtension, if it's going to read data from disk and update its interface, I need to initialise my C++ layer first. The same can be said for NotificationServiceExtension. This is leading me to include all my C++ artefacts into the extension target as well. Here's my problem: If the size of my app (containing all my C++ artefacts) is 10MB and I'm using 20 extensions (say), the final size of the shipped app bundle is 10MB + (20 * 10MB) = 210MB, since extension bundle (.appex) is packaged within the app bundle (.app). Since the app and the extensions are using the same C++ artefacts, I was hoping to have one binary in the bundle. The app and its extensions will point to this binary. When the app is launched, the app entry point (struct conforming to App protocol) is invoked, in case of widget, the widget entry point (WidgetBundle) is invoked and so on for each extension. This will reduce the final size of the app bundle. Is it possible to have one binary and the app target, all extension targets would use this binary for there functioning?
Posted
by
Post not yet marked as solved
1 Replies
108 Views
I created Keyboard extension and calling an api in it. Api is successfully called when i run the extension on iOS Simulator’s. But when i run the extension on iOS device Extension in loaded successfully but Api call is getting failed with error mentioned below. 2024-05-10 16:23:44.931827+0500 CustomKeyboardExtention[4073:48324] dnssd_clientstub ConnectToServer: connect() failed path:/var/run/mDNSResponder Socket:11 Err:-1 Errno:1 Operation not permitted 2024-05-10 16:23:44.932654+0500 CustomKeyboardExtention[4073:48324] [connection] nw_resolver_create_dns_service_locked [C1] DNSServiceCreateDelegateConnection failed: ServiceNotRunning(-65563) 2024-05-10 16:23:44.935914+0500 CustomKeyboardExtention[4073:48324] Connection 1: received failure notification 2024-05-10 16:23:44.936849+0500 CustomKeyboardExtention[4073:48324] Connection 1: failed to connect 10:-72000, reason -1 2024-05-10 16:23:44.937747+0500 CustomKeyboardExtention[4073:48324] Connection 1: encountered error(10:-72000) 2024-05-10 16:23:44.942682+0500 CustomKeyboardExtention[4073:48324] Task .<1> HTTP load failed, 0/0 bytes (error code: -1003 [10:-72000]) 2024-05-10 16:23:44.949787+0500 CustomKeyboardExtention[4073:48324] Task .<1> finished with error [-1003] Error Domain=NSURLErrorDomain Code=-1003 "A server with the specified hostname could not be found." UserInfo={_kCFStreamErrorCodeKey=-72000, NSUnderlyingError=0x283aa35a0 {Error Domain=kCFErrorDomainCFNetwork Code=-1003 "(null)" UserInfo={_NSURLErrorNWPathKey=satisfied (Path is satisfied), interface: en0, ipv4, dns, _kCFStreamErrorCodeKey=-72000, _kCFStreamErrorDomainKey=10}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask .<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=( "LocalDataTask .<1>" ), NSLocalizedDescription=A server with the specified hostname could not be found., NSErrorFailingURLStringKey=https://chatbotsf-vzt2zxsi7q-uc.a.run.app/chatbot/, NSErrorFailingURLKey=https://chatbotsf-vzt2zxsi7q-uc.a.run.app/chatbot/, _kCFStreamErrorDomainKey=10} Error fetching data: URLSessionTask failed with error: A server with the specified hostname could not be found.
Posted
by
Post not yet marked as solved
0 Replies
129 Views
Hello, technical friends, I am developing a custom keyboard extension, currently encountered a technical difficulty, almost asked AI and Google have not solved my problem. 

 Problem description: 
 When my App was first installed, I opened Settings from the App, enabled full access, and crashed when I returned to the App. Run the App for the second time, open the Settings from the App, update the full access permission, and automatically re-run the App after returning to the App, and then the third, fourth, and NTH times will not crash. 

 Seems like ios will kill host apps for custom keyboard extensions after full access is updated? I want my App installed for the first time to update full access to return App without crashing, but don't know how to fix this problem. I look forward to the technical experts working in Apple development to help me provide relevant technical methods and ideas so that I can solve this problem. Thank you very much! When tracing debugging in xcode, after the App forces exit, the console prompts: Message from debugger: Terminated due to signal 9 When I was monitoring CPU and memory usage, it was very low and I didn't see anything unusual.
Posted
by
Post not yet marked as solved
1 Replies
183 Views
Calling SKAction.follow(..) causes my SKSpriteNode to rotate 90 degrees CW and not stay horizontal as it follows my UIBezierPath? I have this code (within my GameViewController Class) which implements the following of a SKSpriteNode along a UIBezierPath. ===== Please note that a brilliant contributor solved the above challenge by creating a new Class, e.g., class NewClass: NSObject. Nevertheless, I need the solution to appear in an extension of my GameViewController ===== func createTrainPath() { trackRect = CGRect(x: tracksPosX - tracksWidth/2, y: tracksPosY, width: tracksWidth, height: tracksHeight) trainPath = UIBezierPath(ovalIn: trackRect) } // createTrainPath func startFollowTrainPath() { var trainAction = SKAction.follow( trainPath.cgPath, asOffset: false, orientToPath: true, speed: theSpeed) trainAction = SKAction.repeatForever(trainAction) myTrain.run(trainAction, withKey: runTrainKey) } // startFollowTrainPath func stopFollowTrainPath() { guard myTrain == nil else { myTrain.removeAction(forKey: runTrainKey) savedTrainPosition = getPositionFor(myTrain, orPath: trainPath) return } } // stopFollowTrainPath
Posted
by
Post not yet marked as solved
0 Replies
246 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
Post not yet marked as solved
2 Replies
172 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
Post not yet marked as solved
0 Replies
130 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
Post not yet marked as solved
0 Replies
211 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
Post marked as solved
2 Replies
226 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
by
Post not yet marked as solved
0 Replies
194 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
by
Post not yet marked as solved
0 Replies
299 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
Post not yet marked as solved
0 Replies
245 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
Post not yet marked as solved
10 Replies
953 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
Post not yet marked as solved
1 Replies
226 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
by
Post not yet marked as solved
0 Replies
182 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