Extensions

RSS for tag

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

Posts under Extensions tag

189 Posts
Sort by:
Post not yet marked as solved
4 Replies
2.3k Views
I am working on Issuer Extension using which user can add debit/ credit card through wallet directly. This is Extension based (Non and UI Extension. I am nearly implemented this however have doubts about PKIssuerProvisioningExtensionHandler methods which are below open func status(completion: @escaping (PKIssuerProvisioningExtensionStatus) -> Void)  open func passEntries(completion: @escaping ([PKIssuerProvisioningExtensionPassEntry]) -> Void) open func generateAddPaymentPassRequestForPassEntryWithIdentifier(_ identifier: String, configuration: PKAddPaymentPassRequestConfiguration, certificateChain certificates: [Data], nonce: Data, nonceSignature: Data, completionHandler completion: @escaping (PKAddPaymentPassRequest?) -> Void) My query is what is the significance of configuration in last callback. Can anyone please help with this. Thanks in advance
Posted
by
Post not yet marked as solved
1 Replies
926 Views
Question about App Clips. Is anyone aware of a mechanism whereby an app clip can return the user to the app from which it was invoked when the task is completed? For example, for an app clip invoked via a url in safari, is there a way to programmatically close the app clip after the task is complete and return the user to safari? I imagine this might be technically possible via a deep link if you were to know the custom url scheme for whichever system app invoked the app clip, if system apps do in fact even have custom url schemes that are usable by non-system apps, but that seems like a poor practice. There is lots of documentation and guidance around app clip invocation but none that I can find around the conclusion of the experience. Is the guidance or best practice just to inform the user that they need to manually navigate away from the app clip after the task completes? Surprised to see so little information about this given Apple's emphasis on using app clips to allow the user to complete a discrete task or flow. Thanks in advance for any insights.
Posted
by
Post not yet marked as solved
1 Replies
1.2k 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
Post not yet marked as solved
2 Replies
937 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
Post not yet marked as solved
1 Replies
704 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
Post not yet marked as solved
2 Replies
829 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
by
Post not yet marked as solved
2 Replies
1.3k Views
My project has a base app which is manually signed, inside I have a FileProvider parent app and extension. When things works elegantly in Xcode debug build when I run FP App. But, when I package it, the FileProvider can't mount, fails with a generic error on parent app (Error Domain=NSFileProviderErrorDomain Code=-2001 "The application cannot be used right now." UserInfo={NSLocalizedDescription=The application cannot be used right now.} Another generic error in FileProvider demon fileproviderd(488) deny(1) file-read-data /Applications/XYZ.app/Contents/Resources/FileFP.app How to solve this?
Posted
by
Post not yet marked as solved
2 Replies
784 Views
My customer installed two different apps on his Mac machine. These two apps are using ContentFilter extensions. One of the app is mine and another app is different vendor. If my customer enabled both ContentFilter extensions then he fails to connect immediately to its required destination to allow it to run. If one of the ContentFilter extension is disabled then there is no issue. Is it not possible to run two different ContentFilter extensions on same Mac machine? Is there any way to fix these type of issues? Thank You Nagendra R
Posted
by
Post marked as solved
3 Replies
1.7k Views
Hello, I am with a long running project that is written in Objective-c and Swift (more). I have added a widget target extension to the project, but can't compile since there is this issue: What is the potential problem and how to solve it? = swiftsourceinfo Multiple commands produce '.../Build/Products/Debug-iphonesimulator/MyApp.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo' Target 'MyApp' (project 'MyApp') has copy command from '.../Build/Intermediates.noindex/MyApp.build/Debug-iphonesimulator/MyApp.build/Objects-normal/arm64/MyApp.swiftsourceinfo' to '.../Build/Products/Debug-iphonesimulator/MyApp.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo' Target 'MyAppWidgetsExtension' (project 'MyApp') has copy command from '.../Build/Intermediates.noindex/MyApp.build/Debug-iphonesimulator/MyAppWidgetsExtension.build/Objects-normal/arm64/MyApp.swiftsourceinfo' to '.../Build/Products/Debug-iphonesimulator/MyApp.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo' = arm64-apple-ios-simulator.abi.json Multiple commands produce '.../Build/Products/Debug-iphonesimulator/MyApp.swiftmodule/arm64-apple-ios-simulator.abi.json' Target 'MyApp' (project 'MyApp') has copy command from '.../Build/Intermediates.noindex/MyApp.build/Debug-iphonesimulator/MyApp.build/Objects-normal/arm64/MyApp.abi.json' to '.../Build/Products/Debug-iphonesimulator/MyApp.swiftmodule/arm64-apple-ios-simulator.abi.json' Target 'MyAppWidgetsExtension' (project 'MyApp') has copy command from '.../Build/Intermediates.noindex/MyApp.build/Debug-iphonesimulator/MyAppWidgetsExtension.build/Objects-normal/arm64/MyApp.abi.json' to '.../Build/Products/Debug-iphonesimulator/MyApp.swiftmodule/arm64-apple-ios-simulator.abi.json' = .swiftdoc Multiple commands produce '.../Build/Products/Debug-iphonesimulator/MyApp.swiftmodule/arm64-apple-ios-simulator.swiftdoc' Target 'MyApp' (project 'MyApp') has copy command from '.../Build/Intermediates.noindex/MyApp.build/Debug-iphonesimulator/MyApp.build/Objects-normal/arm64/MyApp.swiftdoc' to '.../Build/Products/Debug-iphonesimulator/MyApp.swiftmodule/arm64-apple-ios-simulator.swiftdoc' Target 'MyAppWidgetsExtension' (project 'MyApp') has copy command from '.../Build/Intermediates.noindex/MyApp.build/Debug-iphonesimulator/MyAppWidgetsExtension.build/Objects-normal/arm64/MyApp.swiftdoc' to '.../Build/Products/Debug-iphonesimulator/MyApp.swiftmodule/arm64-apple-ios-simulator.swiftdoc' = .swiftmodule Multiple commands produce '.../Build/Products/Debug-iphonesimulator/MyApp.swiftmodule/arm64-apple-ios-simulator.swiftmodule' Target 'MyApp' (project 'MyApp') has copy command from '.../Build/Intermediates.noindex/MyApp.build/Debug-iphonesimulator/MyApp.build/Objects-normal/arm64/MyApp.swiftmodule' to '.../Build/Products/Debug-iphonesimulator/MyApp.swiftmodule/arm64-apple-ios-simulator.swiftmodule' Target 'MyAppWidgetsExtension' (project 'MyApp') has copy command from '.../Build/Intermediates.noindex/MyApp.build/Debug-iphonesimulator/MyAppWidgetsExtension.build/Objects-normal/arm64/MyApp.swiftmodule' to '.../Build/Products/Debug-iphonesimulator/MyApp.swiftmodule/arm64-apple-ios-simulator.swiftmodule'
Posted
by
Post marked as Apple Recommended
742 Views
Hi Experts, My app contains a system extension(VPN network extension), but it somehow can not be launched after multiple activations(via OSSystemExtensionRequest activationRequestForExtension) without deactivation. I just found my extension can be restarted automatically if I kill nesessionmanager in such case, so 2 questions: it's a system bug or misuse API that my system extension can not restart after several activations by activationRequestForExtension without deactivation first? is there any official way to restart nesessionmanger instead of killing it?
Posted
by
Post marked as solved
2 Replies
358 Views
Hello folks, I'm currently trying to understand extensions and I'm looking for solution how to convert pow() inside my Double's extension. import Foundation extension Double { func rounded(to places: Int) -> Double { let precisionNumber = pow(10, places) var value = self value *= precisionNumber value.round() value /= precisionNumber return value } } var myDouble = 3.14159 print(myDouble.rounded(to: 2)) When I'm trying to multiply or divide "value" there is an error, because of their different types. pow() function imposes Decimal type on me. Is there any solution or better way to do this? Regards, misty
Posted
by
Post marked as solved
1 Replies
462 Views
I have a widget extension that needs to use some UserDefaults written from my host app. I didn't want to use UserDefaults(suiteName:) since it's an optional, so I used the following property from [this article]:(https://www.swiftbysundell.com/articles/the-power-of-userdefaults-in-swift/) extension UserDefaults { static var shared: UserDefaults { let combined = UserDefaults.standard combined.addSuite(named: appGroupName) return combined } } But when I call it in the extension, the values are not present. Is this expected behavior? For the record, I am 100% sure I have the right app groups. I also made a new project only to test this and it's behaving identically. And I'm not calling .synchronize() for UserDefaults anywhere, but I don't think that's needed.
Posted
by
F99
Post not yet marked as solved
2 Replies
1.1k Views
I'm building a file provider extension and running into an issue I don't understand and am not sure how to resolve. I have been building the extension for a while and testing various things, and one of the biggest problems has been reliability. The current problem I'm running into is that when I build a new version of the process that contains the extension in Xcode, I get the error mentioned in the title when I try to register a domain (and the extension does not run). There's not much information I can find about what this error means or how to deal with it. I cannot find any running processes associated with my host application or the extension's name or id (though I may not have looked in the right places). Restarting the computer doesn't seem to resolve the issue either. Any ideas? (As an aside, at various points things have seemed to work just fine for me and even in a VM and then failed to work on other people's machines with no easily discernible reason, so any suggestions about ways to debug file provider issues are welcome)
Posted
by
Post not yet marked as solved
0 Replies
625 Views
The DeviceActivityReport is often laggy or sometimes doesn't show up at all. Quitting and re-opening the app usually fixes this problem. I'm wondering, is there a way to programmatically terminate and then re-launch the DeviceActivityReport App Extension from the host app? This way, that could act as a "refresh" when the DeviceActivityReport fails to show up.
Posted
by
Post marked as solved
1 Replies
877 Views
Hi, So I am bundling a FileProvider Extension with my electron application and have noticed a very strange behavior. When I package my application and install/launch it from any directory everything runs perfect. However the exception is when I install it to/launch it from the /Applications folder. Specifically I receive Cannot create domain: Error Domain=NSFileProviderErrorDomain Code=-2001 "The application cannot be used right now." which maps to providerNotFound. Seems that the provider is failing to instantiate altogether, and therefore I lack any extension functionality. After I have run the app from the /Applications folder once if I try and run the app from any other directory it fails and I get the same error message. Anybody have any clues as to what may be changing in my environment that driving this behavior?
Posted
by
Post not yet marked as solved
3 Replies
1.5k Views
I created a ShieldConfigurationExtension in Xcode 14.3 with File > New > Target > ShieldConfigurationExtension. This created the extension with all the necessary Info.plist values (correct NSExtensionPrincipalClass, etc.), with the extension included in embedded content in the host app target. No matter what I try, the extension is not getting invoked when I shield applications from my host app. The custom UI does not show as the shield, and looking at the debugger, an extension process is never invoked. I am shielding categories like this: let managedSettings = ManagedSettingsStore() ... managedSettings.shield.applicationCategories = .all() And my extension code overrides all the ShieldConfigurationDataSource functions. class ShieldConfigurationExtension: ShieldConfigurationDataSource { override func configuration(shielding application: Application) -> ShieldConfiguration { return ShieldConfiguration( backgroundBlurStyle: UIBlurEffect.Style.systemThickMaterial, backgroundColor: UIColor.white, icon: UIImage(systemName: "stopwatch"), title: ShieldConfiguration.Label(text: "You are in a Present Session", color: .yellow) ) } override func configuration(shielding application: Application, in category: ActivityCategory) -> ShieldConfiguration { return ShieldConfiguration( backgroundBlurStyle: UIBlurEffect.Style.systemThickMaterial, backgroundColor: UIColor.white, icon: UIImage(systemName: "stopwatch"), title: ShieldConfiguration.Label(text: "You are in a Present Session", color: .yellow) ) } override func configuration(shielding webDomain: WebDomain) -> ShieldConfiguration { return ShieldConfiguration( backgroundBlurStyle: UIBlurEffect.Style.systemThickMaterial, backgroundColor: UIColor.white, icon: UIImage(systemName: "stopwatch"), title: ShieldConfiguration.Label(text: "You are in a Present Session", color: .yellow) ) } override func configuration(shielding webDomain: WebDomain, in category: ActivityCategory) -> ShieldConfiguration { return ShieldConfiguration( backgroundBlurStyle: UIBlurEffect.Style.systemThickMaterial, backgroundColor: UIColor.white, icon: UIImage(systemName: "stopwatch"), title: ShieldConfiguration.Label(text: "You are in a Present Session", color: .yellow) ) } } What am I missing?
Posted
by
Post not yet marked as solved
1 Replies
720 Views
Greetings! I am currently working on Message Filtering iOS App extension: https://developer.apple.com/documentation/sms_and_call_reporting/sms_and_mms_message_filtering We are using the approach to defer the query to an associated server: https://developer.apple.com/documentation/sms_and_call_reporting/ilmessagefilterextensioncontext/2880240-deferqueryrequesttonetwork Although iOS ensures that no other app extension can make these requests to the server via associated domains feature, the security team is concerned a lot about creating an endpoint which has no client-server authentication at all (OAuth or bearer token authentication). It means that the endpoint may potentially be used by some thirdparty scripts, apps, etc, and we won't be able to distinguish this from valid clients on the backend. I am aware of the note in documentation saying For privacy reasons, the system handles all communication with your associated server; your Message Filter app extension can’t access the network directly. Your app extension also can’t write data to containers shared with the containing app. But maybe there is a way to add any client-server network authentication to requests made by deferring the message filter query to our server? Thanks in advance, Konstantin
Post not yet marked as solved
1 Replies
1.1k Views
I suddenly started to receive the following email with the error in it stating that my uploaded app is not available to be used in TestFlight: ITMS-90886: 'Cannot be used with TestFlight because the signature for the bundle at “MyApp.app/Contents/PlugIns/MyAppWidgetExtension.appex” is missing an application identifier but has an application identifier in the provisioning profile for the bundle. Bundles with application identifiers in the provisioning profile are expected to have the same identifier signed into the bundle in order to be eligible for TestFlight.' It was all working fine and now I am not sure even where to start looking. Signing, provisioning and everything else is managed automatically.
Posted
by