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

Replies

Boosts

Views

Activity

UIKit drawing and animation differences in ShareExtensions
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.
0
0
296
Feb ’24
Is a Privacy Manifest Required When Using Notification Service Extension?
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?
0
2
633
Feb ’24
UNNotificationServiceExtension suddenly stopped working
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
3
1
521
Feb ’24
Intents UI Extension
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.
0
0
439
Feb ’24
Watch connectivity inside Apple Wallet Issuer Extension
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?
4
0
508
Feb ’24
Action Extension works on iPhone but not on iPad
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.
1
0
506
Feb ’24
iOS Credential Provider Extension Not Offered When Creating Passkeys
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
5
0
752
Feb ’24
Message filtering extension appears on one phone but not another
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
0
0
414
Jan ’24
Notification Service Extension in iOS works sometimes but stops working other times. User needs to restart device to get it working again.
We have an app where the notification service extension works well most of the time. However, sometimes we have noticed that the extension completely stops working even when the notification is sent successfully via the APNS server in production. We do not see even the log from the didReceive() function in that case. The only way we can get the extension working again is after restarting the iPhone. Trying to understand when this might happen? Is it something that is throttled by iOS? Would it happen when the device memory is low or the app is using too much memory? We have seen the extension crash sometimes due to hitting memory limits, however, the extension process is spawned again when a new notification comes in. Any kind of help or guidance would be greatly appreciated. Thanks We have setup acknowledgment API calls in the notification service extension processing to be notified when the notifications reach the device. So based on that we know how often the devices stop responding with the ACK to sent notifications. It happens seldom with some users and we have to ask them to restart their device to get the extension functional again.
4
1
1.4k
Jan ’24
SIP Client app - Push notification unavailable
Hello Team, We have developed an SIP Client application, where the connection is through SIP Server. We are unable to handle incoming calls when app is in the background. The local servers are blocked by firewall due to which the push notification is unavailable and is only available via VPN connection. Requesting you to please guide us on how we can receive incoming calls without push notification. We also would like to know how we can receive incoming calls when the app is completely terminated or closed from background and how to auto-start the app to receive incoming calls.
2
0
457
Jan ’24
My lock screen widget has stopped working, strange error
Hello, I created a lock screen widget for my app last year, as a widget app extension. It has worked fine, but I am working on a new release and it has stopped updating: It is not called anymore when I call WidgetCenter.shared.reloadTimelines(ofKind: "MyWidget"), and the preview screen is now blank when I add it on the lockscreen. I haven't touched anything related to the widget from what I know. The only things I can think of is that Xcode has updated my project files automagically, and I have updated cocoapods. I looked at the device logs, and found this: [...MyWidget] Failed to launch extension with error: Error Domain=com.apple.extensionKit.errorDomain Code=2 UserInfo={NSUnderlyingError=0x84b4d4410 {Error Domain=RBSRequestErrorDomain Code=5 UserInfo={NSLocalizedFailureReason=, NSUnderlyingError=0x84b45ea30 {Error Domain=NSPOSIXErrorDomain Code=111 UserInfo={NSLocalizedDescription=}}}}}. I have no idea what this is, hoping someone can come up with suggestions on where to look. I have looked at my git history but I can't find anything changed.
3
3
757
Jan ’24
Tag pictures in Shared Albums
Issue as a Media Producer: When posting numerous pictures on the internet, it becomes challenging to recall which ones have been used from the camera roll. Wouldn't it be helpful to devise a system to mark or flag them for easier reference? Solution: Implement a feature to enable sorting of "pinned" or "marked" pictures that can be toggled on or off. This way, it becomes effortless to identify which pictures have been utilized in shared albums. For instance, in a company with multiple contributors to a shared album, keeping track of used pictures can be cumbersome. If there's an option to mark them as "used" or similar, it would significantly enhance efficiency. This feature would be especially beneficial for me when working in collaborative albums, like shared Instagram accounts, where there are thousands of pictures to review. What are your thoughts on this idea?
0
0
333
Jan ’24
Sharing a JPEG via Action or Share Extension fails in Photos on macOS
We have a Share Extension that fails in Photos on macOS when trying to share a JPEG image for the following reason: From the NSItemProvider we get from the NSExtensionItem.attachments, we try to load the image using loadFileRepresentation(forTypeIdentifier: “public.image”, completionHandler: …). This fails for .jpeg images in the library. There seems to be a mismatch in expected and actual file extension internally. Here is the log: Error copying file type public.image. Error: Error Domain=NSItemProviderErrorDomain Code=-1000 "Cannot load representation of type public.jpeg" UserInfo={NSLocalizedDescription=Cannot load representation of type public.jpeg, NSUnderlyingError=0x1527c1a80 {Error Domain=NSItemProviderErrorDomain Code=-1 "Cannot copy file at URL file:///Users/frank/Library/Containers/com.apple.Photos/Data/tmp/TemporaryItems/ShareKit-Exports/7CCFA760-AAC9-42B0-812D-68F051ED1543/F912E593-2BE5-4E70-86AB-7657A40657E5/IMG_3517.jpg." UserInfo={NSLocalizedDescription=Cannot copy file at URL file:///Users/frank/Library/Containers/com.apple.Photos/Data/tmp/TemporaryItems/ShareKit-Exports/7CCFA760-AAC9-42B0-812D-68F051ED1543/F912E593-2BE5-4E70-86AB-7657A40657E5/IMG_3517.jpg., NSUnderlyingError=0x152789670 {Error Domain=NSItemProviderErrorDomain Code=-1 "Cannot create a temporary file. Error: Undefined error: 0" UserInfo={NSLocalizedDescription=Cannot create a temporary file. Error: Undefined error: 0}}}}}``` In the specified folder, there is an image, however, it’s named IMG_3517.jpeg, not IMG_3517.jpg. This seems to be a bug in Photo’s item provider implementation. If we use loadObject(ofClass: URL.self, completionHandler: …) instead, we get the correct .jpeg URL in the completion handler.
1
0
512
Jan ’24
CMIO CameraExtension installation is not ATOMIC
If I do these tasks on random order, CMIO CameraExtension go into unstable condition. Copy MyApp.app under /Applications or /Applications/MyAppGroup/ Install by MyApp sending OSSystemExtensionRequest.activationRequest Check install condition by command : "systemextensionsctl list" uninstall by MyApp sending OSSystemExtensionRequest.deactivationRequest Remove /Applications/MyAppGroup/ by command line and Finder Remove /Applications/MyApp.app by command line and Finder Kill MyApp.app during activationRequest. Once my CMIO CameraExtension go into unstable condition, it is impossible to remove on normal way. "systemextensionsctl list" shows my extension is activated. Remove by API failed with code=4. Removing file of MyApp.app does not remove CameraExtension Only way to remove CameraExtension is "Boot macOS as recovery mode", disable SIP, "systemextensionsctl uninstall" Audio HAL extension is file based and ATOMIC. I can check file existence by "ls" command and remove by "rm -rf" command. I never met unstable condition.
1
0
422
Jan ’24
Location Push Service Extension entitlement not yet approved!!!!
Case-ID: 4977264 I am writing to inquire about the status of my location push service extension entitlement, which I submitted a consent form for on November 16, 2023., It has been 50 days with no response from Apple since I submitted, Can anyone help regarding the entitlement and why Apple takes time to approve OR is there any specific reason to deny entitlement? Thanks in advance.
1
0
454
Jan ’24
iOS extensions - order of installation
Hi, I have a few extensions for my iOS app: Share Extension, Widget extensions, Notification Extensions, Today Extension, WatchKit app. My app and all the extensions share data by loading the same Core Data sqlite database from a shared folder. One problem I'm having with this setup is with a Core Data lightweight migration. On updating the app to the new database model, I would like my main app to first make a backup of the database before the migration runs. But one of the app extensions always seems to run before the main app, and ends up performing the lightweight migration on the database file before the main app has a chance to backup the database sqlite file. I can just prevent the lightweight migration from happening when an app extension loads the persistent store (and only do lightweight migrations from the main app), but it might end up in a situation with incompatible formats for the extension, so I'm looking for a sturdier solution. When an app is installed (or an update to the app is installed), is there a way to check and control the order of the extensions that is installed / loaded by the system? That would help control the problem.
0
0
371
Jan ’24
CameraExtension and Uninstaller
I need to write macOS App, CameraExtension(CMIO) and Uninstaller app. Bundle ID is like this App : com.my.app CameraExtension : com.my.app.cameraex Uninstaller app : com.my.app.unisntaller My App can activate CameraExtension by OSSystemExtensionRequest.activationRequest. But Uninstaller cannot deactivate CameraExtension. I got error : Error Domain=OSSystemExtensionErrorDomain Code=4 "Extension not found in App bundle: perhaps App is not validly structured" I set AppGroup and add SystemExtension feature and provision for uninstaller. I guess "com.my.app.unisntaller" cannot deactivate "com.my.app.cameraex". What kind of Bundle ID should I use for my uninstaller? Writing App and Uninstaller is correct way for CameraExtension? My manager ask to provide easy method for removing all modules.
4
0
577
Jan ’24