The Certification Authority (CA) for Apple Push Notification service (APNs) is changing. APNs will update the server certificates in sandbox on January 20, 2025, and in production on February 24, 2025. All developers using APNs will need to update their application’s Trust Store to include the new server certificate: SHA-2 Root : USERTrust RSA Certification Authority certificate.
To ensure a smooth transition and avoid push notification delivery failures, please make sure that both old and new server certificates are included in the Trust Store before the cut-off date for each of your application servers that connect to sandbox and production.
At this time, you don’t need to update the APNs SSL provider certificates issued to you by Apple.
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.
Post
Replies
Boosts
Views
Activity
I'm finding developing for HomeKit using the iOS Simulator utterly confounding.
All of my home's actual HomeKit accessories show up fine when I run the HomeKit app I'm developing on my actual phone. But none show up when I run my app in the iOS Simulator.
Maybe that's how it's supposed to be? I decided to run the HomeKit Accessory Simulator in an attempt to get something to show up in the iOS Simulator, but the accessories I've created there don't show up in the Simulator either.
How do I get devices to show up in the iOS Simulator?
Thanks.
Hello!
We currently require the development of an iOS system for encrypting and authorizing photos, videos, voice memos, or other files stored on our devices to a connected USB-C storage. The encrypted files can be accessed through authorization. We have already encrypted and authorized the files to be stored on the app's mobile storage, and cannot directly store them to USB-C (this requirement is based on the Apple camera RroRes, which uses external storage for direct storage). We are seeking technical support from Apple.
I don't know why, but for my MacCatalyst target, I have to make my view controller Y orgin 36 and the subtract the view height by 36 points, or the view is clipped.
The following works in my main UIViewController, but feels super hacky. I'd feel better if I understood the issue and addressed it properly.
override func viewWillLayoutSubviews() {
super.viewWillLayoutSubviews()
#if targetEnvironment(macCatalyst)
if view.frame.origin.y < 1 {
let f = UIApplication.shared.sceneBounds
let newFrame = CGRect(x: 0.0, y: 36, width: f.size.width, height: f.size.height - 36)
self.view.frame = newFrame
}
#endif
}
My guess is it starts the view under the title bar, but I have these set in the view controller:
self.extendedLayoutIncludesOpaqueBars = false
self.edgesForExtendedLayout = []
I've been trying to figure out what the bare minimum is required for HKWorkoutBuilder to create a workout that adds time the appleExerciseTime. I couldn't find the documentation for this. This is my code so far.
func createWorkoutSample(
expectedActiveEnergyData: [Double],
expectedExerciseMinutesData: [Double],
calendar: Calendar,
startDate: Date
) async throws -> [HKSample] {
var testData: [HKSample] = []
let workoutConfiguration = HKWorkoutConfiguration()
workoutConfiguration.activityType = .running
workoutConfiguration.locationType = .outdoor
let results = try await withThrowingTaskGroup(of: HKSample?.self) { group in
for (index) in 0..<expectedActiveEnergyData.count {
guard let date = calendar.date(byAdding: .day, value: index, to: startDate) else {
continue
}
group.addTask {
let builder = HKWorkoutBuilder(
healthStore: self.manager.healthStore,
configuration: workoutConfiguration,
device: .local()
)
let endDate = date.addingTimeInterval(expectedExerciseMinutesData[index] * 60)
try await builder.beginCollection(at: date)
let energyType = HKQuantityType.quantityType(
forIdentifier: .activeEnergyBurned
)!
let energyQuantity = HKQuantity(
unit: HKUnit.kilocalorie(),
doubleValue: expectedActiveEnergyData[index]
)
let energySample = HKQuantitySample(
type: energyType,
quantity: energyQuantity,
start: date,
end: endDate
)
return try await withCheckedThrowingContinuation { continuation in
builder.add([energySample]) { (success, error) in
if let error = error {
continuation.resume(throwing: error)
return
}
builder.endCollection(withEnd: endDate) { (success, error) in
if let error = error {
continuation.resume(throwing: error)
return
}
builder.finishWorkout { (workout, error) in
if let error = error {
continuation.resume(throwing: error)
return
}
continuation.resume(returning: workout)
}
}
}
}
}
}
for try await workout in group {
if let workout = workout {
testData.append(workout)
} else {
print("Skipping nil workout result.")
}
}
return testData
}
print("Total samples created: \(results.count)")
return results
}
When I query appleExerciseTime, there are no results. I've looked at the HKWorkoutBuilder documentation, and most of the information expands on adding samples related to the deprecated HKWorkout.
I have a widely-used app that lets users keep track of personal data. This data is persisted with SwiftData, and synced with CloudKit.
I understand that if the user's iCloud account changes on a device (for example, user logs out or toggles off an app's access to iCloud), then NSPersistentCloudKitContainer will erase the local data records on app launch. This is intentional behavior, intended as a privacy feature.
However, we are receiving regular reports from users for whom the system has incorrectly indicated that the app's access to iCloud is unavailable, even when the user hasn't logged out or toggled off permission to access iCloud. This triggers the behavior to clear the local records, and even though the data is still available in iCloud, to the user, it looks like their data has disappeared for no reason. Helping the user find and troubleshoot their iCloud app data settings can be very difficult, since in many cases the user has no idea what iCloud is, and we can't link them directly to the correct settings screen.
We seem to get these reports most frequently from users whose iCloud storage is full (which feels like punishment for not paying for additional storage), but we've also received reports from users who have enough storage space available (and are logged in and have the app's iCloud data permissions toggled on). It appears to happen randomly, as far as we can tell.
I found a blog post from two years ago from another app developer who encountered the same issue: https://crunchybagel.com/nspersistentcloudkitcontainer/#:~:text=The%20problem%20we%20were%20experiencing
To work around this and improve the user experience, we want to use CKContainer.accountStatus to check if the user has an available iCloud account, and if not, disable the CloudKit sync before it erases the local data.
I've found steps to accomplish this workaround using CoreData, but I'm not sure how to best modify the ModelContainer's configuration after receiving the CKAccountStatus when using SwiftData. I've put together this approach so far; is this the right way to handle disabling/enabling sync based on account status?
import SwiftUI
import SwiftData
import CloudKit
@main
struct AccountStatusTestApp: App {
@State private var modelContainer: ModelContainer?
var body: some Scene {
WindowGroup {
if let modelContainer {
ContentView()
.modelContainer(modelContainer)
} else {
ProgressView("Loading...")
.task {
await initializeModelContainer()
}
}
}
}
func initializeModelContainer() async {
let schema = Schema([
Item.self,
])
do {
let accountStatus = try await CKContainer.default().accountStatus()
let modelConfiguration = ModelConfiguration(
schema: schema,
cloudKitDatabase: accountStatus == .available ? .private("iCloud.com.AccountStatusTestApp") : .none
)
do {
let container = try ModelContainer(for: schema, configurations: [modelConfiguration])
modelContainer = container
} catch {
print("Could not create ModelContainer: \(error)")
}
} catch {
print("Could not determine iCloud account status: \(error)")
}
}
}
I understand that bypassing the clearing of local data when the iCloud account is "unavailable" introduces possible issues with data being mingled on shared devices, but I plan to mitigate that with warning messages when users are in this state. This would be a far more preferable user experience than what's happening now.
Hi everyone,
I’m looking for recommendations for the best romance apps available on iOS. Whether it’s interactive storytelling, visual novels, or dating simulation games, I’d love to hear about your favorites!
What’s your go-to app for romantic storylines, engaging characters, and immersive experiences? Feel free to share why you like it and what makes it stand out.
Thanks in advance for your suggestions!
Hi,
I'm attempting to use StoreKit 2 and SwiftUI to add a tip jar to my iOS app. I've successfully added consumable IAPs for each of my tip sizes, and used ProductView to show these on my tip jar screen. However, I am at a loss on how to do the following things:
How and when do I finish the consumable IAP transaction? I see the finish() function in the documentation, but I am not sure how I can call it given that ProductView is handling the purchase for me (I have no access to a Transaction object).
How can I track the amount of consumable IAPs the user has purchased across all their devices? I want to show the user the amount of money they have tipped in total. I have added SKIncludeConsumableInAppPurchaseHistory to my Info.plist and set it to YES as suggested here: https://forums.developer.apple.com/forums/thread/687199
This is my first time using StoreKit 2 (until now, I was using StoreKit 1), so I would really appreciate any advice and guidance you can provide. Thanks!
Hello, we re developing a loyalty platform for end users and as such emit Apple wallet store cards. Problem we're facing is that the HTTP POST /v1/devices/:deviceLibraryIdentifier/registrations/:passTypeIdentifier/:serialNumber in some cases doesn't come through and we have no idea why.
This only happens to a small percentage of customers, others work just fine.
Does anyone have an idea why this might happen? I believe our setup is correct when 90% of customers work and we receive these HTTP requests to our server.
Hello everyone,
I have an app leveraging SwiftData, App Intents, Interactive Widgets, and a Control Center Widget. I recently added Live Activity support, and I’m using an App Intent to trigger the activity whenever the model changes.
When the App Intent is called from within the app, the Live Activity is created successfully and appears on both the Lock Screen and in the Dynamic Island. However, if the same App Intent is invoked from a widget, the model is updated as expected, but no Live Activity is started.
Here’s the relevant code snippet where I call the Live Activity:
`
await LiveActivityManager.shared.newSessionActivity(session: session)
And here’s how my attribute is defined:
struct ContentState: Codable, Hashable {
var session: Session
}
}
Is there any known limitation or workaround for triggering a Live Activity when the App Intent is initiated from a widget? Any guidance or best practices would be greatly appreciated.
Thank you!
David
I am currently building a screen time app and I am trying to figure out how to persist the family activity picker so that when my app closes and re-opens, the app selections in it are saved. I've successfully implemented core data and figured out how to store names of the selected apps in a list like this -
Core Data addApp Function -
func addApp(name: String, context: NSManagedObjectContext){
let newApp = AppToken(context: context)
newApp.bundleIdentifier = name
saveData(context: context)
}
Adding app selections to Core Data (after the family activity picker has updated the selection) -
.onChange(of: model.selectionToDiscourage)
{
for i in model.selectionToDiscourage.applications {
print(i)
dataController.addApp(name:i.localizedDisplayName ?? "Temp", context: moc)
}
Printing saved selections in a list (bundleIdentifier is my attribute for my appToken entity, but I am just pulling the names here. For whatever reason all of them end up being Temp" as shown above anyway. In other words name:i.localizedDisplayName is not working and Temp is shown in the list for every app chosen) -
if dataController.savedSelection.isEmpty {
Text("No Apps Selected")
.foregroundColor(.gray)
} else {
List(dataController.savedSelection, id: \.self) { app in
Text(app.bundleIdentifier ?? "Unknown App")
}
.scrollContentBackground(.hidden)
}
So, when my app closes and reopens, the list of app names persists. Now, my issue is figuring out how to write back to selectionToDiscourage and loading the family activity picker with those saved apps. I have no idea if I should be doing this a different way and if using Core Data is overkill, but I cannot figure out how it's syntactically possible to write back to this family activity picker when the app reopens -
.familyActivityPicker(isPresented: $isPresented, selection:$model.selectionToDiscourage)
Thank you to whoever takes a look at this!!
I'm writing a SwiftUI LDAP Browser. I built a command line swift app to do some testing and it works fine. I had to add the certificates from the LDAP server to the system keychain before it would work with TLS/SSL.
Then I ported the same code into a SwiftUI app but I cannot get it to connect via TLS/SSL. On the same machine with the same certs it errors with:
An unexpected error occurred: message("Can't contact LDAP server")
It connect fine with our TLS/SSL.
I suspect this may have to do with App Transport Security. Can anyone point me in the right direction to resolve this? App is MacOS only.
Hi everyone,
I’m currently developing an app using Apple’s RoomPlan framework, and so far, everything is working great! However, I’d like to extend the functionality to include scanning smaller objects, such as light switches or power outlets, in addition to the walls and larger furniture that RoomPlan already supports.
From what I understand, based on the documentation, RoomPlan doesn’t natively support the detection or measurement of smaller objects like these. Is that correct?
If that’s the case, does anyone have suggestions or ideas on how this could be achieved? Perhaps by integrating another framework or technology alongside RoomPlan?
I’d appreciate any insights or advice from those who have worked on similar use cases.
Thanks in advance!
Receiving "The disk you attached was not readable by this computer." for an external USB recorder that worked with MacOS 14
Aiworth voice recorder.
We have implemented In-App Provisioning, but when I start the tokenization process, I receive an error before the terms and conditions.
We are testing with a version of the app on TestFlight.
The error message is: Could not add card. Try again later or contact your card issuer for more information.
Could you please help me?
I have been struggling to test the IAP response but it is returning empty. I am now in the very beginning of one app, and I don't want to submit the contacts and banking and tax stuff that early. are these necessary for even testing IAP results locally? I think it does not make sense if I have to.
Hello guys,
We are receiving feedbacks from various users facing kernel panics when using one of our products. Our analysis of the crash reports shows that all panic traces report the exact same panic cause:
Sleep transition timed out after 35 seconds while creating hibernation file or while calling rootDomain's clients about upcoming rootDomain's state changes.
Various versions of MacOS are affected, including the latest ones.
It seems obvious, with the user feedbacks we have, that our product plays a role in those KP. But we can seen on the forums that it is not specific to our users.
Our product does use not-so-common APIs (it uses the EndpointSecurity API in AUTH mode for some events notalby), and it can have a pretty important IO activity on disk, with a memory footprint of multiple hundreds of MB.
My understanding of hibernation is that when it happens, the applications are frozen (i.e. with no access to the CPU), and thus that no endpoint security event would be generated during the hibernation process. As a consequence, we did not implement any specific behavior for hibernation. Do you think it is a valid assumption ?
I have an app which passes GroupActivity messages between instances running on iOS and visionOS provided both instances were built from the same target. They do not pass successfully if the apps were built from different targets, even though the one is a duplicate of the other. I have a sample demonstrating the issue:
https://github.com/bwake2012/GroupActivitiesColors
I need different targets because not all third party libraries support all devices. Libraries which support connected external hardware may never support visionOS. Multiple targets is the simplest way I can see to deal with that.
The two targets are duplicates, except for the destinations.
The app instances appear to join the session correctly. You can see screen shots from two devices in the same session.
I see errors in the debugger:
messageStream(for:messageType:):618 Explanation: Decoding message from data Error: Swift.DecodingError.valueNotFound(Any, Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "message", intValue: nil), CodingKeys(stringValue: "t", intValue: nil)], debugDescription: "Decoder for value of GroupActivitiesColors.ChooseColorMessage.self not found.", underlyingError: nil))
I'm a complete newbie to Swift and app development, but I'm playing around with an idea that uses the ScreenTime API.
Some of the articles (and AI) mention that you need to request access through Apple to use this, but based on my research it seems like this is a bit outdated.
Can anyone provide a clear answer here + any resources you've used to navigate this? The documentation is pretty sparse.
Thank you in advance!
We updated the apple-app-site-association file two weeks ago and we are only seeing the new content from Apple's CDN serving certain regions such as Texas and Canada. Regions such as Colorado intermittently sees the old content and California has been receiving the old content all the time.
Is this a known issue? If yes, when can we expect this to be fixed and where to check the status? If not, can someone in charge of CDN please look into this? Let me know if there is a better place to report this issue and get the support ASAP though.
Thank you in advance and happy new year!
unable to add for review the items below are required to start the review process: new apps and app updates must be built with the latest public (gm) versions of xcode, and the ios, macos, watchos, and tvos sdks. apps built with