Extensions

RSS for tag

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

Posts under Extensions tag

187 Posts
Sort by:
Post not yet marked as solved
0 Replies
238 Views
I have an iOS app with widgetkit extension, and the widgets stopped updating. I attached the console, and saw these lines for widgets of my app: com.apple.widget.myApp::myWidgetKind::-6207022974507159915:417E34:[ {name: Widget Refresh Policy, policyWeight: 0.010, response: {Decision: Must Not Proceed, Score: 0.00, Rationale: [{onOverrideList == 1 AND IndividualBalance == -1}]}} ], FinalDecision: Must Not Proceed} The IndividualBalance == -1 apparently means that the app was updating widgets too often, but what about onOverrideList == 1? There seems to be no info online about this flag, and LLMs seem to suggest that the app got onto some kind of Apple's blacklist for updating too often, is that right?
Posted
by
Post not yet marked as solved
0 Replies
222 Views
I wanted to implement a feature that allows the sharing of multiple files simultaneously to my app from an external app like Files. In my ApplicationDelegate file, I provided the following method, which currently only retrieves a single file URL from the share sheet, even when multiple files were selected in the Files app: - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options { return [self handleSharedURL:url options:options]; } I'm curious to know if there is a way to obtain multiple file URLs without relying on a share extension. Any advice would be greatly appreciated.
Posted
by
Post not yet marked as solved
0 Replies
187 Views
I wanted to implement a feature that allows the sharing of multiple files simultaneously to my app from an external app like Files. In my ApplicationDelegate file, I provided the following method, which currently only retrieves a single file URL from the share sheet, even when multiple files were selected in the Files app: - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options { return [self handleSharedURL:url options:options]; } I'm curious to know if there is a way to obtain multiple file URLs without relying on a share extension. Any advice would be greatly appreciated.
Posted
by
Post not yet marked as solved
2 Replies
412 Views
I am trying to run a simple bash script from within swift. Eventually it should call a python script, but for now, I am just trying to get it to echo hello. The script is included in the bundle and also included in the targets. The script is called from the QLExtension. The script is correctly found, but I get an error: Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted" let scriptPath = Bundle.main.path(forResource: "run_local", ofType: "sh") if scriptPath == nil { print("script not found or other error") return nil } let process = Process() process.executableURL = URL(fileURLWithPath: "/bin/bash") process.arguments = [scriptPath!] do { try process.run() process.waitUntilExit() } catch { print("Failed to run the script: \(error)") } The script, run_local.sh is included in the bundle and is just #!/bin/bash echo "hi" > /dev/null Is this possible? Are there any particular entitlements that I need in order for this to work? Everything else works with this app; this is the only error. -- The reason I am building this: I use google drive to synchronize files locally. A number of those files do not have a local representation. Google "stores" those files locally using a text file with a document ID (one would open something like docs.google.com/docs/) I want to be able to preview the google drive files using quicklook One very simple way to do this is to fetch the google drive files (using google drive API) at preview time. I have a python script that can do this and wanted to hook it up to the QLExtension for preview Another option is to keep a separate service running (I would use python) that keeps a local copy of all the synchronized google files. (But then I'll probably need to connect to a local sql database or similar that tells the swift extension the local file math: i.e., effectively a mapping from ID => local_file_path. But perhaps access of this kind to a SQL database is allowed?)
Posted
by
Post not yet marked as solved
0 Replies
286 Views
Hi, I have few questions regarding the widgets. I would like to know whether widget and app extensions are same ? This link(https://developer.apple.com/app-extensions/) says widget is type of app extension but I am not quite sure as few link in web says they are different. so need to confirm here :) Can a widget share same bundle id as the main app ? so basically can we use the same provisioning profile as the main app? If we use the same bundle id and provisioning profile, will there be any issue during the app store submission process.?
Posted
by
Post not yet marked as solved
0 Replies
510 Views
I have an iOS app, which uses Notification Service Extension (NSE) for its functioning. When I build the app, I get the following error: error: Embedded binary's bundle identifier is not prefixed with the parent app's bundle identifier. Embedded Binary Bundle Identifier: (null) Parent App Bundle Identifier: com.example.sample This error occurs when NSE doesn't have the app's bundle identifier prefixed to it (Reference post). In my case, the bundle ID of the app is com.example.sample and the bundle ID of the extension, com.example.sample.NSESample (checked these values in Project -&gt; Target -&gt; Signing &amp; capabilities -&gt; bundle identifier label). I believe this is as expected. I don't understand this error now, which says the embedded bundle identifier is null. I cleaned and built the app again..... same error. According to this stackoverflow post, you have to enable 'Copy only when installing'. When I tried, it worked. I don't know what this setting means and how this solves the issue. I'm unable to find any documentation reg this setting. Idk if this is even a valid solution, because the error says 'Embedded Binary Bundle Identifier' is null. Why is the embedded bundle identifier null (despite the Xcode interface showing a valid bundle ID)? How can I solve this?
Posted
by
Post not yet marked as solved
0 Replies
288 Views
I'm trying to implement an AutoFill extension for passkeys. I need the extension to communicate with the containing app even when the containing app is terminated. Is there any (and I mean ANY) way to do it? P.S. I already tried the MMWormhole package and also tried to write to a file from the extension using NSFileCoordinator and observe this file in the containing app using NSFilePresenter. Both only work when the containing app is already running.
Posted
by
Post not yet marked as solved
0 Replies
204 Views
I'm looking to integrate the Google OAuth process into my custom Safari extension, but I haven't been able to find specific documentation on how to do this, similar to what's available for Chrome extensions. After some research and testing, I've tried using both browser.identity.getAuthToken and safari.identity.getAuthToken, but neither seems to be working. I'm wondering if anyone can provide a solution for this issue. The extension works fine in Google Chrome, but not in Safari. Below is the code I'm currently using for Safari: `browser.identity.getAuthToken({ interactive: true }, function (token) { localStorage.setItem("accessToken", token); });` Is there any documentation available for using the Google OAuth process in my custom Safari extension, Because I am not able to found anything related to it? Could someone please inform me of any mistakes I might be making here?
Posted
by
Post not yet marked as solved
25 Replies
1.2k Views
Our app has a share extension. And we recently noticed something with iOS 17.3.1. From Safari, when we receive the plist and try to load it, we are seeing exceptions for classes not allowed to be unarchived. [itemProvider loadItemForTypeIdentifier:[UTTypePropertyList identifier] options:nil completionHandler:^(NSDictionary *jsDict, NSError *error) { } We see these exceptions: value for key 'NS.keys' was of unexpected class 'NSString' (0x1ee7d2970) [/System/Library/Frameworks/Foundation.framework]. Allowed classes are: {( "'NSDictionary' (0x1ee7cad38) [/System/Library/Frameworks/CoreFoundation.framework]" )} (null) Our preprocessing javascript file is basic, and only passes a title and URL as part of the payload. arguments.completionFunction({ "URL": document.URL "title": document.title, });
Posted
by
Post not yet marked as solved
0 Replies
259 Views
I noticed two differences in my share extension's behaviour compared to my main app: The layer.presentation() values can be massively out of date, which means that continuing animations from their current position is not possible. This is both true for manually checking the layer.presentation() values, as well as for letting UIKit doing the replacement-continuation via UIView.animate(..., options: [.beginFromCurrentState], ...). UI updates seem to be ignored if the share extension performs heavy calculation. Interestingly, it doesn't seem to matter whether I do this calculation in the main thread or in a background thread, and call the main thread for UI updates via DispatchQueue.main.sync { ... }. I see my console in Xcode filling with progress updates from print(progress) statements, but the UI just doesn't move. Once the heavy processing is done, it instantly updates again. I assume that 1 and 2 are related. If I cannot get the UI to draw while the computation is done, I probably also can't get up-to-date presentation layer values. Are there any explanations for this behaviour, and any advice on how I could circumvent the problem? Again, this is specific to my share extension and doesn't happen in my main app.
Posted
by
Post not yet marked as solved
0 Replies
569 Views
Apple requires declaring the use of UserDefaults in both the App and third-party libraries in the PrivacyInfo. However, I also utilize UserDefaults in the Notification Service Extension. Should I treat the Extension as part of the App and only declare it within the App project? Or do I need to separately declare it for the Extension as well?
Posted
by
Post not yet marked as solved
3 Replies
461 Views
Hi, I have a UNNotificationServiceExtension, which was running perfectly fine for more than a year. Last week, it has suddenly stopped working, with no apparent changes to the server-side application sending the notification to APNS. The strange part is that it works on some devices and it doesn't work on others. I have confirmed that notifications are enabled for the app in iOS system preferences. com.company.product is the bundle identifier of the main app com.company.product.yyyyy is the bundle identifies of the NSE appname.app and nse.appex are the placeholders for the name of the app and name of the NSE respectively Following is the NSE info.plist: <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CFBundleDisplayName</key> <string>yyyy</string> <key>CFBundleName</key> <string>yyyy</string> <key>CFBundleIdentifier</key> <string>com.company.product.yyyy</string> <key>CFBundleDevelopmentRegion</key> <string>en</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundlePackageType</key> <string>XPC!</string> <key>CFBundleShortVersionString</key> <string>y.y.y</string> <key>MinimumOSVersion</key> <string>13.0</string> <key>NSExtension</key> <dict> <key>NSExtensionPointIdentifier</key> <string>com.apple.usernotifications.service</string> <key>NSExtensionPrincipalClass</key> <string>NotificationService</string> </dict> <key>CFBundleVersion</key> <string>yyy</string> </dict> </plist> Model: iPhone 15 Pro Max iOS Version: 17.3
Posted
by
Post not yet marked as solved
0 Replies
357 Views
I have successfully created the Intents UI Extension file for the wallet, obtained the requisite certificate, and adhered to the MeaWallet guidelines. Additionally, I have generated a sandbox login ID and successfully logged into the simulator using the sandbox login ID. In an attempt to integrate the Intents UI Extension file into an existing project, I followed these steps: Debug -> Attach to Process by PID or Name. Subsequently, I conducted a search for the Intents UI Extension file name, selected the appropriate file, and clicked the attach button. However, Xcode is currently displaying 'waiting for attachment.' Despite these efforts, I encountered an issue where the wallet extension controller is unable to access the application when attempting to run it.
Posted
by
Post not yet marked as solved
2 Replies
435 Views
I am developing issuer non-UI extension. In function status i have to return remotePassEntriesAvailable (boolean) and to do that i have to activate WCSession from that Extension to get the remoteSecureElementPasses which are already added to the remote wallet (watch). I have implemented WCSessionDelegate inside the non-UI extension but i can not enable the WCSession. I always get: Error: WCSession has not been activated I saw a comment in this post -> WCSession is not available from iOS extensions, only from the main iOS app. To the point... If the WCSession is not available from iOS extensions how can I properly set remoteSecureElementPasses and implement function remotePassEntries if i can't connect to the watch to see which cards are already enrolled?
Post not yet marked as solved
1 Replies
423 Views
There is an application on iPhone. The Action Extension is used, it works great on the iPhone, but when you add Destination = iPad, the application starts, works, but the extension does not work. Error: -[_EXSinkLoadOperator loadItemForTypeIdentifier:completionHandler:expectedValueClass:options:] nil expectedValueClass allowing {( NSURL, NSDictionary _EXItemProviderSandboxedResource, NSUUID, NSDate, NSArray, NSData, NSString, NSNumber NSError UIImage, NSValue )} The error occurs here: if itemProvider.hasItemConformingToTypeIdentifier(typeImage) { itemProvider.loadItem(forTypeIdentifier: typeImage, options: nil) { item, error in Doesn't work on a real device, works on simulators. iOS 17.2, XCode 15.2. On simulator first time the extension works and opens the main app, but on the second attempt the main app is not called (after selecting the extension, the image is kinda shadowed and then the shadow disappears). On simulator tested with iPad 6, iPad 9, iPad 10, iPad Air 6. On real iPad 6 does not work at all.
Posted
by
Post not yet marked as solved
15 Replies
1k Views
I am developing a Mac app which provides a Credential Provider extension and I'm having trouble with passkey integration. I wrote here about the issue I'm having with the iOS app. On the Mac I'm experiencing a different issue. As opposed to the iOS app (where I'm not even able to use my extension to create a new passkey in the first place) on the Mac I'm able to use my extension to create a passkey. I save the credential identity into the system AutoFill suggestions store without error. The problem is that when I attempt to authenticate on the same site the system does not offer my app's credential as a suggestion. Standard passwords are working fine. Can anyone help me understand how I can troubleshoot this type of problem? Thanks! -Jeremy
Posted
by
Post marked as solved
2 Replies
556 Views
I'm developing an iOS app that contains a Credential Provider Extension, and I want it to support passkeys. I've set the ProvidesPasskeys key to YES in the Info.plist of the extension, and in the CredentialProviderViewController I've implemented: func prepareCredentialList( for serviceIdentifiers: [ASCredentialServiceIdentifier] ) func provideCredentialWithoutUserInteraction( for credentialRequest: ASCredentialRequest ) func prepareInterfaceToProvideCredential( for credentialRequest: ASCredentialRequest ) func prepareInterface( forPasskeyRegistration registrationRequest: ASCredentialRequest ) Standard password autofill suggestions that I have added to the system store are presented to me when I arrive to the corresponding login page, and the autofill flow succeeds via my extension. When I attempt to create a new passkey on my iPhone, whether it be in Safari on a website that supports passkeys (e.g. google.com) or within a native app that supports the creation of passkeys (e.g. PayPal), I am not given the option to create a passkey using my extension. The only option that is provided to me is the builtin Keychain option. On the "Settings->Passwords->Password Options" page I have "AutoFill Passwords and Passkeys" switch on and in the section titled "USE PASSWORDS AND PASSKEYS FROM:". I have selected both my app and "iCloud Passwords & Keychain". If I uncheck "iCloud Passwords & Keychain" and then attempt to create a passkey then I am shown a system sheet which tells me to go to the settings page to "choose how to manage passkeys". Any ideas on how to troubleshoot this situation? Thanks very much! -Jeremy
Posted
by
Post not yet marked as solved
0 Replies
371 Views
I created a message filter extension, then edited only a few lines from the template source code (for example to return something in the capabilities query). However no matter what I do, I just cannot get the app to appear in the Settings app - when I turn on "Filter Unknown Senders" there's nothing that appears to select my app. I've tried rebuilding, deleting/reinstalling the app, restarting the phone, it just won't appear. But then I switched to another phone, and with this phone, when I turn on "Filter Unknown Senders" my app does appear and can be selected and enabled. But I still cannot get this to happen on the first phone. Why does the exact same app, exact same build of the app to be precise, appear on one phone but not the other? The phone it works on has iOS 17.2.1 and the phone it doesn't work on has iOS 17.1.1
Posted
by