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

Problems with multi-platform apps using app groups on macOS 15
This post is in response to the information on app groups posted here: https://developer.apple.com/forums/thread/721701 I have a multi-platform (macOS and iOS) app that uses an app group to store the Core Data database, so that extensions and widgets can also access the database. It seems to be impossible to add an app group in Xcode that doesn't start with group.. When I use the team identifier as detailed here , Xcode prepends group. to the app group identifier. So far, I've simply been using an app group identifier that looks like this: group.com.example.MyAppName. This has worked on macOS and iOS. However, I noticed that when the app launches on macOS 15, the user is shown a dialog that says " would like to access data from other apps." If the user selects "Don't Allow", the app will crash, since it can't access the Core Data database located in the app group directory. How can I work around this, considering that this is a multi-platform app, and both the iOS and macOS versions need to store the Core Data database in the app group directory? What is the proper way to configure app groups for multi-platform apps?
7
3
771
Sep ’24
How does OpenIntent in a control widget actually open the app to the target feature?
I want to add a Control Center widget for my app that will open the app to a particular feature. I'm looking at the "Open your app with a control" example here, which seems like exactly what I want: Set your control’s action to an app intent that conforms to OpenIntent to open your app when someone uses a control. Using OpenIntent allows you to take someone to a specific area of your app when a control performs its action. The example doesn't show exactly how to hook up the LaunchAppIntent to a control widget, but I'm guessing it's something like this: @available(iOS 18.0, *) struct OpenFeatureControl : ControlWidget { var body: some ControlWidgetConfiguration { StaticControlConfiguration(kind: "com.example.OpenFeature") { ControlWidgetButton(action: LaunchAppIntent()) { Image(systemName: "book") } } .displayName("Launch Feature") } } But there's one critical piece missing here: how is the target feature actually opened? My initial assumption would have been that once the app launches or resumes, there's a call to some method like continueUserActivity that has a user-info dict with some key whose value is the LaunchAppEnum. But I've put breakpoints on all those methods in my app and none of them get called (I'm using UIKit scene lifecycle). I also tried a regular AppIntent with a perform method that talks to my app directly: @available(iOS 18.0, *) struct OpenFeatureIntent : AppIntent { static let title: LocalizedStringResource = "Open My Feature" static let opensAppWhenRun: Bool = true init() {} func perform() async throws -> some IntentResult { //MAIN_APP is defined in Active Compilation Conditions in build settings #if MAIN_APP let url = URL(string: "myapp://openfeature")! UrlHandler.instance().handle(url) #endif return .result() } } But when run, this simply does nothing. Launching an app directly to a particular view or feature seems like a common use-case for control widgets, and there are apps doing it, but I can't find an example of how it's supposed to work. And the docs are really not helpful. Can anyone provide the missing piece here? What's the expected plumbing in an OpenIntent that actually launches particular UI in the app?
3
1
688
Sep ’24
Live Caller ID Lookup Extension - No option in phone settings
iOS 18 (22A3354) will not offer a option in settings (> Apps > Phone) after calling openSettings to enable live caller id lookup extension. iPhone and MacBook are in the same network. The PIRService runs on MacBook and is reachable via iPhone Safari (via http://MacBookPro:8080/). Hummingbird print log: hb_method=GET hb_uri=/ [Hummingbird] Request. After deploying the application via Xcode to the iPhone no requests are printed in the terminal. The extension was added like documented and bundle id is also checked multiple times. issuerRequestUri in service-config.json is http://MacBookPro:8080/issue. As far as I can tell, everything has been set up in accordance with the Testing Live Caller ID instructions. Is there something missing?
8
0
534
Sep ’24
About nullAudio AudioObjectPropertySelector custom attributes
1, I saw nullAudio custom properties of the static const AudioObjectPropertySelector kPlugIn_CustomPropertyID = 'PCst'; But I don't know how to use this in a project. 2. What is the difference between PlugIn and Device's custom properties? 3. When I try to customize the PropertySelector for deivce. After adding kAudioObjectPropertyCustomPropertyInfoList NullAudio_HasDeviceProperty method to compile again after restarting coreAudio service, found that virtual devices don't show.
0
0
287
Sep ’24
关于ControlWidget的问题
当我点击控制中心的controlwidget时,本应该打开capture扩展的,但是偶尔会打开主工程,即使我同意了相机权限。 这样,当我打开主工程时,主工程会在启动10s左右被杀死。 我只是在capture扩展中加了保活,难道主工程也要增加保活吗?值得注意的是我们的App不是相机类型的。 The app extension terminates shortly after launch if it doesn’t have an active camera view that uses AVCaptureEventInteraction to handle events from the hardware buttons, or if access to the camera hasn’t been requested.
0
0
217
Sep ’24
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
225
Sep ’24
Signing application with app extensions
We have developed an electron app which we want to extend with an action extension. The action extension is written in swift in Xcode. Our plan was to build the .appex file and insert it into the PlugIns folder in our electron app, but I don't think this is the right way to do it? If we insert the .appex file before notarization then we get an error that we are "replacing existing signature". If we manually insert it after the notarization then we get an error with the app is damaged and can’t be opened. Can anybody provide a procedure for this kind of merge I would imagine that it goes something like: Sign app Sign extension Add extension to App Notarize app For signing the app we use electron-builder.
3
0
463
Sep ’24
Can you limit the number times you share an item with recipients using Share Sheet?
I am looking to use the iOS share sheet in my app where the user can send an invite link to friends, however I want to limit the number of times they can do this. Is it possible to limit the number of recipients who you can share an item using the share sheet, or if there any sort of post-feedback sent from the share sheet back to the app once the share sheet is closed?
0
0
181
Sep ’24
Spotlight App Extension does not persist custom Attributes
We are in the process of updating our legacy Spotlight MDImporter to the new macOS Spotlight App Extension. The transition works well for standard attributes such as title, textContent, and keywords. However, we encounter an issue when adding custom attributes to the CSSearchableItemAttributeSet. These custom attributes are not being persisted, which means they cannot be queried using a Spotlight NSMetadataQuery. Has anyone an idea on how to append custom attributes so that they are included in the indexed file status, as displayed by the shell command mdimport -t -d3 <path> A sample project illustrating the problem is available here: https://www.dropbox.com/scl/fi/t8qg51cr1rpwouxdl900b/2024-09-04-Spotlight-extAttr.zip?rlkey=lg6n9060snw7mrz6jsxfdlnfa&dl=1
1
0
227
Oct ’24
How can I access the download status of an NSFileProviderItem from the File Provider extension?
When capturing materialized information from materializedItemsDidChange in NSFileProviderReplicatedExtension, the isDownloaded property of NSFileProviderItem is not set during the call to enumerate items (NSFileProviderEnumerationObserver:enumerateItems(for:startingAt:)). Both the IsDownloaded and isMostRecentVersionDownloaded properties are returning false, even though the item is fully materialized How to capture this information from file provider extension ? Any help would be greatly appreciated. Thanks!
2
0
391
Sep ’24
Contact Prodvider Extension key 'com.apple.contact.provider.extension' not accepting in Testflight submission
ERROR ITMS-90349: "Invalid Info.plist value. The value of the EXExtensionPointldentifier key, com.apple.contact.provider.extension, in the Info.plist of "MainApp.app/Extensions/ContactProviderExtension.appex" is invalid. We were working on new iOS18 Contacts Provider extension and when try to test the feature in testflight we were unable to submit the build and getting the above error. The extensionPointldentifier 'com.apple.contact.provider.extension' was auto generated by xcode and apple doc mentioned the same value to use for Contacts Provider extension support. But it is not accepting in testflight. https://developer.apple.com/documentation/contactprovider/contactproviderextension Any help will be appreciated.
0
1
454
Sep ’24
NEFilterManager.Grade.firewall is not working with SimpleFirewall sample app
I explored Apple's Filtering Network Traffic sample. I noticed for me, FilterDataProvider's startFilter method is called only when I make filterManager.grade = .inspector before calling filterManager.saveToPreferences. Could someone help why the startFilter is not called when I leave the filterManager's grade property with it's default value. i.e NEFilterManagerGradeFirewall? https://developer.apple.com/documentation/networkextension/filtering_network_traffic
1
0
310
Aug ’24
Apple Books app not showing Share Extension
I'm trying to program an application for learning vocabulary words. I'd like to be able to easily add single words from the Books application using the "Share ..." affordance. However the share extension (and action extension) don't show up in that surface, even with TRUEPREDICATE as the NSExtensionActivationRule. Facebook shows up as a valid target though, so it seems like there's some way to do it. Is Facebook manually approved by Apple/is there any way that I can make this, even if it's not approvable by the App Store?
1
0
326
Aug ’24
Safari Extension load wasm file in popup wrong MIME type error
After loading Safari Web Extension, when making request from the popup to load wasm file it return with wrong MIME type, which makes the WebAssembly compileStreaming to reject the response from fetch. Summary URL: safari-web-extension://ECF91D91-37F4-499D-8D7E-6AA029A2DBED/canvaskit/canvaskit.wasm Status: 200 Source: — Initiator: flutter_bootstrap.js:10:505 Request Accept: / Referer: safari-web-extension://ECF91D91-37F4-499D-8D7E-6AA029A2DBED/index.html User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.0 Safari/605.1.15 Response Access-Control-Allow-Origin: * Content-Length: 6751354 Content-Security-Policy: script-src 'self' 'wasm-unsafe-eval'; object-src 'self'; Content-Type: application/octet-stream In the response the inner server that returns files for safari-web-extension should return application/wasm
2
0
394
Aug ’24
Issue with using openURL in iOS Extensions
I would like to implement a feature in the prepareInterfaceForExtensionConfiguration function of the AutoFillCredentialProvider extension that returns to the main app. Since the extension prohibits the use of openURL from sharedApplication, can I use the openURL function of NSExtensionContext through UIResponder? Would this violate Apple’s regulations? private func openContainerApp() { let scheme = "momoshare://" let url: URL = URL(string: scheme)! let context = NSExtensionContext() context.open(url, completionHandler: nil) var responder = self as UIResponder? let selectorOpenURL = sel_registerName("openURL:") while (responder != nil) { if responder!.responds(to: selectorOpenURL) { responder!.perform(selectorOpenURL, with: url) break } responder = responder?.next } }
0
0
268
Aug ’24
Can My App Use/emulate iPhone as an NFC Tag for Tap-to-Interact with the new update??
Hello, I’m developing an app and want to explore the possibility of using an iPhone to emulate an NFC tag. Specifically, I’m interested in enabling one iPhone to act as an NFC tag that another iPhone can read, creating a tap-to-interact experience within my app. Is this functionality supported by current iOS APIs, or is it something that might be available in the next update for iOS 18.1 which is supposedly unlocking iPhone NFC chips? If not, are there any workarounds or third-party solutions that can achieve this such as bluetooth low energy (BLE) maybe? Any insights or guidance on how to implement this feature would be greatly appreciated. Thank you!
1
0
574
Aug ’24