I am developing a macOS virtual audio device using an Audio Server Plug-In (HAL). I want the virtual device to be visible to all applications only when my main app is running, and completely hidden from all apps when the app is closed. The goal is to dynamically control device visibility based on app state without reinstalling the driver.What is the recommended way for the app to notify the HAL plug-in about its running or closed state ? Any guidance on best-practice architecture for this scenario would be appreciated.
Delve into the world of built-in app and system services available to developers. Discuss leveraging these services to enhance your app's functionality and user experience.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Hey guys,
This is a general question, but I have been working on an app for a while and I would like to to introduce IAP to the app. I have no clue where to start and chat GPT is no help. I also tried to vibe coding the IAP function and that didn't work out well. Any material or advice would help.
Topic:
App & System Services
SubTopic:
StoreKit
I configured my app to show a Live Activity when an alarm rings using AlarmKit. However, if I dismiss the Live Activity by tapping somewhere other than the X button, and then long-press the Dynamic Island, a new Live Activity appears that is long but contains no information.
Currently, the only way I can remove this empty Live Activity is to press the X button while the alarm is in the snooze state. Pressing the X button on the initial alarm does not remove it.
Is there any way to prevent this behavior or properly handle / clean up this empty Live Activity?
iOS Intermittent Bug: UserDefaults Preferences Loading Issue
Problem Summary
We're experiencing an intermittent issue where UserPreferences.shared.preferences returns inconsistent values even after calling getPreferences(). The behavior is unpredictable and affects critical functionality.
Environment
iOS Version: 15+
Language: Objective-C with Swift interop
Storage: UserDefaults with App Group (group.com.jci.tyco.glss)
Architecture: Singleton pattern for UserPreferences (Swift class)
The Issue
When a push notification arrives and triggers the showEvent: method, user preferences are sometimes loaded correctly and sometimes return nil or default values:
Scenario A (Works - ~60% of time):
Scenario B (Fails - ~40% of time):
Observed Pattern
From extensive logging over multiple test runs:
Key Observation:
At app launch: Preferences often load successfully
Seconds later when push arrives: Same preferences become unavailable
User navigates to another screen and back: Preferences suddenly work again
Code Structure
Objective-C AppDelegate.m
- (void)showEvent:(FMEvent *)event eventReadSource:(FMEventReadSourceType)eventSource {
BOOL isUserRoleEndUser = [[FMUserRolesRepository instance] userRoleAvailable:FMUserRoleEndUser];
UserPreferences *userPrefs = [UserPreferences shared];
[userPrefs getPreferences]; // ← Called here
// Immediately after, sometimes nil!
bool hasFireAudio = [userPrefs.preferences.fireAudio.lowercaseString isEqual:@"true"];
NSLog(@"isUserRoleEndUser: %d | Fire Audio: %d", isUserRoleEndUser, hasFireAudio);
// Decision logic based on preferences
if ([FMConstants getUserRegion] == UserRegionUK &&
isUserRoleEndUser &&
userPrefs.preferences && // ← Sometimes nil here
hasFireAudio) {
// Show Screen A
} else {
// Show Screen B
}
}
```class UserPreferences: NSObject {
static let shared = UserPreferences()
var preferences: FMUserPreferencesInfo? // ← This becomes nil intermittently
func getPreferences() {
let userDefaults = UserDefaults(suiteName: "group.com.jci.tyco.glss")
if let data = userDefaults?.data(forKey: "UserPreferences") {
// Decode and set preferences
self.preferences = // decoded object
} else {
// Create default preferences with fireAudio = "false"
self.preferences = FMUserPreferencesInfo()
}
}
}
I'm building a voice-to-text keyboard extension that needs to open the main app briefly for audio recording (since keyboard extensions can't record audio), then return the user to their original app.
The flow I'm trying to achieve:
User is in WhatsApp (or Messages, Slack, etc.)
User taps "Voice" button in my keyboard
My main app opens via deep link (myapp://keyboard/dictation)
App starts recording
App automatically returns user to WhatsApp
I cannot find a way to detect which app the keyboard is running inside, or which app opened my main app via the deep link.
UIInputViewController.textDocumentProxy - No host app information available
UIApplication.OpenURLOptionsKey.sourceApplication in application(_:open:options:) - When opened from a keyboard extension, does this return the host app bundle ID or the keyboard extension bundle ID?
Private APIs (for research only, not production):
_hostBundleID on UIInputViewController - blocked/returns nil on iOS 18
KVC approaches - all blocked
Hardcoded app support - Works but requires maintaining a list of popular apps and showing multiple buttons instead of a single "Voice" button
My questions:
When a keyboard extension triggers a URL open (via SwiftUI Link or UIApplication.shared.open), what does sourceApplication contain? The host app or the keyboard extension?
Is there any supported way for a main app to know which app it was launched from, specifically when that launch originated from a keyboard extension?
How do apps like "Wispr Flow" achieve seamless return-to-app with a single voice button? They seem to auto-return to whatever app the user was in.
Environment:
iOS 18.0+
Xcode 16
SwiftUI keyboard using KeyboardKit
Any guidance on the recommended approach would be greatly appreciated. I understand there may be privacy reasons for limiting host app detection, but the UX of requiring users to manually swipe back (or tap app-specific buttons) is significantly worse than automatic return.
Hello,
I have a few questions regarding URL Filter (iOS 26) and Content Filter Providers.
URL Filter
According to the WWDC26 video, URL Filter appears to be available for both consumer and enterprise deployments.
This seems consistent with the classic Network Extension Provider Deployment documentation (TN3134 – August 2025), where no specific deployment restriction is mentioned.
However, a more recent document (Apple Platform Deployment, September 2025) indicates the following for URL Filter:
“Requires supervision on iPhone, iPad and Mac” (with a green checkmark).
👉 My question:
Is URL Filter actually available for consumer use on non-supervised iPhones (deployed on Testflight and AppStore), or is supervision now required?
Content Filter Providers
From past experience, I remember that Content Filter Providers were only available on supervised devices.
Based on the current documentation, I am questioning their usability in a consumer context, i.e. on non-supervised iPhones.
In the Network Extension Provider Deployment documentation, it is stated that this is a Network Extension and that, since iOS 16, it is a “per-app on managed device” restriction.
In the more recent Apple Platform Deployment document, it states for iPhone and iPad:
“App needs to be installed on the user’s iOS and iPadOS device and deletion can be prevented if the device is supervised.”
👉 My understanding:
Supervised device:
The Content Filter Provider is installed via a host application that controls enabling/disabling the filter, and the host app can be prevented from being removed thanks to supervision.
Non-supervised device:
The Content Filter Provider is also installed via a host application that controls enabling/disabling the filter, but the app can be removed by the user, which would remove the filter.
👉 My question:
Can Content Filter Providers be used in a consumer context on non-supervised iPhones (deployed on Testflight and AppStore), accepting that the user can uninstall the host app (and therefore remove the filter)?
Thank you in advance for your feedback.
Sources:
TN3134 => TN3134: Network Extension provider deployment | Apple Developer Documentation
Apple Platform Deployment / Filter content for Apple devices => https://support.apple.com/en-gb/guide/deployment/dep1129ff8d2/1/web/1.0
Topic:
App & System Services
SubTopic:
Networking
Hi everyone,
I’m working on an offline-first iOS app using Core Data.
I have a question about safe future updates: in my project, I want to be able to add new optional fields to existing Entities or even completely new Entities in future versions — but nothing else (no renaming, deleting, or type changes).
Here’s how my current PersistenceController looks:
import CoreData
struct PersistenceController {
static let shared = PersistenceController()
let container: NSPersistentContainer
init(inMemory: Bool = false) {
container = NSPersistentContainer(name: "MyApp")
if inMemory {
container.persistentStoreDescriptions.first!.url = URL(fileURLWithPath: "/dev/null")
}
container.loadPersistentStores(completionHandler: { (storeDescription, error) in
if let error = error as NSError? {
print("Core Data failed to load store: \(error), \(error.userInfo)")
}
})
container.viewContext.automaticallyMergesChangesFromParent = true
}
}
Do I need to explicitly set these properties to ensure lightweight migration works?
shouldMigrateStoreAutomatically = true
shouldInferMappingModelAutomatically = true
Or, according to the documentation, are they already true by default, so I can safely add optional fields and new Entities in future versions without breaking users’ existing data?
Thanks in advance for your guidance!
We are using Multipeer Connectivity (MCSession, MCNearbyServiceBrowser, MCNearbyServiceAdvertiser) for nearby peer discovery and communication.
**Observed behaviour: **
When Wi-Fi is ON (Not connected to any network) and Mobile Data is also ON:
Peer discovery (foundPeer) consistently succeeds
Invitation is sent using invitePeer
MCSession transitions to .connecting
The session remains indefinitely in .connecting
connected is never reached
notConnected is also not reported
When Mobile Data is turned OFF, the same flow reliably reaches .connected.
Key details:
Both devices have Wi-Fi and Bluetooth enabled
Browsing and advertising are active on both devices
Application-level timeouts and session resets are implemented
The Issue is reproducible across multiple devices with iOS 26 versions.
Expectation / Question:
We understand that Multipeer Connectivity does not use cellular data for peer discovery or transport. However, when Wi-Fi is available and peers are discovered successfully, we would like clarification on the following:
Is it expected behavior that enabling Mobile Data can cause the invitation/connection phase to remain indefinitely in .connecting without transitioning to .notConnected?
Are there recommended best practices to avoid stalled invitation or transport negotiation in this scenario?
Is there a supported way to detect or recover from a stalled .connecting state beyond application-level timeouts and session resets?
Any guidance on expected behavior or recommended handling would be appreciated.
Hi,
We are distributing pk pass files via a web browser. When a user taps Add in the system pass preview, the pass is added successfully, the preview is dismissed, and the user remains in the browser.
From a user experience perspective, we would like to better guide users to their newly added pass in Apple Wallet.
Is there a supported API, URL scheme, or documented mechanism that allows a web-based flow to transition the user to the Wallet app after a pass has been added?
If direct app transitions are not supported in this scenario, what is the recommended best practice for helping users locate and open their newly added pass in Wallet?
Thank you for your guidance.
Issue
After upgrading to Tahoe 26.2, print queues monitored by PaperCut no longer work. The print queue gets paused, and the jobs fail to print.
This issue was discovered during our internal testing prior to the Tahoe 26.2 public release, and a growing number of our mutual customers have also reported it since then.
Root cause
This appears to be due to changes in the behavior of CUPS Sandbox restrictions, which prevent the backend (and filter) from reading/writing to the PaperCut install folder.
Error messages
From syslog.
2025-12-22 16:41:59.283761+1100 0x1daf61 Error 0x0 0 0 kernel: (Sandbox) Sandbox: papercut(5783) deny(1) file-write-data /Library/Printers/PaperCut/Print Provider/print-provider.log
When trying to create a TCP socket from the PaperCut filter.
2025-12-15 19:50:08,403 ERROR: os_tcp_socket_create: getaddrinfo failed: nodename nor servname provided, or not known
Technical details
PaperCut implements print queue monitoring using a CUPS backend (and filter).
CUPS backends and filters run in a security 'sandbox' which limits what they can do (such as file/folder access, create network sockets, and execute sub-processes, etc.).
The PaperCut backend (and filter) relies on some of these operations, so to function correctly, our code updates /etc/cups/cups-files.conf with "Sandboxing relaxed".
Until 26.2, this relaxed mode allowed us to read/write to PaperCut folders, create TCP sockets to communicate with the local PaperCut Application Server, and execute/kill sub-processes.
As an alternative to the relaxed mode, we also tried "Sandboxing off", but that doesn't help either (from CUPS scheduler/conf.h).
typedef enum
{
CUPSD_SANDBOXING_OFF, /* No sandboxing */
CUPSD_SANDBOXING_RELAXED, /* Relaxed sandboxing */
CUPSD_SANDBOXING_STRICT /* Strict sandboxing */
} cupsd_sandboxing_t;
Test code
We can provide a simplified version of our backend that demonstrates the issue if required
Questions
Has the CUPS sandbox relaxing changed? According to the CUPS man pages (cups-files.conf(5)), "Sandboxing relaxed" should still work as before.
If this is the new intended behavior, what are the other options/directives we can use to relax the limitations on CUPS backends and filters?
We have 2 monthly subscription tiers that are part of a subscription group, and always have been part of this group. Both are configured with a 1 month trial introductory offer. According to the documentation for auto-renewable subscriptions,:
Users can subscribe to one subscription product per group at a time.
And yet several users have managed to start trials of both products in this group simultaneously, which converted to paid subscriptions after the expiration of the trials, and now are being concurrently billed by Apple for both. How do we completely prevent this from happening?
Hi, When I try to add a card to wallet, I get this PKPassKitErrorDomain Code=2 error from my logs, and from the SysDiagnose, I get some more detailed error log
Error details:
Date: December 15, 2025
Time: 15:16 UTC
Request URL:
https://nc-pod9-smp-device.apple.com:443/broker/v4/devices/041B4183BA1490022104102123315131EBFE2BE7…
Response:
HTTP Status: 500 – Internal Server Error
Time profile: 0.505452 seconds
Response headers:
Server: Apple
Content-Type: text/html
X-Content-Type-Options: nosniffStrict-Transport-Security: max-age=31536000; includeSubdomainsDate: Mon, 15 Dec 2025 15:16:59 GMT
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=blockCross-Origin-Opener-Policy: same-origin
Content-Length: 170 Connection: close
Response body:
Anyone have faced this problem before?
Hi everyone,
In the simple app below, I have a QueryView that has LazyVStack containing 100k TextField's that edit the item's content. The items are fetched with a @Query. On launch, the app will generate 100k items. Once created, when I press any of the TextField's , a severe hang happens, and every time I type a single character, it will cause another hang over and over again.
I looked at it in Instruments and it shows that the main thread is busy during the duration of the hang (2.31 seconds) updating QueryView. From the cause and effect graph, the update is caused by @Observable QueryController <Item>.(Bool).
Why does it take too long to recalculate the view, given that it's in a LazyVStack? (In other words, why is the hang duration directly proportional to the number of items?)
How to fix the performance of this app? I thought adding LazyVStack was all I need to handle the large dataset, but maybe I need to add a custom pagination with .fetchLimit on top of that? (I understand that ModelActor would be an alternative to @Query because it will make the database operations happen outside of the main thread which will fix this problem, but with that I will lose the automatic fetching of @Query.)
Thank you for the help!
import SwiftData
import SwiftUI
@main
struct QueryPerformanceApp: App {
var body: some Scene {
WindowGroup {
ContentView()
.modelContainer(for: [Item.self], inMemory: true)
}
}
}
@Model
final class Item {
var name: String
init(name: String) {
self.name = name
}
}
struct ItemDetail: View {
@Bindable var item: Item
var body: some View {
TextField("Name", text: $item.name)
}
}
struct QueryView: View {
@Query private var items: [Item]
var body: some View {
ScrollView {
LazyVStack {
ForEach(items) { item in
VStack {
ItemDetail(item: item)
}
}
}
}
}
}
struct ContentView: View {
let itemCount = 100_000
@Environment(\.modelContext) private var context
@State private var isLoading = true
var body: some View {
Group {
if isLoading {
VStack(spacing: 16) {
ProgressView()
Text("Generating \(itemCount) items...")
}
} else {
QueryView()
}
}
.task {
for i in 1...itemCount {
context.insert(Item(name: "Item \(i)"))
}
try? context.save()
isLoading = false
}
}
}
We create custom VPN tunnel by overriding PacketTunnelProvider on MacOS. Normal VPN connection works seamlessly. But if we enable onDemand rules on VPN manager, intemittently during tunnel creation via OnDemand, internet goes away on machine leading to a connection stuck state.
Why does internet goes away during tunnel creation?
Hi there,
Does anyone know how to modify this Image compressor Shortcut https://www.icloud.com/shortcuts/e13d8013598f4f33830386a956a163dd so that the image it creates has the original file name + “-pressed”?
Eg “Image_123” becomes “Image_123-pressed”
I know of the action ‘Rename file’ but can’t make it work. The shortcut does batch processing of images if that makes any difference.
Any help much appreciated:)
Scenario:
User is actively subscribed to Monthly Package
From the Device App (Manage Subscriptions), user upgrades to Yearly Package
Purchase completes successfully on device
Issue: Do not receive any server notification for this action
Month Package Purchase Date: 2025-11-11 19:06:45.537 +0600 Month to Yearly Upgradation Date: 2025-12-11 paymentReferenceId: 510002270528780
Topic:
App & System Services
SubTopic:
Notifications
Tags:
App Store Server Notifications
Apple Pay
App Store Server API
Hi there,
Does anyone know how to modify this Image compressor Shortcut https://www.icloud.com/shortcuts/e13d8013598f4f33830386a956a163dd so that the image it creates has the original file name + “-pressed”?
Eg “Image_123” becomes “Image_123-pressed”
I know of the action ‘Rename file’ but can’t make it work. Any help much appreciated:)
We have an application which is written in Swift, which activates Transparent Proxy network extension. Our Transparent Proxy module is a system extension, which is exposing an app proxy provider interface (We are using NETransparentProxyProvider class and in extension’s Info.plist we use com.apple.networkextension.app-proxy key.)
Sometimes we have observed that on starting the transparent proxy extension, the startProxy overridden delegate method(override func startProxy(options: [String : Any]?, completionHandler: @escaping (Error?) -> Void) {) in our AppProxyProvider class which is derived from NETransparentProxyProvider being called more than once for the same extension(pid). This leads to Over-resume of an object crash as we invoke setTunnelNetworkSettings inside the startProxy delegate.
As this is controlled by the system, we are not sure why this delegate being called more than once sometimes even if we call the start TransparentProxy only once.
Note that, this issue is seen only in Mac OS Tahoe.
Apple Feedback ticket: FB21464147 (startProxy delegate for NETransparentProxyProvider class is being called twice for the same pid extension sometimes)
I have a SwiftData flashcard app which I am syncing with CloudKit using NSPersistentCloudKitContainer. While syncing itself is working perfectly, I have noticed a dramatic increase in the app size after enabling sync.
Specifically, without CloudKit, 15k flashcards results in the default.store file being about 4.5 MB. With CloudKit, default.store is about 67 MB. I have inspected the store and found that most of this increase is due to the ANSCKRECORDMETADATA table.
My question is, does implementing CloudKit normally cause this magnitude of increase in storage? If it doesn’t, is there something in my model, schema, implementation, etc. that could be causing it?
Below are two other posts describing a similar issue, but neither with a solution. I replied to the first one about a month ago. I then submitted this to Developer Technical Support, but was asked to post my question in the forums, so here it is.
Strange behavior with 100k+ records in NSPersistentCloudKitContainer
Huge increase in sqlite file size after adopting CloudKit
It works when one device is only a publisher and the other is only a subscriber. However, when both devices act as both publisher and subscriber simultaneously—which Apple’s documentation (https://developer.apple.com/documentation/wifiaware/adopting-wi-fi-aware#Declare-services) indicates is valid—the connection never establishes. After timing out, both NetworkListener and NetworkBrowser transition to the failed state. This appears to be a race condition in Network framework.
Task.detached {
try await NetworkListener(
for: .wifiAware(
.connecting(
to: .myService,
from: .allPairedDevices,
datapath: .defaults
)
),
using: .parameters {
Coder(
sending: ...,
receiving: ...,
using: NetworkJSONCoder()
) {
TCP()
}
}
).run { connection in
await self.add(connection: connection)
}
}
Task.detached {
try await NetworkBrowser(
for: .wifiAware(
.connecting(
to: .allPairedDevices,
from: .myService
)
),
using: .tcp
).run { endpoints in
for endpoint in endpoints {
await self.connect(to: endpoint)
}
}
}