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
4 Replies
560 Views
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.
Posted
by
Post not yet marked as solved
0 Replies
337 Views
Hi all, I have an app which is essentially a keyboard extension. Some features of the keyboard require a subscription to work, and this subscription can be bought in the main app. My question is, can the keyboard extension use StoreKit 2 to verify the validity of a subscription created in the main app? If this isn't possible (due to sandboxing or whatever), I suppose I can just write status information that's shared using an app group, but the problem with this is that the app is likely to run seldomly. This mean that if the subscription is cancelled or lapses, the main app may not see it for a while, and the keyboard will continue to functions even though it has expired. One other thing I've thought of is maybe to share the receipt of the purchase with the extension, and have the keyboard sync and verify the receipt periodically with Apple's servers. Is this the proper way to do it? Thanks!
Posted
by
Post not yet marked as solved
0 Replies
342 Views
This "silently" indicates the following. It seems impossible to investigate the causes of the crash. The number of crashes on the organizer does not contain this. The crash log is not sent at all. The crash log is not left on the device. The number of crashes on "App Store Connect > Analytics > Metrics > Crashes" does not contain this. Currently, we understand the tendencies of this crash are as follows. Higher resolution devices. Older models. Therefore, we consider that the crashes are relevant to the memory consumption. However, we are not assured of that because of the following causes. There are no crash logs. The specific numbers of the memory limitation are undocumented publicly. The keyboard app developers consider it an open secret, and the threshold value is based on various hypotheses. The questions are as follows. Is there a way to identify the cause? Are there the same or similar reports? Is there an approach to solve this crash?
Posted
by
Post not yet marked as solved
2 Replies
437 Views
My Keyboard Extension has high memory usage for having UILabels with large font size. The keyboard has emojis in a single view with UICollectionView. I noticed that the bigger font size I use, the more memory usage I have. I set font size approximately to 25 and when scrolling through emojis, the memory usage goes up to 250mb. If I reduce the font size to 10, the memory usage goes down to 70mb when scrolled. The keyboard extension has 75mb memory usage. I've had my keyboard app uploaded for years and had no issues with memory usage but with recent OS update, my keyboard started crashing a lot due to memory usage and it's due to UILabel. Would it be possible to increase the memory limit or exception on the memory usage caused by the OS for large fonts stored as bitmap?
Posted
by
Post not yet marked as solved
1 Replies
743 Views
I use App Groups to share UserDefaults data between my host app and DeviceActivityMonitor extension. On iOS 17, it appears that reading @AppStorage variables are causing my DeviceActivityMonitor extension callback functions to crash. Weirdly, writing values is okay. I see this in the extension logs: Couldn't read values in CFPrefsPlistSource<0x10fe251d0> (Domain: GROUP_NAME, User: kCFPreferencesAnyUser, ByHost: Yes, Container: (null), Contents Need Refresh: Yes): Using kCFPreferencesAnyUser with a container is only allowed for System Containers, detaching from cfprefsd However, through searching this log message on the internet and the fact that it also appears in my host app logs without crashing, this seems to be a warning - possibly indicating an issue but also a possible red herring. But the fact remains that when I don't read UserDefaults values or variables decorated with @AppStorage in the DeviceActivityMonitor extension, everything works fine. Are UserDefaults, and specifically @AppStorage decorators supported in the DeviceActivityMonitor extension?
Posted
by
Post not yet marked as solved
1 Replies
715 Views
Our app uses DeviceActivityReport to display the user’s screen time. The performance of DeviceActivityReport is often very poor. These issue occur commonly: Screen time is reported as 0 minutes DeviceActivityReport View appears completely blank The host app loses connection with the DeviceActivityReport altogether I have implemented several workarounds which only slightly improve the performance, to varying degrees depending on the device iOS: Inside the DeviceActivityReport code - retry fetching screen time data until it returns a non-zero result Implement a “refresh” button which reloads the DeviceActivityReport view from the host app However, due to the sandboxed nature of DeviceActivityReport, there is no way for the host application to tell if the DeviceActivityReport extension is experiencing these performance issues. It results in a really bad user experience. I am building the app with Xcode 14 due to another issue where DeviceActivityReport fails to load for all iOS 16 devices when built with Xcode 15 (this is a know issue, here’s a link to a discussion on the developer forums: https://developer.apple.com/forums/thread/735915). However, when testing on iOS 17 devices with Xcode 15 builds, the above issues still occur. I have received no crash reports from DeviceActivityReport. These issues are known bugs and have been discussed on the developer forums, but I haven't yet seen a solution. Other screen time apps exist that use the DeviceActivityReport seemingly flawlessly, so I know that there is a way to improve the performance of DeviceActivityReport in my app. Please help! I have been dealing with this poor performance for a long time now with almost no improvement!
Posted
by
Post not yet marked as solved
0 Replies
424 Views
I'm currently developing a custom keyboard which bundled with main app. The keyboard would randomly crash when switch between apps with opened custom keyboard on physical device. I've read posts around but seems not what I've encountered. Bundle ID of main app: com.company.appName Bundle ID of keyboard extension: com.company.appName.Keyboard When custom keyboard is opened second time on other app, a sole personality warning would show up, but this won't lead to crash. WARNING! Sole personality is ambiguous; this may lead to erratic behavior [lifecycle] [u 9A2D7B1D-20AF-4E2A-A72F-C37C8D4FDEEA] [com.company.appName.Keyboard(1.0.0)] WARNING! Sole personality is ambiguous; this may lead to erratic behavior; personalities: { "com.companyName.appName.keyboard" = { 19209 = "&lt;PKServicePersonality: 0x28299da00; core = &lt;[u 9A2D7B1D-20AF-4E2A-A72F-C37C8D4FDEEA] [com.company.appName.Keyboard(1.0.0)],[d (null)] [/private/var/containers/Bundle/Application/67892ACC-5BDA-4205-828D-4D94D6E87ABD/AppName.app/PlugIns/Keyboard.appex]&gt;, host pid = 19209&gt;"; 19293 = "&lt;PKServicePersonality: 0x28298fb00; core = &lt;[u DA59190E-D8A2-4109-8D7B-1702E03AB0BD] [com.company.appName.Keyboard(1.0.0)],[d (null)] [/private/var/containers/Bundle/Application/67892ACC-5BDA-4205-828D-4D94D6E87ABD/AppName.app/PlugIns/Keyboard.appex]&gt;, host pid = 19293&gt;"; 299 = "&lt;PKServicePersonality: 0x282981700; core = &lt;[u 61DC0533-3D02-4CE7-83C2-D698537BC6ED] [com.company.appName.Keyboard(1.0.0)],[d (null)] [/private/var/containers/Bundle/Application/67892ACC-5BDA-4205-828D-4D94D6E87ABD/AppName.app/PlugIns/Keyboard.appex]&gt;, host pid = 299&gt;"; }; } After switching between apps for few times, the custom keyboard would crash, common crash log is : Connection to plugin invalidated while in use. 2023-12-13 10:19:44.220973+0800 MobileNotes[36435:1892265] [lifecycle] [u 9A37D3B6-CAE5-4E5C-95FF-DA653DC080E5:m (null)] [com.companyName.appName.Keyboard(1.0.0)] Connection to plugin interrupted while in use. 2023-12-13 10:19:44.221229+0800 MobileNotes[36435:1892265] [lifecycle] [u 9A37D3B6-CAE5-4E5C-95FF-DA653DC080E5:m (null)] [com.companyName.appName.Keyboard(1.0.0)] Connection to plugin invalidated while in use. Another crash log is bit more detailed, but still not sure what it may refers to. ` 2023-12-13 10:19:44.222563+0800 MobileNotes[36435:1892256] [NSExtension] Unable to setup extension context - error: Couldn’t communicate with a helper application. 2023-12-13 10:19:44.222646+0800 MobileNotes[36435:1892256] [NSExtension] Async Begin using internal completion handler called multiple times. Due to error after initial completion: Error Domain=NSCocoaErrorDomain Code=4097 "connection to service named com.company.appName.Keyboard.apple-extension-service" UserInfo={NSDebugDescription=connection to service named com.company.appName.Keyboard-extension-service} Program ended with exit code: 9`
Posted
by
Post not yet marked as solved
1 Replies
630 Views
We have an app that uses the Screen Time APIs to block certain apps set by the user on a schedule: We use ManagedSettings to shield selected apps We use DeviceActivityMonitor to shield the apps automatically on a schedule set by the user. The shielding starts during the intervalDidStart callback function and ends during the intervalDidEnd callback function We are getting reports from the majority of our iOS 17 users that the app blocking schedules no longer work on iOS 17. We have tested this on our own iOS 17 devices and reproduced the behavior. But the feature still works consistently on iOS 16 devices. The app is still built using Xcode 14 instead of Xcode 15 due to another issue - the DeviceActivityReport is blank for all iOS 16 users when built in Xcode 15 (link to issue on the developer forums: https://developer.apple.com/forums/thread/735915). When testing with Xcode 15 builds, the bug appears to improve - however it still occurs intermittently. Are there any other mechanisms to run tasks on repeating schedules? For this specific feature, we don't need to eventDidReachThreshold callbacks, which is the main purpose of DeviceActivityMonitor. So we really don't need any Device Activity integration at all, just setting and disabling ManagedSettings shields at certain times. Would love if anyone could suggest and alternative to DeviceActivityMonitor.
Posted
by
Post not yet marked as solved
0 Replies
393 Views
Hi Everyone, We are using mac os 13.6.1, Xcode Version 14.2 (14C18). We have create a new target in the project for "Share Extension". After running the code our app is not visible when we share content from apple news and safari. Please do let me know in case anyone need more information. Thanks in Advance.
Posted
by
Post not yet marked as solved
0 Replies
332 Views
Hi, Currently, our app extension needs to get PDF file( Safari generates itself from the url) with Reader PDF options mode( or PDF options mode). So, How to get PDF file in Safari with Reader PDF options mode( or PDF options mode) for our app extension? Is there any need to declare anything special in the Info.plist file of the extension? Does the Safari extension support exporting these PDF files? Or only used for OS default apps? Thanks.
Posted
by
Post not yet marked as solved
0 Replies
487 Views
How can I record audio in a keyboard extension? I've enabled microphone support by enabling "RequestsOpenAccess". When I try to record, I get the error below in the console. This doesn't make sense as Apple's docs seem to say that microphone access is allowed with Full Keyboard Access. What is the point of enabling the microphone if the app cannot access the data from the microphone? -CMSUtilities- CMSUtility_IsAllowedToStartRecording: Client sid:0x2205e, XXXXX(17965), 'prim' with PID 17965 was NOT allowed to start recording because it is an extension and doesn't have entitlements to record audio.
Posted
by
Post not yet marked as solved
2 Replies
594 Views
I made s target of "Camera Extension" on Xcode macOS Swift app. I got Swift code with CMIOExtensionDeviceSource. I add NSLog() and String.write() to file under FileManager.default.temporaryDirectory. My camera extension installaion was success and running with FaceTime. But I cannot see NSLog output or debug output temp file on Xcode or Console. How can I see debug output from my Camera Extension?
Posted
by
Post not yet marked as solved
0 Replies
450 Views
Hello. I am developing an app that helps people with language issues communicate and for that I thought I could do a custom keyboard for them. I was wondering if there is a way of doing a 3rd party keyboard using SwiftUI (little to no UIKit) and if so, where can I find documentation/tutorials. I have looked with no success. Additionally, can we use a PKCanvasView inside of keyboards (ie, is there any restriction/policy)? I intend to use it so that users can draw the words they're looking for (I already have the model and know how to come up with the suggestions and everything) Thanks a lot!
Posted
by
Post not yet marked as solved
0 Replies
407 Views
I keep getting the error messages: "xcodebuild[4944:159459] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionSentinelHostApplications for extension Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in com.apple.dt.IDEWatchSupportCore" and "Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for extension Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of plug-in com.apple.dt.IDEWatchSupportCore" I think I didn't properly install all the command line tools, but I'm not sure what to install. How do I install the proper dependencies or fix the issue when getting the app code to run on a device emulator? Do I need to install the watchOS emulator to get it to run?
Posted
by
Post not yet marked as solved
3 Replies
737 Views
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.
Posted
by
Post not yet marked as solved
0 Replies
261 Views
Hello. I am seeing an issue with my custom keyboard (actually, any custom keyboard) on iOS 17. If I have my keyboard v1 opened inside an app (Safari for example), then I do an update of my container app (from v1 to v2), if I open the host app (Safari), my keyboard will be replaced by the native keyboard. Note that if I dismiss the keyboard and then open it again, my keyboard will be shown correctly. I managed to reproduce this issue with an empty custom keyboard created on the fly. Are you seeing the same issue? Is this expected? Is there anything I can do to make sure my keyboard is shown after update? Thank you, Mihai
Posted
by
Post not yet marked as solved
1 Replies
575 Views
Hello, I'm currently experiencing an issue with the DeviceActivityMonitor extension in my code, specifically with the eventDidReachThreshold callback. I'm hoping to get some insights into why this problem occurs and how to resolve it. Problem: Issue 1: The eventDidReachThreshold callback is not triggering as expected. It appears that the callback is not being invoked when the threshold is reached. Issue 2: After a few seconds, the eventDidReachThreshold callback starts to trigger multiple times. This unexpected behavior is causing problems in my code, as it results in incorrect actions being taken. Issue 3: There are instances where the eventDidReachThreshold callback provides an incorrect event name. iOS version: iOS16.7.2 and iOS17.1.1 Here is my code to start the monitoring: func startMonitoring() { var startTime : DateComponents = DateComponents(hour: 0, minute: 0) let endTime : DateComponents = DateComponents(hour: 23, minute: 59) /// Creates the schedule for the activity, specifying the start and end times, and setting it to repeat. let schedule = DeviceActivitySchedule(intervalStart: startTime, intervalEnd: endTime, repeats: true, warningTime: nil) /// Defines the event that should trigger the encouragement. let event = DeviceActivityEvent(applications: socialActivitySelection.applicationTokens, categories: socialActivitySelection.categoryTokens, webDomains: socialActivitySelection.webDomainTokens, threshold: DateComponents(minute: 2)) let events: [DeviceActivityEvent.Name: DeviceActivityEvent] = [.socialScreenTimeEvent : event] do { activityCenter.stopMonitoring([.socialScreenTime]) /// Tries to start monitoring the activity using the specified schedule and events. try activityCenter.startMonitoring(.socialScreenTime, during: schedule, events: events) } catch { /// Prints an error message if the activity could not be started. print("Could not start monitoring: \(error)") } } In addition, I should mention that, with each iteration through the eventDidReachThreshold callback, I increment the threshold by 2 minutes and restart the monitoring. If there are any known workarounds or potential solutions, please share them. Thank you.
Posted
by
Post not yet marked as solved
0 Replies
460 Views
My app uses DeviceActivitySchedule to let users set schedules to block certain apps. I naturally want to understand how my users are using the feature, so I capture analytics events using Segment. Ever since the release of iOS 17.1, analytics events from DeviceActivityMonitor have stopped firing. I believe this is due to the fact that the app extension that DeviceActivityMonitor runs in does not support asynchronous network requests. (However, I'm not sure why the analytics were working correctly with iOS 16). What is the best way to capture analytics inside the DeviceActivityMonitor app extension in iOS 17?
Posted
by
Post not yet marked as solved
0 Replies
394 Views
I've encountered an issue while working on a macOS project involving Camera extension, specifically related to NSPasteboard. I want to use NSPasteboard for sending string type data from app to Camera Extension. Strangely, the exact same code that works flawlessly with NSPasteboard in a DAL plugin doesn't seem to work when implemented in a camera extension. To clarify, I can access the exact same pasteboard using the identical code in the DAL plugin and in an App, but when attempting the same in the camera extension, it doesn't behave as expected. Below is the code snippet I'm using in the camera extension: let pasteboardExtension = NSPasteboard(name: NSPasteboard.Name(rawValue: "com.example.myextension")) if let items = pasteboardExtension.readObjects(forClasses: [NSString.self], options: nil) as? [String] { NSLog("Received items in extension: \(items)") } else { NSLog("No items received in extension") } I've thoroughly reviewed the documentation without finding a resolution. Has anyone else faced a similar discrepancy between NSPasteboard behavior in DAL plugins and camera extensions? I'm reaching out for advice, insights, or potential workarounds from the community. If you have successfully addressed a similar issue or have any information that might shed light on this situation, your input would be greatly appreciated. Does Camera Extension support NSPasteBoard?
Posted
by
Post not yet marked as solved
2 Replies
444 Views
- (NEFilterNewFlowVerdict *)handleNewFlow:(NEFilterFlow *)flow { DDLogDebug(@"method '%s' invoked for flow: %@ ", __PRETTY_FUNCTION__, flow.identifier.UUIDString); int PEEKSIZE = 512; NEFilterNewFlowVerdict *flowVerdict = [NEFilterNewFlowVerdict filterDataVerdictWithFilterInbound:YES peekInboundBytes:PEEKSIZE filterOutbound:YES peekOutboundBytes:PEEKSIZE]; return flowVerdict; } - (NEFilterDataVerdict *)handleInboundDataFromFlow:(NEFilterFlow *)flow readBytesStartOffset:(NSUInteger)offset readBytes:(NSData *)readBytes { DDLogDebug(@"method '%s' invoked for flow: %@ ", __PRETTY_FUNCTION__, flow.identifier.UUIDString); return [self handlePacket:flow withExtraInfo: extraInfo]; } - (NEFilterDataVerdict *)handleOutboundDataFromFlow:(NEFilterFlow *)flow readBytesStartOffset:(NSUInteger)offset readBytes:(NSData *)readBytes { DDLogDebug(@"method '%s' invoked for flow: %@ ", __PRETTY_FUNCTION__, flow.identifier.UUIDString); return [self handlePacket:flow withExtraInfo: extraInfo]; } - (NEFilterDataVerdict *)handleInboundDataCompleteForFlow:(NEFilterFlow *)flow { DDLogDebug(@"method '%s' invoked for flow: %@ ", __PRETTY_FUNCTION__, flow.identifier.UUIDString); return [NEFilterDataVerdict allowVerdict]; } - (NEFilterDataVerdict *)handleOutboundDataCompleteForFlow:(NEFilterFlow *)flow { DDLogDebug(@"method '%s' invoked for flow: %@ ", __PRETTY_FUNCTION__, flow.identifier.UUIDString); return [NEFilterDataVerdict allowVerdict]; } 1. Why are handleInboundDataFromFlow and handleOutboundDataFromFlow sometimes not called? 2. If filtering for a flow, is it necessary not only to handle handleInboundDataFromFlow and handleOutboundDataFromFlow, but also to handle handleInboundDataCompleteForFlow and handleOutboundDataCompleteForFlow to ensure that all packets are processed? This is to avoid situations where some packets do not have a verdict returned, leading to a loss of internet connectivity. 3. In the context of flow handling, does handleInboundDataFromFlow or handleInboundDataCompleteForFlow get called exclusively, and similarly, does handleOutboundDataFromFlow or handleOutboundDataCompleteForFlow get called exclusively?
Posted
by