Extensions

RSS for tag

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

Posts under Extensions tag

188 Posts
Sort by:
Post marked as solved
1 Replies
91 Views
I'm working on a app that can communicate, send and receive data from our own MFi scanner. Ideally, this app can receives data and remains communication even when it's in background, but I can only runs a background task for maximum 30 sec. Along with this main app, we also have a keyboard extension as an interface that can publish collected data to other app that user prefers with string format. However, It seems like Apple doesn't allow to implement UIApplication.shared.beginBackgroundTask method in extension class, is there any alternative that worth to try? Also, can I extend app background task time elapsed to at least 30 minutes? If I can get an official response would be great!
Posted
by
Post not yet marked as solved
0 Replies
89 Views
Hi, I run the converter my chrome exrension to a safari extension. I'm trying to pass the device data like the MacAddress of the device and IP address of my device to background.js in my chrome extension. How do I do that? I've tried several ways but I can't get it to work. Please help me,
Posted
by
Post not yet marked as solved
1 Replies
107 Views
Several of our users are having an issue where they cannot make or receive Teams calls from their iPhones. I believe this is an issue that began with IOS 17.2 and which Apple has acknowledged and committed to fixing. may I know what is the status of this fix? or if there is a solution?
Posted
by
Post not yet marked as solved
1 Replies
115 Views
Any extension views called from ASCredentialProviderViewController -> open func prepareInterface(forPasskeyRegistration registrationRequest: ASCredentialRequest) cannot be accessed through Keyboard (Setting->Accessibility->Keyboards->Full Keyboard Access enabled). I have to manually type the prompted screen once to be able to get focused and continue to use Keyboard. Is it a known issue or I am missing anything? Please suggest. Thanks!
Posted
by
Post not yet marked as solved
0 Replies
126 Views
I am trying to add an extension, that adds two functions to an array of FloatingPoint types. I added to and extension to get a myDesibe var: extension FloatingPoint { public var myDescribe:String { return String(format:"%.3f",self as! CVarArg) } } This works fine (or seems to) On the collection, I want to add two methods/vars. One method returns a string with command delimited values: public extension Array where Element: FloatingPoint { var myDescribe:String { var rvalue = "" for (index,entry) in self.enumerated() { var format = ",%@" if (index == 0) { format = "%@" } rvalue += String(format: format, entry.myDescribe) } return rvalue } } That seems to be working fine. The other I wan to pass the command delimited string in, and get an array of the type of elements of the Array. This does not work: public extension Array where Element: FloatingPoint { var myDescribe:String { func fromDescription(desribe:String) -> [Element] { var rvalue = [Element]() for entry in desribe.components(separatedBy: ",") { let trimmed = entry.trimmingCharacters(in: .whitespaces) let temp = FloatLiteralType(trimmed) ?? FloatLiteralType.zero // Now, how to convert this so I can append this in the array? This is the issue!! rvalue.append(temp) // << THIS FAILS, as it wants an Int which I don't `understand` } return rvalue } } All help is appreciated Charles
Posted
by
Post not yet marked as solved
0 Replies
135 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
128 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
110 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
242 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
197 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
301 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
174 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
140 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
684 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
197 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
332 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
374 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
238 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
290 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?