Extensions

RSS for tag

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

Posts under Extensions tag

193 Posts
Sort by:
Post not yet marked as solved
1 Replies
218 Views
I'm converting a Chrome extension to work in Safari 15 using the xcrun safari-web-extension-converter. It partially works, but seems to fail with CORS permission issues in both the background script and content scripts. Oddly enough neither issue exists in Chrome. I have granted all websites permission via Safari itself after installation. In manifest.json, I have this in the permissions key: "http://*/", "https://*/" I've tried a variety of permutations, including "https://*/*" but nothing works. Every XMLHttpRequest results in the same error: Failed to load resource: Origin safari-web-extension://... is not allowed by Access-Control-Allow-Origin. Status code: 200 As mentioned, it works fine in Chrome with the same permissions. What have I missed?
Posted
by
Post not yet marked as solved
1 Replies
242 Views
I want to localize two value in info.plist. First one is [ NSFileProviderDecorations - Item0 - Label ], and second one is [ NSExtensionFileProviderActionName ]. I could localize first one using InfoPlist.strings. (and Label-NSStringFormat) But it does not work for second one. I tried InfoPlist.strings, Localizable.strings, ..., but i can't localize this key. What should i do?
Posted
by
Post not yet marked as solved
3 Replies
269 Views
I've configured an item and placeholder in NSFileProviderExtension iOS extension, and an XPC service in the provider (based on the template for XPC service for Mac, but as part of the NSFileProviderExtension When connecting to the service from the app using code example in getFileProviderServicesForItem I am getting an error straight in the completion handler of that function: Error Domain=NSCocoaErrorDomain Code=4097 "Error while sending identifierForItemAtURL:completionHandler:" UserInfo={NSDebugDescription=Error while sending identifierForItemAtURL:completionHandler:, NSUnderlyingError=0x2833640c0 {Error Domain=NSCocoaErrorDomain Code=4097 "connection from pid 30324 on anonymousListener or serviceListener" UserInfo={NSDebugDescription=connection from pid 30324 on anonymousListener or serviceListener}}} Could you maybe suggest what I am missing? Or, is there an example somewhere of the FileProvider extension with the service being called from the app? Code: File Provider service definition: https://github.com/simplex-chat/simplex-chat/blob/af3dcc4a9a9b24751bf9d74af67cf8e7d119597a/apps/ios/SimpleX%20Service/SimpleXFPService.swift Application code that calls the service: https://github.com/simplex-chat/simplex-chat/blob/af3dcc4a9a9b24751bf9d74af67cf8e7d119597a/apps/ios/Shared/FPService.swift Thank you!
Posted
by
Post not yet marked as solved
0 Replies
138 Views
I'm trying to convert an existing Chrome Extension to Safari Web Extension. Immediately after convert, xcode opens and I build the project. Everything looks perfect in Safari: the popup works fine, the context menu item is there, options are there. The moment I restart Safari, the context menu item disappears and service worker is not loaded. My Manifest v3: "background": { "service_worker": "js/background.js" }, "permissions": [ "contextMenus", "activeTab", "storage" ], My background script: chrome.contextMenus.removeAll(() => { chrome.contextMenus.create(properties); });
Posted
by
Post not yet marked as solved
0 Replies
131 Views
Hi all. My app has a custom keyboard extension and I am trying to figure out a way to differentiate between a user manually exiting my keyboard vs the entire keyboard being collapsed or hidden. My problem is specifically on on iPhones >= X aka models that do not have a home button. The viewWillDisappear lifecycle method is great for handling both of the above. But I need a way to separate them. I have my own button that advances to the next input which I can account for (green circle). What I do not know how to account for is the user pressing Apple's globe icon to advance to the next input (red circle). Does anyone know a way to react to a user pressing the globe icon/a generic way to know if the user has switched keyboards as opposed to the keyboard going away.
Posted
by
Post not yet marked as solved
0 Replies
130 Views
I know AppleJavaExtensions-1.4.jar is Apple License. https://developer.apple.com/library/archive/samplecode/AppleJavaExtensions/Listings/README_txt.html I wonder that AppleJavaExtensions-1.4.jar is free or not when it is included in commercial SW? "In consideration of your agreement to abide by the following terms, and subject to these terms, Apple grants you a personal, non-exclusive license, under Apple's copyrights in this original Apple software (the "Apple Software")" In this sentence, I want to konw the meaning of "personal". Does it mean that it cannot be used for company? Please let me know as possible. Thank you.
Posted
by
Post not yet marked as solved
0 Replies
142 Views
I'm trying to create a "hello world" a Message Filtering extension for iOS based on the following steps: Create a new project. Go to File -> Target -> Add Message Filter App Extension, enter a name MyMessageFiltering. Xcode generate the folder MyMessageFiltering contains MessageFilterExtension.swift In the MessageFilterExtension.swift, add one line below the handle function as follow: func handle(_ queryRequest: ILMessageFilterQueryRequest, context: ILMessageFilterExtensionContext, completion: @escaping (ILMessageFilterQueryResponse) -> Void) { NSLog("FILTEREXTENSION - handle") // add the log to see check the function handle Run the app Enable the app in message extension on iPhone by Settings -> Message -> Unknown & spam Start the console app and record the phone. Send a sms message to iPhone by an unknown number (which is not existing in iPhone contact). There is no log from the console app or XCode console What steps did I do wrong to test the sms extension filtering ?
Posted
by
Post not yet marked as solved
3 Replies
354 Views
In MacOS I can achieve this via func sendKeyStrike(_ keyCode: CGKeyCode, useCommandFlag: Bool) { let sourceRef = CGEventSource(stateID: .combinedSessionState) if sourceRef == nil { NSLog("FakeKey: No event source") return } let keyDownEvent = CGEvent(keyboardEventSource: sourceRef, virtualKey: keyCode, keyDown: true) if useCommandFlag { keyDownEvent?.flags = .maskCommand } let keyUpEvent = CGEvent(keyboardEventSource: sourceRef, virtualKey: keyCode, keyDown: false) keyDownEvent?.post(tap: .cghidEventTap) keyUpEvent?.post(tap: .cghidEventTap) } Is there a function call either in XCUITest or any other framework to achieve keyboard strokes in IOS? IOS Seems to have HID keycodes but I just can't find a way to send them to the device. Either through XCUITest or any other framework. (I am ok with simulating a HID device using python or something else to command my iOS device as well.
Posted
by
Post not yet marked as solved
0 Replies
131 Views
Hello. How to receive keyboard events in PHContentEditingController on macOS? When extension is active tapping any key will result in Funk sound. First i tried to override keyDown in my subclass of PHContentEditingController, which does nothing. I also tried override keyDown in my subclass of NSView for my subclass of PHContentEditingController. Then i followed instructions from WWDC "Advances in macOS Security" session and implemented Input monitoring permissions request via CGEvent.tapCreate which only partially works. My extension now listed in System security / Privacy / Input Monitoring but it's impossible to turn it on. On each attempt to enable system fires alert with request to relaunch the app but does nothing. When alert disappear extension persist unchecked. My goal is to provide keyboard shortcuts for various task in Photo Editing Extension. How i can achieve that?
Posted
by
Post marked as solved
1 Replies
215 Views
I am developing an app with a widget available. Until recently the widget was being shown on both an iPhone and an iPad devices. Then I changed some logic in the widget, and now it only displays on the iPhone. I also use the Xcode simulators in the development, and the widget is available on both iPhone and iPad simulators, with same code. Summarizing the status for the widget. Simulators iPhone (13 Pro Max, iPhone 12) - OK iPad Pro (12.9" 5th Gen) - OK Devices iPhone (11) - OK iPad (Air 2) - Not available I can attach the Widget extension to the debugger for the simulators and the iPhone device. However the process in not there when I use the iPad device, so cannot attach the widget code to the debugger. Even if I attach the widget extension by name to the debugger, it is as if it is not running. I can run the widget extension directly on the iPad device (using an appropriate build scheme) and the details of the info displayed by the widget is the same as for the iPhone. So it is not running the widget on an iPad that is the problem. It seems like the widget extension is not embedded in the app code when the app is loaded on to an iPad device. Has anyone experienced anything similar? Not necessarily with a widget, it could be with another framework extension.
Posted
by
Post not yet marked as solved
0 Replies
142 Views
I'm working on an "Issuer Provisioning" extension for iOS. Instances of my root PKIssuerProvisioningExtensionHandler subclass are initialised and reinitialised often (every time the user taps the "+" button in the Wallet app) and live for a few milliseconds. So far, so good. The head-scratching part is that the extensions' process lives on across multiple invocations. This in turn has the effect that static member values also live on, meaning they are not in a predictable state during instantiation. Some of my static-loving dependencies are unhappy with this pattern. Is this "process outliving instances" extension pattern a common one? Is it described anywhere? Can it be disabled?
Posted
by
Post not yet marked as solved
2 Replies
241 Views
Hi, We are an MDM Solution, who is trying to collect the Data Usage Datas from iOS Devices. We have our own Native app, there we can able to get the data usage with some limitations While trying to fetch continuously, it shows usage for maximum upto 4GB. After 4 GB, it again resets the current count and starts from 0 . Forum Link Also These Above data fetched on one instance resets to zero on Restarting Device, So we are planning for Content Filter Provider extensions to get a track of data usage. We have no clear Documentations to use this. With Some third party domain references , Below are the Questions on it. For Content Filtering to be working , We need to add a plugin web content Filter with apps distribution Certificate as its authentication. -> As we are an MDM solution ,Is it needed to give all the cx our Distribution Certificate with its private key? Will the Content Filtering will satisfy our needs, as we can see that it works on tight container ? Is it possible to collect the data usages of the device without any limitations? It will good ,if there was a proper apple document to use this extension. Is it any there? Also will it be possible to use this without the distribution Certificate Authentication? Apple Doc: Link Any Suggestions are welcome. Thanks in Advance
Posted
by
Post not yet marked as solved
1 Replies
187 Views
i am getting this error when i added a new app extension (notification content) error: Embedded binary's bundle identifier is not prefixed with the parent app's bundle identifier. Embedded Binary Bundle Identifier: (null) i have set it up the same way as another app extension in the app. i have also tried to set the bundle id manually in the info.plist file as noted by some posts, but xcode keeps changing it back to the default of ${PRODUCT_BUNDLE_IDENTIFIER}. e.g. my manual edits to info.plist aren't being accepted for this key. it seems like maybe PRODUCT_BUNDLE_IDENTIFIER variable is getting cleared to null for that extension during the build process? any workarounds?
Posted
by
Post not yet marked as solved
0 Replies
184 Views
Hi, I am working on safari web extension for iOS, Since Message passing is only supported from safari extension to iOS application. To pass the data from app to safari extension, I thought of storing the required data using the Userdefault suite name and "app group" to access the UserDefaults data from the safari extension. I am stuck at how to access the data at the safari extension. Any sample javascript to access the UserDefaults data is appreciated Thanks
Posted
by
Post not yet marked as solved
0 Replies
119 Views
In Mail or Safari, user can select text to bring up the edit menu.. When sharing the text selection to Reminders using Share Extension, Reminders App's share extension is able to identify the "source" and show the app icon linking back to the original web page or email. (Please check attached screenshots) In my own Share Extension, how do I get, say, an URL object linking to the sharing source? I've looked at NSExtentionContext, NSExtensionItem and NSItemProvider documentation. It doesn't look like there's a public interface to retrieve that info. Do u guys have any suggestion? Thanks Bill
Posted
by
Post not yet marked as solved
0 Replies
129 Views
I trying run it with the next command: csrutil enable --without kext sudo chown -R root:wheel build/Release/VoltageShift.kext ./voltageshift info But in this last step it fail
Posted
by
Post not yet marked as solved
1 Replies
143 Views
Has anyone been successful creating a widget configuration that uses any of the "Measurement" type parameters? I'm running into crashes in the Widget/Home Screen when I try to do so. I am building a widget that provides functionality to 'nearby' points of interest. I just discovered that SiriIntents support specifying a Measurement type now --> Distance. When I have my configuration "nearbyDistance" parameter type set to the measurement type of Distance, adding the widget from the widget gallery crashes it after I hit the add button and it doesn't get added. This works: This crashes the Widget Preview and doesn't add the widget to the Home Screen: Right before I add my widget, things seem to be good: As soon as I tap Add Widget, this happens: I have created a feedback for this and attached some recordings and a sysdiagnose: FB10002319
Posted
by