Extensions

RSS for tag

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

Posts under Extensions tag

186 Posts
Sort by:
Post not yet marked as solved
1 Replies
39 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
43 Views
Hi there, we have an app that is distributed both to the Mac App Store and direct downloads from our homepage. They have different bundle identifiers and a photo project extension: App Store App: com.company.appname-appstore App Store App Extension com.company.appname-appstore.extension Homepage App: com.company.appname Homepage App Extension: com.company.appname.extension We no plan to discontinue the homepage version and want to migrate users' data to the App Store version. For the app itself, this is pretty easy and straight-forward: establish one shared app group in both app copy the data to the group's container tell the user to use the App Store version from now on However, we struggle to do something similar to the projects of the Photos extension. Once the user deletes the homepage version, all existing projects in Photos.app are dead, no other extension can open them (since they are tied to the extension's bundle identifier). We cannot embed both extensions (of the homepage and the App Store version) in the (one and only) App Store version since an extension's bundle identifier must be the embedding's app bundle identifier plus something else which is not the case. Is there any way, an extension would be allowed to read the data of another extension of the same developer (team id) an app could contain an extension that does not share the same bundle identifier prefix (again of the same team) Or any other ideas? Thank you very much
Posted
by danielkbx.
Last updated
.
Post not yet marked as solved
1 Replies
1.1k Views
Hi, We have an iOS app with Safari and Content Blocker extensions. Everything works fine when running the app on M1 devices except for the content blocker. The issue is with the following code: contentBlockerManager.getStateOfContentBlocker(withIdentifier: "...") { [ weak self ] in state, error ... } I receive an error which I believe means the content blocker was not found: SFErrorDomain error 1 Now, when running the exact same app with Mac Catalyst all works as expected. Is there a reason for this to happen? Thanks.
Posted
by Felipewil.
Last updated
.
Post not yet marked as solved
1 Replies
212 Views
I'm testing the tvOS version of the development app (swiftUI), and I need to add the Intents Extension to the target to support Siri intents (INPlayMediaIntent) to play music, this is already working fine in the iOS version of the project and submitted for testing, when I compile and submit Go to App Store Connect, and then there is the following error in the feedback email: ITMS-90898: Invalid Mach-O entry point - Please make sure the build system passes “-e _NSExtensionMain” to the linker for the “MusicPlayer tvOS.app/PlugIns/TVSiriControlAudioExtension.appex” extension bundle, or the extension will not function. My project has Siri enabled, but I don't know what to do now. I tried to delete and re-create the Intents Extension without making any changes to the file, and submitted it directly to App Store Connect, but still prompted this error. Headache
Posted
by ZainW.
Last updated
.
Post not yet marked as solved
0 Replies
175 Views
Does anyone know why only certain Share/Action extensions show up when trying to share a song in Apple Music? I'm trying to get my Share Extension to show up. Does Apple only allow certain apps to share from Apple Music?
Posted
by ironweber.
Last updated
.
Post not yet marked as solved
0 Replies
221 Views
I'm looking for some way to get any "status" from this screen into my app What I'm trying to do? After selecting my app as a "password provider" I want to open the app as an extension, with some "welcome" screen. I know that's possible because I see the same behavior in another application. Could anyone tell me where I can find the necessary info and what API/SDK I need for this? Thanks for your help!
Posted Last updated
.
Post not yet marked as solved
1 Replies
245 Views
I'm using the URLSessionWebSocketTask to open up and transact with a web socket API. This is working fine in my regular iOS app, however, as soon as I open and try to resume the websocket connection in the iOS app extension, I am getting the following error: 2023-03-01 18:04:42.030598-0800 VanGoMessagesExtension[537:19333] Connection not set before response is received, failing task 2023-03-01 18:04:42.031175-0800 VanGoMessagesExtension[537:19333] Task <46A8F9EB-5DD7-4872-B61D-A6D26C1284D8>.<3> finished with error [-1005] Error Domain=NSURLErrorDomain Code=-1005 "The network connection was lost." I'm not seeing anywhere in the documentation that the URLSessionWebSocketTask is not supported for app extensions, however the exact same code works fine for the iOS app. Here is the snippet of the relevant code: let task = URLSession.shared.webSocketTask(with: url) self.task = task // This is the URLSessionWebSocketTask let jsonEncoder = JSONEncoder() let imageQueryBody = ImageQueryBody(user_id: userID, test: !useRealData, prompt: queryTerm, limit: limit) let imageQuery = ImageQuery(action: "getImageRequest", body: imageQueryBody) do { let jsonResultData = try jsonEncoder.encode(imageQuery) guard let jsonString = String(data: jsonResultData, encoding: .utf8) else { assertionFailure("Failed to convert request to JSON string") return } task.send(.string(jsonString)) { [weak self] error in guard let self = self else { return } if let error = error { self.log(.error, "[Request id: \(self.requestID)] Failed to send request message to query API with error: \(error.localizedDescription)") DispatchQueue.main.async { self.task?.cancel(with: .internalServerError, reason: nil) self.onComplete?(.failure(error)) } } } setupReceiveData() // This just sets up the receive handler task.resume() } catch { DispatchQueue.main.async { self.onComplete?(.failure(error)) } }
Posted
by aalpat44.
Last updated
.
Post not yet marked as solved
0 Replies
167 Views
Hi, I've run into an issue when using runtime ports to communicate between the popup and the background of an extension. Specifically, there seems to be an inconsistency between Chrome and Safari as to when the disconnect event on a port is fired. My expectation is that a disconnect event is fired when the extension popup is closed, but this does not seem to be the case in the Safari browser. The only way I can see this event being fired is to call the port.disconnect() event manually. Is it possible to ensure the disconnect event is called when the popup is closed by any means?  https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/Port port.onDisconnect.addListener(function() { console.log("Extension disconnected"); }); I've also opened a case via the feedback assistant.
Posted
by ljs62.
Last updated
.
Post not yet marked as solved
2 Replies
311 Views
I am trying to resolve this issue when uploading a Mac app with a share menu extension to App Store Connect: Invalid Provisioning Profile. The provisioning profile included in the bundle com.goldenhillsoftware.Unread2.SubscribeInUnreadExtension [com.goldenhillsoftware.Unread2.pkg/Payload/submitmac.app/Contents/PlugIns/ShareExtension.appex] is invalid. [Invalid 'com.apple.application-identifier' entitlement value.] For more information, visit the macOS Developer Portal. (ID: 01a4a823-62e9-4278-b3b5-46266b168a65) I understand that it wants a com.apple.application-identifier entitlement, but I do not understand how to provide that entitlement. I have tried putting it in the .entitlements file, but that has not worked. Is there a place where I can specify the com.apple.application-identifier entitlement associated with the App ID or when manually generating an entitlements file from the Developer Portal? I don't see it in the list of App Services associated with an App ID in the developer portal. I have seen other threads where folks seem to get past this by deleting currently downloaded provisioning profiles and using Automatically manage signing, but I have not had success with that either. Am I right that the value should be (TeamId).com.company.(AppName)? Should the entitlement include the extension itself ((TeamId).com.company.(AppName).(ExtensionName))? Thanks. John
Posted Last updated
.
Post not yet marked as solved
0 Replies
221 Views
Hello, I'm an iOS and macOS developer. It is unclear to me if the "Smart Card Token Extension" on iOS can address Smart Card using NFC or CCID or both. Please tell us what is the current status. When creating the extension, you can provision an AID, what this information is used for ? Can't I use multiple application (hence multiple AIDs, let say one normal and one for qualified signature) on the SmartCard with the same scext ? It is worth asking the questions before diving into useless coding. Regards, ++dom
Posted
by dom_.
Last updated
.
Post not yet marked as solved
0 Replies
177 Views
Hey folks, Let say my extension name is "foo". In the Preferences-Extensions page, the title of my extension is "foo [version] from foo". How can I edit the second foo (the green one) to be my real company name and not the product name? Thanks in advance.
Posted
by liormec.
Last updated
.
Post not yet marked as solved
5 Replies
3.4k Views
Hi, I am building a Safari Web Extension and I am seeing this warning in my console: [NSExtension] Extension request contains input items but the extension point does not specify a set of allowed payload classes. The extension point’s NSExtensionContext subclass must implement +_allowedItemPayloadClasses. This must return the set of allowed NSExtensionItem payload classes. In future, this request will fail with an error. Extension: <EXConcreteExtension: 0x7f9ca5abe440 I am not sure how to go about this. I have not found any documentation regarding usage of allowedItemPayloadClasses has anyone seen this before?
Posted Last updated
.
Post marked as solved
5 Replies
1.3k Views
I have a FileProvider app consisting of MainApp and FileProviderExtension. MainApp has a popover which should have features like: Button which opens FileProvider folder List of files being uploaded/download and when user clicks on a file, it should either be opened or shown in Finder in containing folder. How to achieve these in Sandboxed macOS app? I know it's possible because Microsoft's OneDrive app is distributed via AppStore and can perform these features. So far I've been able to create an alias to a FileProvider folder in user's home folder by utilizing NSOpenPanel. I tried opening FileProvider files from MainApp with something like: let url = try! await NSFileProviderManager(for: myDomain)?.getUserVisibleURL(for: fileIdentifier) NSWorkspace.shared.open(url!) but getUserVisibleURL returns nil. Does anyone know how to achieve described functionality?
Posted Last updated
.
Post not yet marked as solved
0 Replies
411 Views
I'm developping a hebrew custom keyboard (the way the wovels are handled in the apple hebrew keyboard is not satisfying for me). As the hebrew language is from right to left, I expect that when I type a letter the cursor position moves to the left of the text, but it is not the case: it stays on the right, while new typed caharcters will be correctly positionned (on the left of the last character). if I manually position the cursor on the left of the last character entered (using adjustTextPosition of textDocumentProxy) the next character whill not be on the left position, as expected but on the right position. how can I fix the problem, and have the cursor on the left after typing a character?
Posted Last updated
.
Post not yet marked as solved
0 Replies
368 Views
This seems to be a bug in the macOS FileProvider framework. Repro steps: Open a file in the File Provider domain and edit it using WPS Office Save the file in WPS and close the editor tab or WPS Office window The file in the File Provider domain shows an uploading icon, and the modifyItem(_:baseVersion:changedFields:contents:options:request:completionHandler:) callback will never be triggered, so the file won’t be uploaded, and will always shows an "uploading" icon I investigated the issue and found out that the root cause seems to be related to flock, In step 2, after saving the changes, the file is still exclusively locked by WPS Office, In the log of fileproviderd there is an error saying "itemIsFlockedCanNotPropagate", this is understandable since the file is exclusively flocked, and fileproviderd couldn’t propagate the item and trigger the modifyItem callback, What I'm struggling with is that after the file is closed, or even after the WPS Office app has been quit, the modifyItem callback still won’t be fired by the system. What’s even more interesting is that at this time if you manually invoke flock(fd, LOCK_UN) for the file, the modifyItem callback will be triggered right away. In other words, it seems to me that fileproviderd is monitoring the unlock signal of the file descriptor, if a file is flocked with flock(fd, LOCK_EX) and then closed without invoking flock(fd, LOCK_UN), fileproviderd will not able to propagate the change and the modifyItem callback will never be triggered, then FileProviderExtension or the App won’t know that file is changed, the file will always shows an “uploading” icon in Finder. I've tested this against the official FruitBusket sample, OneDrive, Box-Drive and Dropxbox, they all implemented the NSFileProviderReplicatedExtension, and all have the same issue.
Posted
by fuwang_ns.
Last updated
.
Post not yet marked as solved
0 Replies
319 Views
Hi, We need to use silent notifications in our app, even when the user kills the app. We requested Apple to get a NSE Filtering Entitlement on December 02, 2022 with follow-up number: 814879299 But after nearly 2 months, we still haven't got a response. So we also sent a TSI (Technical Support Incident) on January 09, 2023 with follow-up number: 817249684. DTS (Developer Technical Support) said that we need to use this specific entitlement and he has no involvement in the entitlement request process. We need a quick response for the NSE Filtering Entitlement because our business depends on Apple's response. @Apple, is it possible to get an estimation date for the response? @iOS_developers, how long have you been waiting for that permission?
Posted
by telo42.
Last updated
.
Post not yet marked as solved
1 Replies
292 Views
Some institutions are seeing these errors when uploading using our share extension and this occurs on 100s of iPads on iOS 16.x. Rebooting the device is the only way to get it working again, but fails soon after. It is occurring on most but not all devices. This appears isolated and most users are not reporting any issues at all and to date we cannot reproduce this issue in-house. Here is the isolated console trace of the issue: Isolated, -997 ERROR console logs.txt And here is the isolated console trace of it working: Isolated, WORKING console logs.txt It's worth noting that some institutions use MDMs to manage their devices. What environmental conditions could cause this issue be caused intermittently? Is it truly an Apple daemon bug and out of my hands?
Posted
by capikaw.
Last updated
.