Overview
I am running a NearbyInteaction sample.
Immediately after niSession.run(configuration!), func session(_ session: NISession, didInvalidateWith error: Error) is executed. The error is as follows, but I cannot find the cause.
Error:
bluetoothPeerIdentifier: AF5ADDC1-F731-7BAD-E8C5-9230E79F8C1A
Session Invalidation Error: NIERROR_ACCESSORY_PEER_DEVICE_UNAVAILABLE_DESCRIPTION
Error Details:Error Domain=com.apple.NearbyInteraction Code=-5882 "NIERROR_ACCESSORY_PEER_DEVICE_UNAVAILABLE_DESCRIPTION" UserInfo={NSLocalizedRecoverySuggestion=NIERROR_ACCESSORY_PEER_DEVICE_UNAVAILABLE_RECOVERY_SUGGESTION, NSLocalizedDescription=NIERROR_ACCESSORY_PEER_DEVICE_UNAVAILABLE_DESCRIPTION, NSLocalizedFailureReason=NIERROR_ACCESSORY_PEER_DEVICE_UNAVAILABLE_FAILURE_REASON}
The sample application worked well at first.
I want the application to run in the background, so I made the following changes and had problems.
Before change:
configuration = try NINearbyAccessoryConfiguration(data: configData)
After change:
configuration = try NINearbyAccessoryConfiguration(
accessoryData: configData,
bluetoothPeerIdentifier: peerIdentifier)
I see no problem with the application. It works fine on device A. The problem occurs on device B.
Device A: NXP QN9090 - NXP SR150
Device B: Nordic nRF52840 - NXP SR150
I have confirmed that the device shows up in the settings app after pairing & bonding the device.
I have confirmed that the iPhone and nRF52840 are still connected to the BLE without any problems when the error occurs.
Initialization code for NearbyInteraction:
func setupAccessory(_ configData: Data, name: String) {
updateInfoLabel(with: "Received configuration data from '\(name)'. Running session.")
do {
guard let discoveredPeripheral = dataChannel.getDiscoveredPeripheral() else {
return
}
let peerIdentifier = discoveredPeripheral.identifier
configuration = try NINearbyAccessoryConfiguration(
accessoryData: configData,
bluetoothPeerIdentifier: peerIdentifier)
} catch {
// Stop and display the issue because the incoming data is invalid.
// In your app, debug the accessory data to ensure an expected
// format.
updateInfoLabel(
with:
"Failed to create NINearbyAccessoryConfiguration for '\(name)'. Error: \(error)"
)
return
}
// Cache the token to correlate updates with this accessory.
cacheToken(configuration!.accessoryDiscoveryToken, accessoryName: name)
niSession.run(configuration!)
}
Environment
Xcode 16.1
iPhone11 (iOS 17.6.1)
Target UWB Chip: NXP SR150
Sample iOS Application: https://developer.apple.com/documentation/nearbyinteraction/implementing-spatial-interactions-with-third-party-accessories
General
RSS for tagDelve 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
Hi all. I need to save an array of strings in userdefaults. I am using
NSKeyedArchiver.archivedData(withRootObject: rootObject, requiringSecureCoding: false)
to convert array of string to data and then save it in userdefaults.
Inorder to retrieve the data back, I am using
let data = self.userDefaults.data(forKey: "key")!
let unarchiver = try NSKeyedUnarchiver(forReadingFrom: data)
unarchiver.requiresSecureCoding = false
let array = unarchiver.decodeObject(forKey: NSKeyedArchiveRootObjectKey) as? NSObject
This was working perfectly till iOS 18. From iOS 18 in couple of devices, we are getting empty string array while we retrieve the value back from userdefaults. We observed this in an iPhone 12 pro and iPhone 15 running on iOS 18. iPhone 12 pro is facing this issue almost once everyday. In iPhone 15 this happens once in 2-3 days.
Tried printing raw data directly from userdefaults. And I can see some data available. But when we convert that back to array of string, I am getting empty. Tried adding logs in catch block. But couldn't get any. What might be the cause of this issue?
Since iOS 18.3.1, In lower iOS versions it works fine though.
QLPreviewController shows a blank white screen instead of showing the document. Additionally, it does not display the 'Done' option at the top-right to close the view.
Presenting the QLPreviewController works fine to display the document, but for the second time, it renders the blank white screen as described.
While launching QLPreviewControllerView for the first time. I'm receiving the following message in the console and it displays the document.
LaunchServices: store (null) or url (null) was nil: Error Domain=NSOSStatusErrorDomain Code=-54 "process may not map database" UserInfo={NSDebugDescription=process may not map database, _LSLine=72, _LSFunction=_LSServer_GetServerStoreForConnectionWithCompletionHandler}
Attempt to map database failed: permission was denied. This attempt will not be retried.
Closing the QLPreviewController with the help of the 'Done' option from top-right or swipe to close triggers the following message in the console.
Connection to appex interrupted
AX Lookup problem - errorCode:1100 error:Permission denied portName:'com.apple.iphone.axserver' PID:1022 (
0 AXRuntime 0x00000001d2cd7758 _AXGetPortFromCache + 796
1 AXRuntime 0x00000001d2cdd02c AXUIElementPerformFencedActionWithValue + 700
2 UIKit 0x0000000258cdf488 7F0274D9-D3C9-3193-B606-1C74BE53B86C + 1537160
3 libdispatch.dylib 0x0000000101bb888c _dispatch_call_block_and_release + 32
4 libdispatch.dylib 0x0000000101bba578 _dispatch_client_callout + 20
5 libdispatch.dylib 0x0000000101bc2454 _dispatch_lane_serial_drain + 840
6 libdispatch.dylib 0x0000000101bc325c _dispatch_lane_invoke + 408
7 libdispatch.dylib 0x0000000101bd06fc _dispatch_root_queue_drain_deferred_wlh + 328
8 libdispatch.dylib 0x0000000101bcfd0c _dispatch_workloop_worker_thread + 580
9 libsystem_pthread.dylib 0x0000000225ea4680 _pthread_wqthread + 288
10 libsystem_pthread.dylib 0x0000000225ea2474 start_wqthread + 8
)
Trying to open he document again, Ultimately results in the white blank screen to be displayed with no options to close.
It displays the Navigation bar only for the fraction of time. Leading users to force close the app and start again.
Hi folks,
We are trying to develop a widget on iPhone control center. We follow the Apple design guideline to export our resource file using custom icon and the button icon always show on debug build. However, when we deploy to TestFlight, under some scenario, such as app upgrade, we found that the icon image disappear occasionally.
Anyone could help? Thank you in advance!
I am using AlarmKit in my app. When I access:
AlarmManager.shared.authorizationState
It always returns notDetermined, even when I have previously granted the app permission to use alarms via:
try await AlarmManager.shared.requestAuthorization()
Calling this API again grants me the permission though, without showing the permission prompt to the user.
This sounds like a bug - if the permission has been granted, accessing authorizationState should return .authorized. It shouldn't require me to call requestAuthorization() again to update the authorization status again?
Environment:
iOS 26 beta 3
Xcode 26 beta 3
Topic:
App & System Services
SubTopic:
General
Hello,
my app is frequently loosing / forgetting the Screen Time Permission that had been granted previously on iOS 26.
I have experienced it myself, sysdiagnose is in this radar:
FB18997699
But also also my App Store users who have updated to iOS 26 already have reported this bug.
It would be great if Apple could ensure that this bug is addressed before iOS 26 is released to the public.
Topic:
App & System Services
SubTopic:
General
Tags:
Family Controls
Device Activity
Managed Settings
Screen Time
I'm unable to have stickers show in messages even with a new iOS app and a sticker pack extension target.
I do see the iMessage App Icon but after tapping it nothing shows and I see a warning: "Error creating the CFMessagePort needed to communicate with PPT"
This was tested on simulator and on real device.
Xcode 16.1 (16B40)
iOS 18.1 & 18.2
Hello! I'm working with universal links in my app and have configured the /.well-known/apple-app-site-association file. Currently, I use the paths array in this file to define URL routing rules. However, I’m struggling to find up-to-date documentation on the pattern syntax supported by the paths field.
"paths": [
"/page/*",
"NOT /page/*/subpage"
]
Could someone clarify:
Is the paths array still officially supported, or is it deprecated in favor of the newer components dictionary (as referenced here https://developer.apple.com/documentation/bundleresources/applinks/details-swift.dictionary/components-swift.dictionary)?
If paths is still valid, where can I find documentation for its pattern-matching capabilities?
I want to ensure my implementation aligns with Apple’s current best practices. Thank you!
Hi, I didn't find any mentions in the doc about disabling the option for snoozing in an alarm. Although you can create an alarm without a snooze button using AlarmKit, the user can still snooze by clicking on the volume button, for example.
Topic:
App & System Services
SubTopic:
General
I am worried that Rosetta 2 will eventually be removed. I rely on it to run x86-64 Docker containers as well as Windows games through the Game Porting Toolkit. I also use CrossOver very often, which relies on Rosetta. I also use an old version of MuseScore that needs it, and every now and then, I download a legacy Intel Mac app. Thus, I'm worried that Apple will no longer offer it for download in future macOS versions. Are there any plans to remove Rosetta? Since Rosetta is only installed on demand, I have a slight bit of reassurance that it might be offered for download indefinitely, since most casual users naturally won't install it in the future as most general consumer apps are compiled natively for ARM, and the on-demand install cuts down on the bloat included with macOS by default. I hope Rosetta could be offered indefinitely, since many pro-users and gamers rely on it very often, even 10 years from now when Intel Macs are completely unsupported. If Rosetta is removed, I might have to switch back to Windows for many tasks, so I really hope for the continued offering of Rosetta.
Topic:
App & System Services
SubTopic:
General
Tags:
Developer Tools
Games
Universal Apps
Apple Silicon
I'm using react native with expo, firebase for auth, and I have google, facebook and Apple Sign In enabled. On my IOS simulator I can sign in using all 3 with no problems, but when I build and submit to test flight and test on a real device only google sign in works
It crashes when I try to sign in with facebook and I get an error saying The operation couldn't be completed. (com.apple.AuthenticationServices.AuthorizationError error 1000.)
Topic:
App & System Services
SubTopic:
General
Hi there,
My app uses all the Screen Time API's with individual FamilyControls authorization. I've been using the API's for over 2 years (since they came out).
In iOS 18 Beta (maybe started in Beta 3?), I've been experiencing random issues. I tracked it down to where it seems like DeviceActivityMonitor extension is more likely to deadlock in iOS 18.
To reproduce: when DeviceActivityMonitorExtension.intervalDidEnd gets called, IF you call DeviceActivityCenter.startMonitoring for that SAME DeviceActivityName from the DeviceActivityMonitorExtension , the startMonitoring call deadlocks (if I pause debugger, it does not advance past DeviceActivityCenter.startMonitoring).
The bug is reported in FB14664238. It also contains a sample project where you can reproduce this.
I also note in the comment section that this is not the only way to encounter this problem. My application code (which is a lot more complicated) seems to deadlock on calling DeviceActivityCenter.activities. As a result, there seems to be an "overall trend" where, due to some changes, DeviceActivityMonitor extension is more likely to deadlock.
The steps are not reproducible on iOS 17.6. This is built using Xcode 17.4.
Thank you! 🙏
Topic:
App & System Services
SubTopic:
General
Tags:
Family Controls
Device Activity
Managed Settings
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
I've run Speakerbox(https://docs-assets.developer.apple.com/published/8e99045a90e2/MakingAndReceivingVoIPCallsWithCallKit.zip) to check the behavior of CallKit.
When there was one active call and one on hold and another call was received, the behavior was defferent depending on whether I operated it from a headset or not.
No headset or operated from CallKit screen
When "End & Accept" tapped: the active call is hung up, and the received call is answered.
When "End Held & Accept" tapped: the held call is hung up, the active call is held, and the received call is answered.
Operated from headset
Answer opeation cannot be performed for unknown reasons
Disconnect operation caused that all calls other than the one on hold are hung up and the held call is unheld.
Hold operation caused that the active call is held and the received call is answered. (Strangely, there are two held calls.)
And when I toggle calls at this time, one of the two on hold is hung up for unknown reasons.
I tried changing the settings of CXProviderConfiguration and CXCallUpdate, and changing the options in the Audio Session category, but it did not improve.
I checked CXActions occurring, and it was as follows.
(Call A = held call, Call B = active call, Call C = received call)
Disconnect (or Answer?) operation
(lacking CXEndCallAction for Call A)
CXEndCallAction for Call B
CXAnswerCallAction for Call C
CXEndCallAction for Call C <- weird
CXSetHeldCallAction for Call A onHold=false
Hold operation
(lacking lacking CXEndCallAction for Call A)
CXSetHeldCallAction for Call B
CXAnswerCallAction for Call C
Toggle calls
CXSetHeldCallAction for Call C onHold=true
CXSetHeldCallAction for Call A onHold=false
CXSetHeldCallAction for Call B onHold=false <- weird
CXEndCallAction for Call B
Hi all,
I need help diagnosing a strange crash that’s affecting only one device model.
Issue:
My React Native app crashes immediately on launch, but only on the iPad Air (5th generation) running iPadOS 18.5.
The app was built with React Native (latest stable version).
It runs fine on all other tested iOS and iPadOS devices, both physical and simulators.
There’s no crash on iPhone or on older iPads so can somebody please help solve this?
Topic:
App & System Services
SubTopic:
General
Is it possible with the current AlarmKit framework?
I tried in code and also reading the docs but couldn't find anyway of doing it.
Even though you can create an alarm with no snooze button that doesn't prevent the user from snoozing via the device volume button, for example.
Topic:
App & System Services
SubTopic:
General
Hello, I have been using the App-prefs:General&path=SOFTWARE_UPDATE_LINK URL in my application to navigate to system settings, and it worked as expected. However, after updating to iOS 18, it no longer works, and I haven't been able to find a replacement.
Is there any alternative solution or a different URL that works?
I also tried prefs:root=General&path=SOFTWARE_UPDATE_LINK, but it didn’t work either.
When we request auth from the AuthorizationCenter, it seems that we're only really able to allow users to control the apps on the parent's phone. Is there a way to allow us to let parents manage apps on the kid's device directly through our parent app?
For context, we have 2 different apps, one for the parent and one for the child. The child is able to purchase screen time and the parent can redeem them (activate those minutes) from their end.
I'm currently working with the FamilyControls API and testing my app on two different devices. Both apps are in the same family-sharing network with one phone being the owner of the network (I'll call this A) and the other one being an adult in the network(I'll call this B).
When device A picks apps using the FamilyActivityPicker, it shares that selection with device B (via encoding, sending over network, and decoding on device B). However, interacting with the token (displaying it, using it in shield) throws an error saying the token is null.
From the documentation, I thought every token would be the same across all devices in the family sharing network. So my question:
How do I send the FamilyActivitySelection from A to B and have the tokens still be functional?
Does this functionality only work if A is a "parent" and B is a "child" in the family sharing network?
Also, side note:
If I reverse the process and send the tokens from B to A. Interacting with the token works exactly as expected. For some reason, it's only going from A to B where it doesn't work.
Topic:
App & System Services
SubTopic:
General
Tags:
Application Services
Family Controls
Screen Time
I'm currently experimenting with TelephonyMessagingKit on iOS 26 Beta 3 (in the EU). I've managed to register my example project as the default Carrier messaging app, and sending/receiving SMS inside the app also appeared to work.
However, I do not see any way to receive notifications/messages while the app is not running. Is this intentional? Not being able to notify users about an incoming message would be a competitive disadvantage compared to Apple's messages app, which is why I'd expect there to be an API to do this, given the EU rules. I'd appreciate any help here. Thanks!