Team-scoped keys introduce the ability to restrict your token authentication keys to either development or production environments. Topic-specific keys in addition to environment isolation allow you to associate each key with a specific Bundle ID streamlining key management.
For detailed instructions on accessing these features, read our updated documentation on establishing a token-based connection to APNs.
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
Hi,
I need to write an application (possibly using C) to communicate with a USB High Speed Device CDC class I am developing, but unfortunately I have no development experience under Mac OS, so I am here to ask for a few help/advice. I hope I am in the right place.
Since I have a working code using libusb on Linux, I have first tried to use such lib on a Mac OS without success. The device is listed correctly using
ioreg -w0 -l -p
but it seems to be always busy:
MYUSBDEVICE@fa410000 <class IOUSBHostDevice, id 0x100001769, registered, matched, active, busy 0 (262 ms), retain 24>
in fact, attempting to use libusb always results in error:
LIBUSB_ERROR_NOT_FOUND
libusb_bulk_transfer: Entity not found
After searching a bit, I have read that it is impossible (?) to use libusb on MacOS.
Then I came across these following pages:
https://developer.apple.com/library/archive/documentation/DeviceDrivers/Conceptual/USBBook/USBDeviceInterfaces/USBDevInterfaces.html
https://developer.apple.com/documentation/usbdriverkit
I would possible avoid to write a CDC kernel driver for my application, so link #2 seems more appropriate to what I need.
But isn't it available any API to develop USB CDC communications C application on MacOS ?
Any suggestion is appreciated.
Thanks in advance.
Regards,
Simon
I’m encountering an issue while reading/writing shared preferences using UserDefaults with an App Group in my iOS Message Extension. The following error appears in the console:
`Couldn't read values in CFPrefsPlistSource<0x3034e7f80> (Domain: [MyAppGroup], User: kCFPreferencesAnyUser, ByHost: Yes, Container: (null), Contents Need Refresh: Yes): Using kCFPreferencesAnyUser with a container is only allowed for System Containers, detaching from cfprefsd.
I have correctly enabled the App Group in both my containing app and the Message Extension, and I am using UserDefaults(suiteName:) to access shared preferences. However, I keep getting this error when trying to read/write values.
Has anyone encountered this before? How can I properly configure my app group preferences to avoid this issue? Any help would be greatly appreciated!
I am implementing flutter_callkit_incoming for handling call notifications in my Flutter app. However, I am facing an issue where VoIP push notifications are not consistently received when the app is in the background or terminated.
According to Apple’s documentation:
"On iOS 13.0 and later, if you fail to report a call to CallKit, the system will terminate your app. Repeatedly failing to report calls may cause the system to stop delivering any more VoIP push notifications to your app."
I have followed the official installation guide: flutter_callkit_incoming installation and implemented all necessary configurations. However, VoIP notifications sometimes get lost and do not deliver reliably.
Here is the payload I am using:
{
"notification": { "title": "New Alert", "body": "@H is calling you..." },
"android": {
"notification": {
"channelId": "channel_id",
"sound": "sound_name.mp3"
}
},
"apns": { "payload": { "aps": {} } },
"data": {
"title": "New Call",
"body": "@H is calling you...",
"notificationType": "CALL",
"type": "NOTIFICATION",
"sound": "sound_name"
},
"token": "token"
}
I expect the call notification to appear even when the app is in the background or killed state. Has anyone encountered this issue and found a solution? Any insights would be greatly appreciated.
Swift recently added support for Int128. However, they do need NOT seem to be supported in SwiftData. Now totally possible I'm doing something wrong too.
I have the project set to macOS 15 to use a UInt128 in @Model class as attribute. I tried using a clean Xcode project with Swift Data choosen in the macOS app wizard.
Everything compiles, but it fails at runtime in both my app and "Xcode default" SwiftData:
SwiftData/SchemaProperty.swift:380: Fatal error: Unexpected property within Persisted Struct/Enum: Builtin.Int128
with the only modification to from stock is:
@Model
final class Item {
var timestamp: Date
var ipv6: UInt128
init(timestamp: Date) {
self.timestamp = timestamp
self.ipv6 = 0
}
}
I have tried both Int128 and UInt128. Both fails exactly the same. In fact, so exactly, when using UInt128 it still show a "Int128" in error message, despite class member being UInt128 .
My underlying need is to store an IPv6 addresses with an app, so the newer UInt128 would work to persist it. Since Network Framework IPv6Address is also not compatible, it seems, with SwiftData. So not a lot of good options, other an a String. But for an IPv6 address that suffers from that same address can take a few String forms (i.e. "0000:0000:0000:0000:0000:0000:0000:0000" =="0:0:0:0:0:0:0:0" == "::") which is more annoying than having a few expand Int128 as String separator ":".
Ideas welcomed. But potentially a bug in SwiftData since Int128 is both a Builtin and conforms to Codable, so from my reading it should work.
The Bluetooth on my iPhone 14 hasn’t been working for a week now. Everything was fine until, at some point, it started endlessly turning on and off by itself. I’ve tried resetting the settings, doing a hard reset, updating to iOS 18.3—none of these helped. I even deleted all VPN profiles just in case (I saw this suggested on forums), but that didn’t work either. According to forums, this bug has existed since September and affects thousands of people. The constant cycling causes the Bluetooth settings to freeze. Please help! My watch, headphones, car—everything has turned into a pumpkin!
I've been seeing a high number of BGTaskScheduler related crashes, all of them coming from iOS 18.4. I've encountered this myself once on launch upon installing my app, but haven't been able to reproduce it since, even after doing multiple relaunches and reinstalls. Crash report attached at the bottom of this post.
I am not even able to symbolicate the reports despite having the archive on my MacBook:
Does anyone know if this is an iOS 18.4 bug or am I doing something wrong when scheduling the task? Below is my code for scheduling the background task on the view that appears when my app launches:
.onChange(of: scenePhase) { newPhase in
if newPhase == .active {
#if !os(macOS)
let request = BGAppRefreshTaskRequest(identifier: "notifications")
request.earliestBeginDate = Calendar.current.date(byAdding: .hour, value: 3, to: Date())
do {
try BGTaskScheduler.shared.submit(request)
Logger.notifications.log("Background task scheduled. Earliest begin date: \(request.earliestBeginDate?.description ?? "nil", privacy: .public)")
} catch let error {
// print("Scheduling Error \(error.localizedDescription)")
Logger.notifications.error("Error scheduling background task: \(error.localizedDescription, privacy: .public)")
}
#endif
...
}
2025-02-23_19-53-50.2294_+0000-876d2b8ec083447af883961da90398f00562f781.crash
As I've mentioned before our app uses PTT Framework to record and send audio messages. In one of supported by app mode we are using WebRTC.org library for that purpose. Internally WebRTC.org library uses Voice-Processing I/O Unit (kAudioUnitSubType_VoiceProcessingIO subtype) to retrieve audio from mic. According to https://developer.apple.com/documentation/avfaudio/avaudiosession/mode-swift.struct/voicechat using Voice-Processing I/O Unit leads to implicit enabling .voiceChat AVAudioSession mode (i.e. it looks like it's not possible to use Voice-Processing I/O Unit without .voiceChat mode).
And problem is following: when user starts outgoing PTT, PTT Framework plays audio notification, but in case of enabled .voiceChat mode that sound is playing distorted or not playing at all.
Questions:
Is it known issue?
Is there any way to workaround it?
I am getting recurring errors running code on macOS 15.1 on arm that is using a volume mounted from a machine running macOS 14.7.1 on x86. The code I am running copies files to the remote volume and deletes files and directories on the remote volume. The files and directories it deletes are typically files it previously had copied.
The problem is that I get permission failures trying to delete certain directories.
After this happens, if I try to list the directory using Terminal on the 15.1 system, I get a strange error:
ls -lA TestVAppearances.app/Contents/runtime-arm/Contents
total 0
ls: fts_read: Permission denied
If I try to list the directory on the target (14.7.1) system, there is no error:
TestVAppearances.app/Contents/runtime-arm/Contents:
total 0
After a recent iOS update, my app is not synching between devices. I'm not seeing or getting any errors. CLoudKit Logs show activity, but it's not happening realtime. Even if I close and reopen the app, it won't sync between devices. It almost looks like it only has local storage now and CloudKit is not working on it anymore.
STEPS TO REPRODUCE
Use app on two devices with the same Apple ID. Create a user and one device and it won't show up on the other device. Vice Versa.
I'm looking at implementing an iOS app that has includes a Content Filter Provider to block access to certain domains when accessed on the device.
This uses NEFilterManager, NEFilterDataProvider and NEFilterControlProvider to handle configuration and manage the network flows and block as necessary.
My question is can you deploy this in an iOS 18+ app on the App Store to devices which are unmanaged, unsupervised and don't use Screen Time APIs?
Although not 100% clear, this technote seems to say it is not possible:
https://developer.apple.com/documentation/Technotes/tn3134-network-extension-provider-deployment
Testing this on a Developer device and build works successfully without any MDM profiles installed.
A similar approach using the same APIs also works on macOS once user permissions have been given.
If it can't work on unsupervised, unmanaged iOS devices, is possible for the user to first manually install a MDM profile which includes the required 'Content Filter' details and then have it work?
If not, how would you filter iOS network traffic on an unmanaged, unsupervised device?
Is it necessary to use a VPN or DNS approach instead (which may be a lot less privacy compliant)?
Signed renewal info from 'Get Subscription Statuses' or in server notifications never has the offerType or offerDiscountType even when the corresponding transaction does have those values set.
Our offer is a free trial.
Do these properties refer to something different in JWSRenewalInfoDecodedPayload than they do in transactions?
I'm trying to determine whether a subscription (identified by originalTransactionId) is currently in a free trial based on server notifications. The status doesn't tell us if the subscription is currently in free trial and the signedTransactionInfo may be for an older transaction.
Apple Watch automatically tracks sleep data and syncs it to the iPhone, making it available through HealthKit for historical analysis. However, there is no way to retrieve real-time data on whether a user has entered sleep, or whether they are in a specific sleep stage at any given moment.
Is it possible to provide an interface for real-time sleep status monitoring
I completed the CallKit Demo with the same code.
When I changed to LiveCommunicationKit, the code goes perfectly when the app is in foreground, but it crashed in background.
If I changed the reportIncoming method from LCK to CallKit, it goes well. What is the reason?
I changed the method from
func pushRegistry(_ registry: PKPushRegistry,
didReceiveIncomingPushWith payload: PKPushPayload,
for type: PKPushType, completion: @escaping () -> Void)
to
func pushRegistry(_ registry: PKPushRegistry,
didReceiveIncomingPushWith payload: PKPushPayload,
for type: PKPushType) async
it crashed before show the print "receive voip noti".
Here is the core code:
var providerDelegate: ProviderDelegate?
func pushRegistry(_ registry: PKPushRegistry,
didReceiveIncomingPushWith payload: PKPushPayload,
for type: PKPushType, completion: @escaping () -> Void) {
if type != .voIP { return }
guard let uuidString = payload.dictionaryPayload["uuid"] as? String,
let uuid = UUID(uuidString: uuidString),
let handle = payload.dictionaryPayload["handle"] as? String,
let hasVideo = payload.dictionaryPayload["hasVideo"] as? Bool,
let callerID = payload.dictionaryPayload["callerID"] as? String else {
return
}
print("receive voip noti: \(type):\(payload.dictionaryPayload)")
if #available(iOS 17.4, *) {
// This code is only goes perfectly when the App is in foreground
var update = Conversation.Update(members: [Handle(type: .generic, value: callerID, displayName: callerID)])
if hasVideo {
update.capabilities = [.video, .playingTones]
} else {
update.capabilities = .playingTones
}
Task { @MainActor in
do {
print("LCKit report start")
try await LCKitManager.shared.reportNewIncomingConversation(uuid: uuid, update: update)
print("LCKit report success")
completion()
} catch {
print("LCKit report failed")
print(error)
completion()
}
}
} else {
// It went perfectly
providerDelegate?.reportIncomingCall(uuid: uuid, callerID: callerID, handle: handle, hasVideo: hasVideo) { _ in
completion()
}
}
@available(iOS 17.4, *)
final class LCKitManager {
static let shared = LCKitManager()
let manager: ConversationManager
init() {
manager = ConversationManager(configuration: type(of: self).configuration)
manager.delegate = self
}
static var configuration: ConversationManager.Configuration {
ConversationManager.Configuration(ringtoneName: "Ringtone.aif",
iconTemplateImageData: #imageLiteral(resourceName: "IconMask").pngData(),
maximumConversationGroups: 1,
maximumConversationsPerConversationGroup: 1,
includesConversationInRecents: true,
supportsVideo: false,
supportedHandleTypes: [.generic])
}
func reportNewIncomingConversation(uuid: UUID, update: Conversation.Update) async throws {
try await manager.reportNewIncomingConversation(uuid: uuid, update: update)
}
}
final class ProviderDelegate: NSObject, ObservableObject {
static let providerConfiguration: CXProviderConfiguration = {
let providerConfiguration: CXProviderConfiguration
if #available(iOS 14.0, *) {
providerConfiguration = CXProviderConfiguration()
} else {
providerConfiguration = CXProviderConfiguration(localizedName: "Name")
}
providerConfiguration.supportsVideo = false
providerConfiguration.maximumCallGroups = 1
providerConfiguration.maximumCallsPerCallGroup = 1
let iconMaskImage = #imageLiteral(resourceName: "IconMask")
providerConfiguration.iconTemplateImageData = iconMaskImage.pngData()
providerConfiguration.ringtoneSound = "Ringtone.aif"
providerConfiguration.includesCallsInRecents = true
providerConfiguration.supportedHandleTypes = [.generic]
return providerConfiguration
}()
private let provider: CXProvider
init( {
provider = CXProvider(configuration: type(of: self).providerConfiguration)
super.init()
provider.setDelegate(self, queue: nil)
}
func reportCall(uuid: UUID, callerID: String, handle: String, hasVideo: Bool, completion: ((Error?) -> Void)? = nil) {
let callerUUID = UUID()
let update = CXCallUpdate()
update.remoteHandle = CXHandle(type: .generic, value: callerID)
update.hasVideo = hasVideo
update.localizedCallerName = callerID
// Report the incoming call to the system
provider.reportNewIncomingCall(with: callerUUID, update: update) { [weak self] error in
completion?(error)
}
}
}
I have an image field on a Core Data entity with "Allows External Storage" enabled. When I delete a record, the external binary data file remains on disk. How can I ensure that all externally stored data is deleted along with the record?
Hello! We're currently testing Live Caller ID implementation and noticed an issue with userIdentifier values in our database.
Initially, we expected to have approximately 100 records (one per user), but the database grew to about 10,000 evaluationKey entries. Upon investigation, we discovered that the userIdentifier (extracted from "User-Identifier" header) for the same device remains constant throughout a day but changes after a few days.
We store these evaluation keys using a composite key pattern "userIdentifier/configHash". All these entries have the same configHash but different userIdentifier values.
This behavior leads to unnecessary database growth as new entries are created for the same users with different userIdentifier values.
Could you please clarify:
Is this the expected behavior for userIdentifier to change over time?
If yes, is there a specific TTL (time-to-live) for userIdentifier?
If this is not intended, could this be a potential iOS bug?
This information would help us optimize our database storage and implement proper cleanup procedures.
Thank you for your assistance!
When I'm using Endpoint Security to monitor the file creation behavior of Keynote, I've noticed that when I choose to export a Keynote file as an HTML file, ES only triggers the ES_EVENT_TYPE_NOTIFY_CREATE notification for the index.html file, and the ES_EVENT_TYPE_AUTH_CREATE is not triggered. I've double - checked my code many times, and I'm pretty sure there's no error in it. Does ES only call the notification event without calling the authorization event under certain circumstances? Or is this a bug in ES?
Hello,
I have an app in AppStore "Counter Widget". https://apps.apple.com/app/id1522170621
It allows you to add a widget to your homescreen/lockscreen to count anything.
Everything works fine except for one scenario. iOS 18+
I create 2 or more widgets for one counter. For example, medium and small widgets.
I click on the widget button to increase or decrease the value.
The button in the widget uses Button(intent: AppIntent) to update the value and calls WidgetCenter.shared.reloadAllTimelines() to update the second widget for the same counter.
For iOS 18 in this particular scenario, you don't even have to call the WidgetCenter.shared.reloadAllTimelines(). iOS already knows that there is a widget with the same INIntent settings and will update it itself.
Both widgets are updated and show the new value. Everything is correct.
Now on the homescreen I open the widget configuration for one of the widgets to change the INIntent for the widget. For example, i change the background to wallpaper. This is just a skin for the widget, and the widget is associated with the same counter value as before.
As in (2), I click the widget button to increase or decrease the value.
But now only one widget is updated. iOS ignores my call to WidgetCenter.shared.reloadAllTimelines() and does not update the second widget connected to the same counter.
As I found, iOS, when I call WidgetCenter.shared.reloadAllTimelines() from the widget itself, updates other widgets only if INIntent is absolutely equal for them.
Overriding isEqual for them did not help. That is, I cannot specify which fields from my INIntent can be ignored during such an update and consider that widgets are equal and need to be updated. Obviously iOS make this compare outside my code.
The main problem is that when the user adds a widget to the lock screen and increases and decreases the value there. After that, he opens the home screen and the widget there is not synchronized with the value from the widget on the lock screen.
How to solve this problem?
Hello,
I’m reaching out to gather information regarding the upcoming changes to APNs certificates that are set to be implemented in the beta at the end of January 2025.
Specifically, I would like to understand the following:
What will be the practical impact of these changes on apes apis ?
What actually needed to be done at trust store for this changes, and how will it affect our current setup?
What steps do we need to take to update the certificates on our servers?
it’s crucial for us to address these changes in advance and keep our customers informed.
Thank you for your help!
I have two privileged service(s) and a desktop app. The privileged services are packaged into /Library/*** and are run using launchd at runtime. The desktop app is just dropped into /Applications.
The desktop app connects to one of the services (let's say service "B") via XPC. That is, B is running an XPC listener (using libxpc). Both applications are written in golang with xpc interaction via CGO.
This is all working fine: The desktop app is receiving notifications over XPC from service B. However, during our build we dump the built and signed apps (before .pkg'ing) into a dist folder. When we run the app (using a makefile target), we copy the services from dist to another location as root, then execute the binaries directly. This is problematic for the desktop app, because my understanding is that XPC requires launchd to assert the namespace it's under. Thus, when service B is launched this way, it says "operation not permitted." We also want to reserve the ability to run a production version of our app on the same machine (drink our own champagne and all that), and I would like to avoid having development versions running on startup, so I don't want to use the same launch configurations.
MacOS is one of three platforms we support (linux, windows as well). Our IPC implementation under MacOS uses XPC via golang build tags.
Questions:
Is it possible to start the XPC server without using launchd, or by using launchd but without registering it as an actual service?
Is this a use case where using a unix domain socket would be better (albeit i feel like securing the socket between the privileged / unprivileged process would be ... fun).
Additional / somewhat unrelated questions:
is it possible for me to somehow restrict another process from chatting with service B over XPC (restrict to my other desktop app)?
This is an app bundle question, so very unrelated: The service "app" that contains services A and B is in /Library, with the plist pointing to A, but B resides in Contents/MacOS next to A. Should this be split out into its own app bundle under Frameworks, or is this fine?
I've noticed that CONSUMPTION_REQUEST notifications sometimes have a signedTransactionInfo which corresponds not to the latest transaction, but to an earlier transaction in a subscription.
Is this expected? I thought signedTransactionInfo was always the latest subscription information?
Are there any other notification types for which signedTransactionInfo can be out of date?