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.

All subtopics

Post

Replies

Boosts

Views

Activity

Bundle A Command Line Tool With MacOS Sandbox App
Hello, I'm buiding a macos app where I bundled a command line tool (Python) with my app. I put the tool in ****.app/Contents/MacOS folder, but it seems like the tool can not execute/read/ access. I don't know if a sandbox app can access/create a folder inside ****.app/Contents folder??? If not where can I put the tool that can access from my macos app? Any idea would be appreciated!
2
0
160
3d
MapKit: Customize view shown by .mapFeatureSelectionAccessory
Hello, Probably a noob question but I can't find any example code around this use case, and really no past questions I could find that address it either. So, I really love that, when a user taps a POI on the map in my app, the map figures out the right POI every time. Flawless. However, when using .mapFeatureSelectionAccessory, I've tried probably 10-12 iterations, and there doesn't seem to be any way to either: a) add custom content to the place card that's shown, or b) replace that place card altogether with a view of my own, or c) capture the place data but use it in a custom view I want to be able to leverage the accuracy of Apple's tap gesture detection, but show, for example, only the name of the place, along with buttons and a form I have in a view. Right now if I'm using .mapFeatureSelectionAccessory, I can't seem to bypass the place card at all.
0
0
108
3d
ASDServerErrorDomain Code=3512
有人遇到这个问题吗,在支付的时候提示未知错误,具体的错误信息如下: 交易失败,outTradeNo:2025022631999900326, productId:com.f6car.p0001, error:Err-or -Domain=SKErrorDomain Code=0 "发生未知错误" UserInfo={NSLocalizedDescription=发生未知错误, NSUnderlyingError=0x302f50120 {Error Domain=ASDServerErrorDomain Code=3512 "无效的应用程序外部版本。" UserInfo={NSLocalizedFailureReason=无效的应用程序外部版本。}}} 寻求解决方案,感谢.
0
0
102
3d
Use Service Management API to Exit/Restart App
Hello, My current app bundle structure is I have a sandboxed GUI and a unsandboxed launch agent that does the core logic of my app. Our pkg post install scripts handles bootstrapping the Launch Agent plists defined in /Library/Launch Agents. I have been tasked with creating a restart/exit button on the UI which terminates the Launch Agent (essentially bootout command in launchctl) and terminates the UI as well. I have attempted to follow the SMAppServcice.agent(plistName) and changed Program key to BundleProgram and changed the value to the relative path as in example provided in Apple Docs (old launch agent plist attached, and new bundle build phase style attached. I have been unable to register or unregister the launch agent via the UI, and in the initial case when trying to call unregister the launch agent got removed and i got "Operation not permitted" with error kSMErrorInvalidSignature seems like some code signature issue im not aware of. I wasnt even able to bootstrap the launch agent back until I found a script which reset such launchctl settings. My question is: is the sandboxed UI not able to do this (and why is this not documented in the dev docs I have no idea), and if so then how would I go about terminating both services and also being able to restart them? This seems like a common use case the UI should be able to handle as far as ownership of running/booting out its resources. ).
3
0
160
3d
Accessory Setup Kit - Set WIFI SSID to ASAccessory after initial setup
I have an accessory which uses both Bluetooth and WiFi to communicate with the app. I am trying to migrate to Accessory Setup Kit. However, the API expects both the bluetooth identifiers and WIFI SSID or SSID prefix in the ASDiscoveryDescriptor. The problem is we only have the WIFI SSID after BLE pairing. Our current flow looks like this: Pair via BLE Connect via BLE Send a BLE command to request WIFI settings (SSID and password) (Each device has a different SSID and password) Connect to WI-FI hotspot by calling NEHotspotConfigurationManager applyConfiguration with the retrieved credentials. Is there a way to set the Wi-Fi SSID of an ASAccessory object after the initial setup? To use Accessory Setup Kit we would need something like this: Call Accessory Setup Kit with bluetooth identifiers in the descriptor, finish the setup and get ASAccessory object. Connect via BLE Send a BLE command to request WIFI settings (SSID and password) Set the SSID of the ASAccessory to the retrieved value. Connect to WI-FI hotspot by calling `NEHotspotConfigurationManager joinAccessoryHotspot. Thanks!
0
0
121
4d
Unknown app crash issue
Hello. Recently, there have been many app crash issues of unknown causes. It has been reported that the app crashes as soon as it is launched, but it is difficult to resolve the issue because it cannot be reproduced. I have attached the crash log, so please review it and provide appropriate guidance. Thank you. 2025-02-28_06-02-16.3498_+0900-65dfc1f2a58da46e9ec11a5f0f93f5a56c6858de.crash
1
0
144
4d
iOS Blocking Websocket Reconnection After Multiple VoIP Push Notifications
Hello, We have a Push-to-Talk (PTT) application that is already well established and widely used. Our app has the proper VoIP entitlement, which we are using to wake up the app and establish a WebSocket connection for real-time communication. We are also using CallKit as a supporting mechanism, but not as the primary interaction upon receiving the VoIP Push, since our use case differs from traditional full-duplex VoIP calls. While our implementation works correctly in many cases, we have noticed a consistent issue where, after multiple VoIP Push notifications, the system still delivers the push, but prevents the WebSocket from reconnecting. At this point, all connection attempts return errors such as: • "Software caused connection abort" This issue persists until the app is manually relaunched, after which the behavior resets and repeats. We are aware that VoIP Push was originally designed for full-duplex calls, but since Apple allows its use for other purposes through the entitlement, we would like to understand why this limitation is occurring and how to handle it properly. Questions: 1. Is iOS enforcing stricter background execution rules after multiple VoIP Push events within a short period? 2. Are there any recommended best practices to ensure reliable WebSocket reconnection in this scenario?
0
6
168
4d
iOS app crash when both .backgroundTask() and .scenePhase in App file
I've been having trouble with .backgroundTask(.appRefresh()) causing an intermittent crash when my app is launched. When the crash happens, the app flashes a darkened screen with the home screen device information (time-of-day, battery life, etc) weirdly pivoted landscape and right-justified. This screen shows for a split-second, disappears, and the app does NOT launch. Re-tapping the app icon will often re-launch the app without incident. After much trouble-shooting, I've discovered that commenting out EITHER @Environment(\.scenePhase) private var phase or the .backgroundTask(.appRefresh()) {} code eliminates the crash, so it's somehow caused by having both present at the same time. As you can see in the example below, it's not even necessary to actually use .scenePhase or .backgroundTask to run any other code in order to create the crash. The following minimal reproducible example will create the crash on an actual device, although you may need to launch and quit the app in quick succession 10-20 times to see the crash. (I realize most users aren't likely to do that - sometimes the crash occurs in the actual app on the first launch. But it's an intermittent problem so may require a few testing rounds to appear.) In addition to the code shown here, I've added the "Background Modes" capability with "Background Fetch" to "Signing & Capabilities" and added the "UpdateBadge" task to "Info" as a "Permitted background task scheduler identifier". Any idea what could be causing the crash and how to prevent it? struct ToyBackgroundTasksApp: App { @Environment(\.scenePhase) private var phase var sharedModelContainer: ModelContainer = { let schema = Schema([ Item.self, ]) let modelConfiguration = ModelConfiguration(schema: schema, isStoredInMemoryOnly: false) do { return try ModelContainer(for: schema, configurations: [modelConfiguration]) } catch { fatalError("Could not create ModelContainer: \(error)") } }() var body: some Scene { WindowGroup { ContentView() } .modelContainer(sharedModelContainer) .backgroundTask(.appRefresh("UpdateBadge")) { print("background task") } } }
3
0
132
4d
OSX and ARP spoofing
Here's a simple program that spoofs an ARP reply for a given IP address. If I spin up two terminal sessions on the same machine. Run this code in one window % ./spoof en0 192.168.1.7 Listening on en0 for ARP requests to 192.168.1.7 Spoofing MAC: 00:0c:87:47:50:27 And in the second window cause the OS to issue an ARP_REQ % ping 192.168.1.7 You will see the program respond to the ARP request. (Wireshark will see the ARP_REQ and ARP_REPLY packets) however my arp table isn't updated with the MAC for the IP address. There is no firewall active. % arp -a|grep 192.168.1.7 (192.168.1.7) at (incomplete) on en0 ifscope [ethernet] This is running on a MacBook pro M3 (OSX 15.4). HOWEVER, on a MacBook pro M4 (OSX 15.2) is does Work !!!!! Can anyone explain why its not working? spoof.txt
2
0
278
4d
Swiftdata - reset the database from archived files with swiftui without a app restart
HI, swiftdata is new to me and any help would be appreciated. In my swiftui app I have a functionality that reinstates the database from an archive. I first move the three database files (database.store datebase.store-wal and database.store-shm) to a new name (.tmp added for backup incase) and then copy the Archived three files to the same location. the move creates the following errors: " BUG IN CLIENT OF libsqlite3.dylib: database integrity compromised by API violation: vnode renamed while in use: /private/var/mobile/Containers/Data/Application/499A6802-02E5-4547-83C4-88389AEA50F5/Library/Application Support/database.store.tmp invalidated open fd: 4 (0x20)" I get the same message in console for all three files. then I reinitialise the model container and get no errors as my code below .... let schema = Schema([....my different models are here]) let config = ModelConfiguration("database", schema: schema) do { // Recreate the container with the same store URL let container = try ModelContainer(for: schema, configurations: config) print("ModelContainer reinitialized successfully!") } catch { print("Failed to reinitialize ModelContainer: (error)") } } I get the success message but when I leave the view (backup-restore view) to the main view I get: CoreData: error: (6922) I/O error for database at /var/mobile/Containers/Data/Application/499A6802-02E5-4547-83C4-88389AEA50F5/Library/Application Support/database.store. SQLite error code:6922, 'disk I/O error' and error: SQLCore dispatchRequest: exception handling request: <NSSQLFetchRequestContext: 0x302920460> , I/O error for database at /var/mobile/Containers/Data/Application/499A6802-02E5-4547-83C4-88389AEA50F5/Library/Application Support/database.store. SQLite error code:6922, 'disk I/O error' with userInfo of { NSFilePath = "/var/mobile/Containers/Data/Application/499A6802-02E5-4547-83C4-88389AEA50F5/Library/Application Support/database.store"; NSSQLiteErrorDomain = 6922; } error: -executeRequest: encountered exception = I/O error for database at /var/mobile/Containers/Data/Application/499A6802-02E5-4547-83C4-88389AEA50F5/Library/Application Support/database.store. SQLite error code:6922, 'disk I/O error' with userInfo = { NSFilePath = "/var/mobile/Containers/Data/Application/499A6802-02E5-4547-83C4-88389AEA50F5/Library/Application Support/database.store"; NSSQLiteErrorDomain = 6922; } CoreData: error: SQLCore dispatchRequest: exception handling request: <NSSQLFetchRequestContext: 0x302920460> , I/O error for database at /var/mobile/Containers/Data/Application/499A6802-02E5-4547-83C4-88389AEA50F5/Library/Application Support/database.store. SQLite error code:6922, 'disk I/O error' with userInfo of { NSFilePath = "/var/mobile/Containers/Data/Application/499A6802-02E5-4547-83C4-88389AEA50F5/Library/Application Support/database.store"; NSSQLiteErrorDomain = 6922; } Can anyone let me know how I should go about this - reseting the database from old backup files by copying over them. or if there is a way to stop the database and restart it with the new files in swiftdata my app is an ios app for phone and ipad
2
0
226
4d
Only the last notification is being delivered
Good morning all! We are facing a specific case dealing with push notifications to iOS devices. In my scenario: I turn off my device's internet Send multiple push notifications via server using Firebase. I turned ON my device's internet again. I only see the last push notification I sent. This is an expected scenario? There is any documentation that supports this statement? Thank you all!
1
0
138
4d
Bachelor Thesis -Geolocation
Hello, I write a Bachelor-Theses about Geolocation on an iPhone. I have a Signal-generator from R&S to simulate GPS-Data. I write an App on an Android-Phone and can readout the GPS-ID and the strength from the signal and the time and Position for Geolocation zb. Island or Africa like this. Now my thesis is about the iPhone and I write an App for get the location manager Geolocation and to save it to a sqlite-database with longitude, latitude and time. But the App recognizes only the real world for geolocation on GPS (LTE and Wlan are disabled!). With my Radio-Generator it would not recognize any Geolocation like the Android phone.? So I need some fast help for my thesis, where are my problems? I allready have a function like this: func updateAccuracy(highAccuracy: Bool) { locationManager.desiredAccuracy = highAccuracy ? kCLLocationAccuracyBestForNavigation : kCLLocationAccuracyHundredMeters print("🎯 GPS-Genauigkeit geändert: (highAccuracy ? "Hoch" : "Plane-Genauigkeit")") } but nothing happens? Best regards
1
0
191
4d
ObjectBox store DB issue with sandbox in mac flutter app for production
I am working on Flutter MAC app. And using ObjectBox store DB for local data saving. When i am setting Sandbox - NO, It is working fine. But when i am setting Sandbox - YES for production MAC flutter app - It is giving error and getting black screen only Getting error- Error initializing ObjectBox store: StorageException: failed to create store: Could not open database environment; please check options and file system (1: Operation not permitted) (OBX_ERROR code 10199)
1
0
133
4d
Validating receipt for iOS in-app purchase always returns error 21002
I'm receiving the following error when attempting to validate an in‑app purchase receipt: Certificate verification failed at depth 0 : forge.pki.UnknownCertificateAuthority Certificate chain validation failed: Certificate is not trusted. This error occurs during the certificate chain validation process of the receipt's PKCS#7 container. My implementation uses node‑forge to decode the receipt, extract the embedded certificate chain, and verify that the chain properly links from the leaf certificate (which directly signed the receipt) through the intermediate certificate to the trusted Apple Inc. Root certificate. What the Error Indicates: "UnknownCertificateAuthority" at depth 0: This suggests that the leaf certificate in the receipt is not being recognized as part of a valid chain because it cannot be linked back to a trusted root in my CA store. "Certificate chain validation failed: Certificate is not trusted": This means that the entire certificate chain does not chain up to a trusted certificate authority (in this case, the Apple Inc. Root certificate) as expected. Steps Taken: I verified that the receipt is a valid PKCS#7 container. I extracted the certificate chain from the receipt. However, the receipt only provided the leaf certificate. I manually added the intermediate certificate (AppleWWDRCAG5.pem) to complete the chain. I loaded the official Apple Inc. Root certificate (AppleIncRootCertificate.pem) into my CA store. Despite these steps, the validation still fails at depth 0, indicating that the leaf certificate is not recognized as being issued by a trusted authority. Request for Assistance: Could you please help clarify the following points: Is the certificate chain for receipts (leaf → intermediate → Apple Inc. Root) as expected, or has there been any change in the chain that I should account for? Is there a recommended or updated intermediate certificate I should be using for receipt validation? Are there known issues or recent changes on Apple's side that might cause the leaf certificate to not be recognized as part of a valid chain? Any guidance to resolve this certificate chain validation error would be greatly appreciated.
0
0
109
4d
Apple TV and connected TV restarting on Power off
Since tvOS 18.4 beta (22L5218l) i have the issue that When I turn off an Apple TV, the Apple TV and the connected TV turn off, but after a few seconds the devices start again. This never happened before. But now it is happening with 3 different Apple TV generations on 2 LG and 1 Telefunken TVs. All 3 Apple TV devices have been updated to tvOS 18.4 beta (22L5218l) and since then show this error.
2
0
135
4d
AirDrop Monitoring Issue After Sequoia Update – Missing File Detections
We have an application that integrates with the sharingd driver to monitor data transfers via AirDrop. Additionally, we utilize the Endpoint Security API to track file access and application activities. Prior to the Sequoia update, our solution was effectively detecting and blocking sensitive files sent via AirDrop. However, following the update, our drivers are no longer detecting these file transfers. Could you confirm if there have been any changes to the Endpoint Security API, sharingd, or any other relevant system components that might be affecting this behavior? Any insights or documentation on recent modifications would be greatly appreciated. Thanks.
1
0
118
4d
Live Caller ID Lookup - CipherMLError.missingSecre t Ke y error
I'm trying to implement live caller id PIR server in python and I have an issue related to evaluation key config. I don't receive the POST /key request even if I try to install the extension on new device and I had this error in device system logs: error 11:21:30.663022+0200 ciphermld requestData(byKeywords:shardIds:clientConfig:) threw an error: CipherML.CipherMLError.missingSecre t Ke y I think the reason why the evaluation key is not generated is related to this error but I'm not sure. It might be also related to HE params - I tried with the same params as in swift server example with plaintext_modulus=17 and it works, but for plaintext_modulus=65537 on the same device the system doesn't send me the evaluation key. Is there a limitation that restricts the evaluation key generation for some HE params? There is how the entire config object that I retrieve looks like: { "configs": { "Live-C aller-ID-Lookup. TestLiveCallerI D.iden tity": { "pir_config": { "encry ption_p aram eters": { "pol ynomial_deg ree": "4096", "plaint ext_mo dulus": "65537", "coeff icient_m oduli": [ "134176769", "268369921", "268361729" ], "secu rity_le vel": "SECU RITY LEVEL QUANT UM128", "h e_sc heme": "H E_SC HEM E_B F V" }, "shard_configs": [ { "num_entries": "2", "entry_size": "55991", "dimensions": [ "2", "1" ], "shard_id": "" } ], "keyword_pir_params": { "num_hash_functions": "2", "sharding_function": { "sha256": {} } }, "algorithm": "PIR _ALGO RITHM _MUL_PIR", "batch_size": "2", "evalu ation_ke config_hash": "" }, "config_id": "" } }, "key_info": [ { "timestamp": "1738660849", "key_config": { "encryp tion_par ameters": { "polynomial_degree": "4096", "plaintex t_mo dulus": "65537", "coeffic ient_m oduli": [ "134176769", "268369921", "268361729" ], "secu rity_level": "SECUR ITY_LEVEL_QU ANTUM128", "he_sc heme": "HE_SC HEME_BFV" }, "gal ois_e lements": [ 20 49, 40 97 ], "has _rel in_key": true } } ] } PS evaluation key data is just a placeholder, but anyway it should be skipped cause of expired timestamp More logs: ```language default 11:21:30.535865+0200 ciphermld Running rotation task for ["Live-Caller-ID-Lookup.TestLiveCallerID.identity"] info 11:21:30.535953+0200 ciphermld Skipping groups that manage their own networking: <private> default 11:21:30.537007+0200 ciphermld Request to fetchConfigs has started for useCases '["Li ve-Caller-ID-Lookup.TestLiveCallerID.identity"]', userId: '<private>', existingConfigIds: '["id"]' default 11:21:30.542174+0200 ciphermld Request to queries-batch has started for userId: '<private>', length: 28350 default 11:21:30.655914+0200 ciphermld Request to fetchConfigs has finished, response length: 230 default 11:21:30.656182+0200 ciphermld Received configurations: 1 usecase(s), 1 key(s) for group 'Live-Caller-ID-Lookup.TestLiveCallerID.identity' debug 11:21:30.660868+0200 ciphermld Skipping non-active key: timestamp: 1738660849 key_config { encryption_parameters { polynomial_degree: 4096 plaintext_modulus: 65537 coefficient_moduli: [134176769, 268369921, 268361729] security_level: Quantum128 he_scheme: BFV } galois_elements: [2049, 4097] has_relin_key: true } error 11:21:30.662982+0200 ciphermld No key for use-case 'Live-Caller-ID-Lookup.TestLiveCallerID.identity' error 11:21:30.663022+0200 ciphermld requestData(byKeywords:shardIds:clientConfig:) threw an error: CipherML.CipherMLError.missingSecre t Ke y default 11:21:30.663824+0200 com.apple.CallKit.CallDirectory <private> XPC request complete, results(0) error:Error Domain=CipherML.CipherMLError Code=32 "missing secre t ke y" UserInfo={NSLocalizedDescription=missing secre t ke y} default 11:21:30.972372+0200 ciphermld Request to queries-batch has finished response, length: 0 default 11:21:30.974711+0200 com.apple.CallKit.CallDirectory <private> XPC request complete, results(1) error:(null) default 11:21:36.161964+0200 com.apple.CallKit.CallDirectory <private> Sending XPC request default 11:21:36.163149+0200 com.apple.CallKit.CallDirectory <private> Sending XPC request default 11:21:36.169931+0200 ciphermld requestData(byKeywords:shardIds:clientConfig:) method was called default 11:21:36.170448+0200 ciphermld requestData(byKeywords:shardIds:clientConfig:) method was called default 11:21:36.174001+0200 ciphermld Cached: 0 / Missing: 1 error 11:21:36.174997+0200 ciphermld No userId or secre t Ke y for use-case '.Lve-Caller-ID-Lookup.TestLiveCallerID.identity'. Running rotation task' default 11:21:36.175075+0200 ciphermld Running rotation task for ["Live-Caller-ID-Lookup.TestLiveCallerID.identity"] info 11:21:36.175240+0200 ciphermld Skipping groups that manage their own networking: <private> default 11:21:36.177700+0200 ciphermld Request to fetchConfigs has started for useCases '["Live-Caller-ID-Lookup.TestLiveCallerID.identity"]', userId: '<private>', existingConfigIds: '["id"]' default 11:21:36.179914+0200 ciphermld Request to queries-batch has started for userId: '<private>', length: 28350 default 11:21:36.336051+0200 ciphermld Request to fetchConfigs has finished, response length: 230 default 11:21:36.336308+0200 ciphermld Received configurations: 1 usecase(s), 1 key(s) for group 'Live-Caller-ID-Lookup.TestLiveCallerID.identity' debug 11:21:36.341522+0200 ciphermld Skipping non-active key: timestamp: 1738660849 key_config { encryption_parameters { polynomial_degree: 4096 plaintext_modulus: 65537 coefficient_moduli: [134176769, 268369921, 268361729] security_level: Quantum128 he_scheme: BFV } galois_elements: [2049, 4097] has_relin_key: true } error 11:21:36.356497+0200 ciphermld No key for use-case 'Live-Caller-ID-Lookup.TestLiveCallerID.identity' error 11:21:36.356669+0200 ciphermld requestData(byKeywords:shardIds:clientConfig:) threw an error: CipherML.CipherMLError.missingSecre t Ke y default 11:21:36.357075+0200 com.apple.CallKit.CallDirectory <private> XPC request complete, results(0) error:Error Domain=CipherML.CipherMLError Code=32 "missing secre t ke y" UserInfo={NSLocalizedDescription=missing secre t ke y} default 11:21:36.625701+0200 ciphermld Request to queries-batch has finished response, length: 0 default 11:21:36.626749+0200 com.apple.CallKit.CallDirectory
0
0
84
4d
Will an iPhone reconnect automatically to a wifi network we connected to previously with joinOnce = false?
PLATFORM AND VERSION: iOS Development environment: Xcode 15.3, macOS 14.7.1 (23H222) Run-time configuration: iOS 18.3.1 DESCRIPTION OF PROBLEM: Our app uses NEHotspotConfigurationManager with joinOnce set to false to connect to an IoT device's Wi-Fi hotspot. Later, we programmatically disconnect from this hotspot. We are wondering if, after this programmatic disconnection, there is a possibility that the iPhone will automatically reconnect to the hotspot (even when our app is not running). Does it matter if the hotspot's SSID is hidden or not? This concern arises because the iPhone is already familiar with the hotspot's network configuration. Our testing indicates that this does not happen, but we want to be certain. This is a behavior we do NOT want to occur. We set joinOnce to false because we experience connectivity issues with the IoT device when joinOnce is true (there are several discussions in forums regarding issues with setting it to true). Thank you. Thanks.
4
0
154
4d