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
15 Replies
5.3k Views
I am playing around with Live Activities and got everything working on the iOS 16.1 beta 2 simulator using Xcode 14.1 beta 2 (14B5024i). However, running the same code on a real physical device (iPhone X) running iOS 16.1 beta 2 does not show the Live Activity on the lock screen at all. 😵 Did anyone get their Live Activity working on a real device yet, or is this an issue with the current beta? Things I have already checked: ActivityAuthorizationInfo().areActivitiesEnabled returns true on my physical device let activity = try Activity.request(...) successfully completes without throwing and I can see the activity.id printed to the console Other live activities - such as the iOS system timer activity - do show up on my physical device just fine
Posted
by aschuch.
Last updated
.
Post not yet marked as solved
0 Replies
213 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 aaahili.
Last updated
.
Post not yet marked as solved
25 Replies
1.1k 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 gngrwzrd.
Last updated
.
Post not yet marked as solved
1 Replies
239 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 SamFarah.
Last updated
.
Post not yet marked as solved
1 Replies
263 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 Last updated
.
Post marked as solved
1 Replies
464 Views
Hi, Just a quick one. I am working with a client who doesn't share his team's credentials like certificates, mobile provisioning, etc. He even refused to add me as one of the developer in his Apple Dev account. So, I am creating a new scheme for me that will use my own personal team and app ID to build it. While the main app's original scheme is basically unusable since I don't have the credentials to build it. The client still needs it for his CI/CD though. Now, the app has a Notification Service extension that will share UserDefaults via App Group. When I try to create a container with the same group ID as his, it always failed. It seems like we can't use it because it has already been taken by the clent. How do I fix this so I can just change the scheme to switch between the client's and mine? Thanks.
Posted Last updated
.
Post not yet marked as solved
0 Replies
213 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 Last updated
.
Post not yet marked as solved
0 Replies
224 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 Last updated
.
Post not yet marked as solved
1 Replies
740 Views
I have a text based action for iPhone and Mac Catalyst I am developing in Xcode 14.3.1 on macOS 13.4.1. I have the container app, an action and an AppGroup defined. I have confirmed that I can read the necessary shared defaults when the action launches. At this point the UI for the action is a simple textview in which I hope to display a modified version of the text passed to the action in the NSExtensionItems. I am not using a simulator. I am running the action directly using Xcode. What is happening is that the ActionViewController viewDidLoad runs but no visible window opens. In the console I see this as the action launches: 2023-07-05 18:27:23.692277-0700 XYZ[4634:279295] [ViewBridge] ViewBridge attempted to look up a hosted window with identifier 8E816BD5-67D3-402D-ADEB-AC59EDFA1F3B, but it was never registered. 2023-07-05 18:27:23.692408-0700 XYZ[4634:279295] [WindowHosting] UIScene property of UINSSceneViewController was accessed before it was set. .... The last line above is repeated 12 times.... Any helpful ideas would be deeply appreciated! Steve
Posted
by SwampDog.
Last updated
.
Post not yet marked as solved
0 Replies
203 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 MAWAL.
Last updated
.
Post not yet marked as solved
0 Replies
173 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 MAWAL.
Last updated
.
Post not yet marked as solved
2 Replies
398 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 Last updated
.
Post not yet marked as solved
0 Replies
269 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 Last updated
.
Post not yet marked as solved
0 Replies
500 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 GangOrca.
Last updated
.
Post not yet marked as solved
0 Replies
278 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 levi_omni.
Last updated
.
Post not yet marked as solved
8 Replies
865 Views
Hello! I'm working on the watchOS app that provides user with multiple fancy complication sets. There are about 50 widgets in our WidgetBundle now. With this amount we reached memory limit and the app crashes: Thread 1: EXC_RESOURCE (RESOURCE_TYPE_MEMORY: high watermark memory limit exceeded) (limit=15 MB) I inspected complicationExtension.appex content and find out that most volume is occupied by the executable: Localized strings (12 langs) altogether - 165 KB Assets.car - 1.1 MB Imported fonts TTF files altogether - 866 KB complicationsExtension executable file - 8.2 MB Why it takes so much space and how can it be made smaller?
Posted
by kelin.
Last updated
.
Post not yet marked as solved
0 Replies
190 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 Last updated
.
Post not yet marked as solved
0 Replies
240 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 Last updated
.