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

: Issue with App Group Preferences in iOS Message Extension
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!
1
0
48
1d
VoIP Push Notification Not Received in Background/Killed State
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.
1
0
66
1d
BGTaskScheduler crashes on iOS 18.4
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
7
3
245
1d
PTT Framework has compatibility issue with .voiceChat AVAudioSession mode
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?
1
0
73
9h
LiveCommunicationKit: report Incoming but Assertion failure in -[PKPushRegistry _terminateAppIfThereAreUnhandledVoIPPushes]
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) } } }
7
0
207
4d
Live Caller ID: Multiple userIdentifier values for same device - Expected behavior?
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!
2
1
108
1d
iOS did not update all widgets of an app when the user press a button on a widget
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?
4
0
536
Nov ’24
Issue with Apple Developer Program Enrollment
I’m experiencing a serious issue with my enrollment in the Apple Developer Program. I have been waiting for weeks with no response from Apple Support. Despite sending two emails (and now a 3rd) in an attempt to get a reply, I still haven’t heard back, even though I have completed all the necessary steps and received confirmation that my enrollment process has started. Has anyone else experienced a similar situation? If so, how did you manage to resolve it, or do you have any advice on how I can get Apple to respond and take action? I would really appreciate any insights or suggestions. Thank you in advance!
0
0
34
13h
Control Center Widget icon disappear occasionally
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!
0
0
25
14h
macOS Sequoia: Shared UserDefaults don't work (the app-group is set as per macOS 15 Sequoia requirements)
I use shared UserDefaults in my Swift FileProvider extension app suite. I share data between the containing app and the extension via User Defaults initialized with init(suiteName:). Everything was working fine before macOS 15 (Sequoia). I know that Sequoia changed the way the app group should be configured. My app group is know set to "$(TeamIdentifierPrefix)com.my-company.my-app". But the containing (UI) app and the Extension read and write from and to different plist locations although the same app-group is specified for both targets in XCode. The containing app reads and writes to "~/Library/Preferences/$(TeamIdentifierPrefix)com.my-company.my-app.plist" The Extension reads and writes to "~/Library/Containers/com.my-company.my-app.provider/Data/Library/Preferences$(TeamIdentifierPrefix)com.my-company.my-app.plist" Both of these locations seem completely illogical for shared UserDefaults. I checked the value returned by FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: "$(TeamIdentifierPrefix)com.my-company.my-app" in both the containing app and the Extension and the value in both of them is the same but has nothing to do with the actual paths where the data is stored as provided above. (The value is as expected - "~/Library/Group Containers/$(TeamIdentifierPrefix)com.my-company.my-app/" P.S. Of course, $(TeamIdentifierPrefix), my-company and my-app here are placeholders for my actual values.
1
0
196
4d
How to make watchos keep the screen on continuously
We developed a camera remote control app for Apple Watch, but during the development process, we found that Apple Watch is prone to sleep on its own without screen interaction (usually automatically sleeping between 5s and 15s when there is no interaction, but our Apple Watch app actually receives the camera preview video frame data we transmit all the time, and there is no data interaction), and then triggers the sessionReachableDidChange function, and the session.isRechable is false. We hope that the camera remote control app for our Apple Watch can remain on when in the foreground, making it convenient to control our camera app on our phone. We found that DJI's Apple Watch app does not automatically sleep and does not sleep for more than 2 minutes. We have tried many methods, such as heartbeat packets, and I have added WKSupportsAlwaysOnDsplay to the Apple Watch info.plist file, but have not found an effective solution. I hope you can provide assistance, thank you.
0
0
64
1d
macOS app can be excluded from the ‘Screen Time’ statistics?
I am a macOS software developer using Xcode and Objective-C. I have a wallpaper app on the App Store, and recently, a few users have asked if the app can be excluded from the ‘Screen Time’ statistics. Is there a way to allow users to choose whether or not the app should appear in the ‘Screen Time’ tracking? I have already set LSUIElement to YES in the info.plist, but the app is still being tracked in ‘Screen Time.
0
0
31
1d
Unblocking Apps After a Scheduled Duration in FamilyControl
I am able to block apps using FamilyControl and Shield. Unblocking is also simple—just assign nil to store.shield.applications. However, I want to unblock them even when the app is not open. Use case: Let's say the app allows users to create a session where a particular app is blocked for a specific duration. Once the session starts, the app should remain blocked, and as soon as the session time ends, it should automatically be unblocked. Please help me with this. Thank you!
0
0
191
3d
Contacts Framework Question
Hey, I would love to access the users Contact (ie. the Me Card) Apple recently released the Invites app and within this app you can find the users Contacts Photo. I tried to replicate this behaviour but I currently need to match based on a name or email or something else. I have no idea how to receive this data because when using the Invites app I only remember the app asking for Contacts permission and nothing else so far. let store = CNContactStore() let keysToFetch = [CNContactImageDataAvailableKey, CNContactImageDataKey, CNContactThumbnailImageDataKey] as [CNKeyDescriptor] let email = "test@test.de" let predicate = CNContact.predicateForContacts(matchingEmailAddress: email) do { let contacts = try store.unifiedContacts(matching: predicate, keysToFetch: keysToFetch) let imageDatas: [Data] = contacts.compactMap { $0.imageData } self.images = imageDatas.map { UIImage(data: $0) ?? UIImage() } } catch { print("Error fetching contacts: \(error)") } This is how I am retrieving the Image. MAYBE someone can help me out. Thank you so far ~ Flo
1
0
172
2w
Live Caller ID on iOS does not work - client requests not reaching backend
I'm reaching out to see if anyone else is experiencing issues with the Live Caller ID feature on iOS. We recently encountered a problem where the feature stopped working entirely. Here's a brief overview of the situation: We were monitoring test traffic on our backend and noticed everything came to a halt around 1:00 AM UTC on November 15th. After this time, any attempts to reach our backend through calls failed completely. I tested this across multiple devices running iOS 18.2 and iOS 18.0. I used both TestFlight builds and development builds via Xcode, which should communicate directly with our backend. I experienced the problem on our main application as well as a dedicated test app. To troubleshoot further, I even set up a local server on localhost and tried directing requests there, but the requests did not reach the local server when a call was received. Further debugging in Console.app revealed the following error: identity request returned error: Error Domain=com.apple.CipherML Code=400 "Error Domain=com.apple.CipherML Code=401 "Unable to request data by keywords batch: failed to fetch token issuer directory" However, when I manually tried to hit our server endpoint using curl, the request successfully reached the server: curl https://our_server/something hb_method=GET hb_uri=/something [Hummingbird] Request -- log on backend This suggests that while our backend is responsive, the requests from the iOS client side are simply not being initiated.
7
3
850
Nov ’24