I would like to share an issue observed during app development.
When changing Bluetooth settings from the system Settings app without using multitasking, the app does not terminate but instead logs the user out.
However, when changing Bluetooth settings while using multitasking, the app terminates completely.
In this context, I would like to understand:
Whether there is any system behavior that causes the app to refresh or restart when Bluetooth settings are changed
And why the app behavior differs in a multitasking environment, particularly in terms of app lifecycle handling
Any insights into these behaviors would be greatly 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
Created
I want to know the right way/API/usage to use NWConnectionGroup to send both datagram and non-datagram stream.
I am currently working on an P2P video streaming app. I want to leverage NWConnectionGroup over QUIC to handle both message channel (traditionally handled by a TCP connection) and media channel (traditionally handled by sth. over UDP) to transmit SRT packets back and forth.
I created a NWConnectionGroup and it worked fine on non-datagram parts. The problems are with datagram part. I tried
extracting a connection with datagram = true either from the group or from message, doesn't and in some cases it breaks other non-datagram connections.
I currently send datagram directly using the NWConnectionGroup.send(content:completion). It kinda works but I keep seeing it canceled a lot of messages, which breaks SRT shortly after start. The warnings belong flooded my console. (Seems like want me to create a connection to transmit datagram, how?)
nw_connection_create_with_connection [C1600] Original connection not yet connected
nw_connection_group_create_connection_for_endpoint_and_parameters [G1] failed to create connection with parameters quic, local: fe80::439:68b4:6ec2:694%en0.60517, definite, attribution: developer, server
I must use it in wrong way. What should I do to fix it?
I'm sending local push notifications and want to show specific content based on the id of any notification the user opens. I'm able to do this with no issues when the app is already running in the background using the code below.
final class AppDelegate: NSObject, UIApplicationDelegate, UNUserNotificationCenterDelegate {
let container = AppContainer()
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
let center = UNUserNotificationCenter.current()
center.delegate = self
return true
}
func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: () -> Void) {
container.notifications.handleResponse(response)
completionHandler()
}
}
However, the delegate never fires if the app was terminated before the user taps the notification. I'm looking for a way to fix this without switching my app lifecycle to UIKit.
This is a SwiftUI lifecycle app using UIApplicationDelegateAdaptor.
@main
struct MyApp: App {
@UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
var body: some Scene {
WindowGroup {
ContentView()
}
}
}
I’m aware notification responses may be delivered via launchOptions on cold start, but I’m unsure how to bridge that cleanly into a SwiftUI lifecycle app without reverting to UIKit.
Hi everyone 👋
As a network engineer and indie iOS developer, I couldn’t find a lightweight mobile tool that fully supports IPv4/IPv6 dual-stack diagnostics — so I built NetToolbox -All-In-One Utility for engineers, DevOps, and developers.
Here are its core features that solve real mobile networking pain points:
One-Click Full Diagnostics: Integrates ping, traceroute, and multi-type DNS queries (A/AAAA/CNAME) — no need to switch between apps
IPv4/IPv6 Dual-Stack Support: Seamlessly works in IPv6-only networks, with the ability to test connectivity differences between dual-stack environments
LAN Device Scanning: Quickly identifies all devices on the same network segment and checks port availability
Offline Functionality: Diagnostic logic is stored locally, enabling LAN troubleshooting without an internet connection
Lightweight Design: 5MB install size, no storage bloat, and low power consumption during operation
Dark Mode Support: Tailored for developers who work late at night
During development, I leveraged Apple Intelligence alongside Claude Code and Gemini 3 to accelerate the process, optimize iOS native networking stack adaptation and local storage logic, and significantly boost development efficiency.
I’d love to hear from the community:
What must-have features are missing from mobile network diagnostic tools?
Do you have experience optimizing iOS workflows with Apple Intelligence?
👉 You can try the app here:
https://apps.apple.com/us/app/nettoolbox-all-in-one-utility/id6757392404
Feedback is highly appreciated — I’ll keep iterating to make it better! 🚀
Topic:
App & System Services
SubTopic:
Networking
Tags:
Developer Tools
Network Extension
Network
Apple Intelligence
"In iTunes IAP space"
Give a monthly subscription with 7 days freeTrail, what would be sequence of iTunes V2 notification for the following behaviour?
When an end user purchases a subscription that includes a free trial.
When the user transitions from the free‑trial period to the paid subscription period.
We have been experimenting with silent notifications to update the content in our app and connected bluetooth peripheral at regular intervals. We are facing issues every once in a while with some users not receiving the notifications reliably even if the app is in the background and not killed.
Is there a way we can ensure we reliably receive notifications every time without any issues? If there is no guaranteed delivery with silent notifications, then is there any other way that we can explore to achieve our use case?
Hey there
Are there any recommendations or guidance for apps on alternatives to certificate pinning to secure their device network traffic?
I want to move away from the overhead and risk associated with rotating certificates when using leaf pinning.
However, I also don't want people to be able to perform a MITM attack easily using something like Charles Proxy with a self‑signed certificate added to the trust store.
My understanding is that an app cannot distinguish between user‑trusted certificates and system‑trusted certificates in the trust store, so it cannot block traffic that uses user‑trusted certificates.
Topic:
App & System Services
SubTopic:
Networking
There will be a cloud download icon on the folder, and when I click download, I will go to download the file below. Then this icon will disappear, but when I move a dataless file into the folder, the cloud download icon will appear again. I understand if there is any way to determine whether the folder has downloaded properties
I have a large code that I try to update to change deprecated APIs.
In the former version, I used forWritingWith and forReadingWith
let data = NSMutableData()
let archiver = NSKeyedArchiver(forWritingWith: data)
archiver.encode(myObject, forKey: theKey)
if let data = NSMutableData(contentsOf: anURL) {
let unarchiver = NSKeyedUnarchiver(forReadingWith: data as Data)
let myObject = unarchiver.decodeObject(forKey: theKey) as! TheObjectType // <<-- returns the object
That I changed to
let data = NSMutableData()
let archiver = NSKeyedArchiver(requiringSecureCoding: true)
archiver.encode(myObject, forKey: theKey)
if let data = NSMutableData(contentsOf: anURL) {
do {
let unarchiver = try NSKeyedUnarchiver(forReadingFrom: data as Data)
let myObject = unarchiver.decodeObject(forKey: theKey) as? TheObjectType // <<-- This returns nil
This builds correctly.
But on execution, unarchiver.decodeObject now returns nil.
I have searched extensively to find the cause to no avail.
I may probably change the design to avoid NSKeyedArchiver, but that would be a huge refactoring.
I probably miss something obvious.
Could someone hint at the possible cause ?
I want to add matter device to my own fabric,not same as to homeKit in Home APP
I implemented a demo which add a matter support extension, and it can success, but I use MTRDeviceController to commission,it go wrong, blow is the log
Couldn't read values in CFPrefsPlistSource<0x1062ec100> (Domain: group.wxx.MatterTest, User: kCFPreferencesAnyUser, ByHost: Yes, Container: (null), Contents Need Refresh: Yes): Using kCFPreferencesAnyUser with a container is only allowed for System Containers, detaching from cfprefsd
<<5 [E:46634i S:0 M:188511265] (U) Msg Retransmission to 0:0000000000000000 failure (max retries:4)
PASESession timed out while waiting for a response from the peer. Expected message type was 33
controller(:commissioningSessionEstablishmentDone:) error = nil
Error on commissioning step 'AttestationVerification': 'src/controller/CHIPDeviceController.cpp:1288: CHIP Error 0x000000AC: Internal error'
Failed verifying attestation information. Now checking DAC chain revoked status.
Failed in verifying 'Attestation Information' command received from the device: err 101. Look at AttestationVerificationResult enum to understand the errors
Error on commissioning step 'AttestationRevocationCheck': 'src/controller/CHIPDeviceController.cpp:1337: CHIP Error 0x000000AC: Internal error'
Failed to send Solitary ack for MessageCounter:265529558 on exchange 46643i:src/messaging/ExchangeContext.cpp:99: CHIP Error 0x00000002: Connection aborted
Creating NSError from src/controller/CHIPDeviceController.cpp:1337: CHIP Error 0x000000AC: Internal error (context: (null))
controller(:commissioningComplete:nodeID:metrics:) error = Optional(Error Domain=MTRErrorDomain Code=1 "General error: 172" UserInfo={NSLocalizedDescription=General error: 172, errorCode=172})
Is there any suggestion to me with the issue
Topic:
App & System Services
SubTopic:
Hardware
Hey everyone I just ran into an issue where I couldn't sync the model below fully by using CloudKit,
enum LinkMapV3_1: VersionedSchema {
static let versionIdentifier: Schema.Version = .init(3, 1, 0)
static var models: [any PersistentModel.Type] {
[AnnotationData.self, GroupData.self, Item.self, Deployment.self, History.self]
}
// MARK: - Data
@Model
class AnnotationData {
var name: String = ""
var longitude: Double = 0.0
var latitude: Double = 0.0
var order: Int = -1
var level: Int = 1
var detail: String = ""
@Relationship(deleteRule: .nullify, inverse: \GroupData.annotation)
var groups: [GroupData]?
@Relationship(deleteRule: .nullify, inverse: \AnnotationData.to)
var from: AnnotationData?
var to: AnnotationData?
var history: History?
}
// MARK: - History
@Model
class History {
var id: UUID = UUID()
var timestamp: Date = Date()
@Relationship(deleteRule: .nullify, inverse: \AnnotationData.history)
var annotations: [AnnotationData]?
@Relationship(deleteRule: .nullify, inverse: \GroupData.history)
var groups: [GroupData]?
@Relationship(deleteRule: .nullify, inverse: \Item.history)
var items: [Item]?
@Relationship(deleteRule: .nullify, inverse: \Deployment.history)
var deployment: Deployment?
var formattedDate: String {
let formatter = DateFormatter()
formatter.dateStyle = .medium
formatter.timeStyle = .short
return formatter.string(from: timestamp)
}
var timeAgo: String {
let formatter = RelativeDateTimeFormatter()
formatter.unitsStyle = .abbreviated
return formatter.localizedString(for: timestamp, relativeTo: Date())
}
}
}
So when trying to sync with the code in documentation
let modelContainer: ModelContainer
init() {
let config = ModelConfiguration()
typealias vs = LinkMapV3_1
do {
#if DEBUG
// Use an autorelease pool to make sure Swift deallocates the persistent
// container before setting up the SwiftData stack.
try autoreleasepool {
let desc = NSPersistentStoreDescription(url: config.url)
let opts = NSPersistentCloudKitContainerOptions(containerIdentifier: "iCloud.name.Endsunset.LinkMap.SwiftData.v1")
desc.cloudKitContainerOptions = opts
// Load the store synchronously so it completes before initializing the
// CloudKit schema.
desc.shouldAddStoreAsynchronously = false
if let mom = NSManagedObjectModel.makeManagedObjectModel(for: [vs.AnnotationData.self, vs.GroupData.self, vs.Item.self, vs.Deployment.self, vs.History.self]) {
let container = NSPersistentCloudKitContainer(name: "LinkMap", managedObjectModel: mom)
container.persistentStoreDescriptions = [desc]
container.loadPersistentStores {_, err in
if let err {
fatalError(err.localizedDescription)
}
}
// Initialize the CloudKit schema after the store finishes loading.
try container.initializeCloudKitSchema()
// Remove and unload the store from the persistent container.
if let store = container.persistentStoreCoordinator.persistentStores.first {
try container.persistentStoreCoordinator.remove(store)
}
}
}
#endif
modelContainer = try ModelContainer(for:
vs.AnnotationData.self,
vs.GroupData.self,
vs.Item.self,
vs.Deployment.self,
vs.History.self,
configurations: config)
} catch {
fatalError(error.localizedDescription)
}
}
The output is
Console Output
Where you can see
Output Extract
Optional arrays with @Relationship are missing, and the entry of record types on cloudkit database container are also missing it.
When I attempt to insert an annotation, I got
SwiftData/PersistentModel.swift:559: Fatal error: This KeyPath does not appear to relate AnnotationData to anything - \AnnotationData.groups
It gets more suspicious when restart the app and try again, the above error end with "AnnotationData.history", and if I tried again the above error end with "AnnotationData.from"... and so on.
No matter how my app stop working.
I am developing an iOS/iPadOS application and have encountered some behavior regarding Files App and security-scoped bookmarks that I would like to clarify.
Additionally, I would like to report some behavior which might include a potential issue.
Question1: Accessing deleted files via bookmark (Specification clarification)
Our app saves file URLs as bookmarks, which file that user has selected on Files App or app-created so to open a file which user has modified previously in the next launch.
When a user deletes a file in Files App (moves a file to Recently Deleted), the app can still resolve the bookmark and access the file for read/write operations.
Is this behavior intended?
In other words, is it correct that a bookmark can access a file that has been deleted in Files App but not permanently removed?
Question2: Overwriting a file in Recently Deleted (Potential bug)
We noticed that overwriting a file in Recently Deleted behaves differently depending on the method used.
Current implementation
1.Create a temporary file in the same directory
2.Write content to the temporary file
3.Delete the original file ([NSFileManager removeItemAtURL:error:])
4.Move the temporary file to the original file path ([NSFileManager moveItemAtURL:toURL:error:])
Result: The file disappears from Files App Recently Deleted.
In contrast, using
[NSFileManager replaceItemAtURL:withItemAtURL:]
keeps the file visible in Recently Deleted.
Is this difference designed behavior?
If not, this may be a bug.
Question3: Detecting files in Recently Deleted
We want to detect whether a file resides in Recently Deleted, but we cannot find a reliable and officially supported method.
Recently Deleted files appear under .Trash, but using the path alone is not a reliable method.
We have tried the following APIs without success:
[NSURL getResourceValue:forKey:NSURLIsHiddenKey error:]
[NSURL checkResourceIsReachableAndReturnError:]
[NSFileManager fileExistsAtPath:]
[NSFileManager isReadableFileAtPath:]
[NSFileManager getRelationship:ofDirectory:NSTrashDirectory inDomain:NSUserDomainMask toItemAtURL:error:]
We could not obtain the Recently Deleted folder URL using standard APIs.
[NSFileManager URLsForDirectory:NSTrashDirectory inDomains:NSUserDomainMask]
[NSFileManager URLForDirectory:NSTrashDirectory inDomain:NSUserDomainMask appropriateForURL:url create:error:]
Could you advise a safe and supported way to detect Recently Deleted files properly by the app?
I don't understand why elevation data is not stored in the sample using a standard length unit. Why is it stored in HKQuantityTypeIdentifier.flightsClimbed (which is 10 feet)?
Surely it is not a memory usage issue.
Treadmill GATT provides elevation in meters.
Using HKMetadataKeyElevationAscended for the total elevation gain throws away a lot of data.
Why is there no support for weighted vest or backpack? Changing body weight is not the same and provides incorrect energy. Users want to compare workouts with different weights. I don't see any metadata key for carried weight.
Topic:
App & System Services
SubTopic:
Health & Fitness
cant open this website: https://appstoreconnect.apple.com/apps
Bad Gateway
Correlation Key: EJMQBY3TQQI6QR2RBCFRFK7WSM
Topic:
App & System Services
SubTopic:
Networking
Usually, when you call fetchRecordZoneChanges with the previous change token, you get a list of the record ID’s that have been deleted since your last fetch.
But if you get a changeTokenExpired error because it‘s been too long since you last fetched, you have to call fetch again without a token.
For my specific application, I still need to know, though, if any records have been deleted since my last sync. How can I get that information if I no longer have a valid change token?
Is there any information for developer about notification forwarding which is published in iOS 26.3? how to use it ?
Hi!
I was able to successfully persist my debug log entires using the OSLogPreferences key in my Info.plist and retrieve the logs from my iPhone using log collect.
This worked to get log messages created when my app executed a background task tonight (2026-01-20 00:20). But log Debug and Default log messages from a normal run yesterday (2026-01-19 15:34) disappeared.
I can query for the missing messages in the log archive I created yesterday but they are missing in the log archive I created today covering also yesterday. I had invoked:
% sudo log collect --device-name "<my device name>" --last 25h --output /tmp/system_logs.logarchive
...
%sudo log show /tmp/system_logs.logarchive --debug --info --predicate 'subsystem=="com.example.MyApp"'
Is this expected and/or is there anything I could do to persist the logs for a longer period?
For reference, that's what I have added to my Info.plist for the debug build configuration so far:
<key>OSLogPreferences</key>
<dict>
<key>com.example.MyApp</key>
<dict>
<key>DEFAULT-OPTIONS</key>
<dict>
<key>Level</key>
<dict>
<key>Enable</key>
<string>Debug</string>
<key>Persist</key>
<string>Debug</string>
</dict>
<key>Enable-Private-Data</key>
<true/>
</dict>
</dict>
</dict>
I had published an App which App Clip is supported. I have receipt complaints from user where the user will keep showing the "Apple Media Services Terms and Conditions Have Changed" right after user click on the "Open" button in the App Clips.
What I had tried:
Let user switch the current logged in Apple Id region to one of our support region.
Log out and log in with an Apple Id which had no issue.
I had published an App, and my app has App Clip supported. The issue I faced is that I had received complaints where the user keep seeing the pop up "Apple Media Services Terms and Conditions Have Changed" when user clicked on the "Open" Button in the App Clip.
What we had tried so far:
Let user switch the Apple Id's region to our supported region.
Let user try to log out and log in to Apple Id within the supported region.
Hello,
is there a way to get MCC/MNC carrier codes on iOS? I'm also wondering if there's a private API.
I want to obtain network information while I am abroad to determine the country of residence.