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

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) } } }
2
0
51
18h
How to remotely disable or block apps on a child’s device using FamilyControls and DeviceActivity API?
After reading Apple documentation (FamilyControls, DeviceActivity, ManagedSettings, ManagedSettingsUI, ScreenTime) and testing the API, I do not find a way to get the child's device apps on the parent device in order to block them or disable them for a certain time. Is there a way of doing it? Or can it only be done locally on the child device?
0
0
160
1d
Failed to get the app and book information for the custom app.
I was importing the app's information based on the document below. https://developer.apple.com/documentation/devicemanagement/getting-app-and-book-information-legacy However, I have failed to get the information of the custom app from a few days ago. The result is empty. This is a request with an empty result. https://uclient-api.itunes.apple.com/WebObjects/MZStorePlatform.woa/wa/lookup?version=2&p=mdm-lockup&caller=MDM&platform=volumestore&cc=jp&id=1556411142 This is the request with results. https://uclient-api.itunes.apple.com/WebObjects/MZStorePlatform.woa/wa/lookup?version=2&p=mdm-lockup&caller=MDM&platform=volumestore&cc=jp&id=1202716089 In ABM/ASM, you can see my assets and both the quantity in use and the quantity available will be searched normally. Is there anything else I can check? Please reply. Thank you.
1
0
72
1d
Date that is not linked to TimeZone
Hello, I'm creating an app that stores multiple Date objects: the users selects a date and a time and receives a notification at this time precisely. The problem that happens is after saving a Date, if the device's timezone changes, the Date also changes - and that is not what's I'm expecting (just want the original time as is without depending on timezone). I have inspected the TimeZone properties when I'm building the Date from DateComponents but nothing has worked. Thank you for your answer.
1
0
153
3d
When Using Callkit audio doesn't have permission to work
I am creating a voip app, I am trying to use call kit to answer calls, however audio doesn't seem to work when using callKit when looking at the systems logs I see no server connection when checking background audio state, won't allow background audio! background audio processAllowed = 0 for displayID com.apple.TelephonyUtilities no server connection when checking background audio state, won't allow background audio! background audio processAllowed = 0 for displayID {my app id} I have the plist entries for background ui modes for voip, audio, fetch and background notifications along with the backgrounds modes for Voip, Audio, AirPlay, and Picture in Picture, Background notifications. I am unsure what to do about this, like my reading of the error is I can't use audio cause I am not connected to a server, but like is it any server, Am I suppose to connect to the voip call before setting up audio, I am not sure how to do that.
1
0
97
3d
UE 5.4 Game Instantly Crash on iOS devices on Testflight
Hi, I'm working on a game for the past few years using first Unreal Engine 4, and now Unreal Engine 5.4.4. I'm experiencingan unusual crash on startup on some devices . The crash is so fast that I'm barely able to see the launching screen sometimes because the app closes itself before that. I got a EXC_CRASH (SIGABRT) so I know that it's a null pointer reference, but I can't quite wrap my head about the cause, I think that's something messed up in the packaging of the app, but here is where I'm blocked, I'm not that accustomed with apple devices. If someone has some advise to give, please, any help will be very valuable. Many thanks. Log : Crash Log on Ipad
0
0
125
3d
CarPlay style API
Is there any way I can get updates when I change CarPlay style settings? I've tried CPSessionConfigurationDelegate.contentStyleChanged and CPTemplateApplicationSceneDelegate.contentStyleDidChange, but they always produce the same result. When I choose: Automatic -> I receive light in case of daylight; Always Dark and Always Show Dark Map toggle on -> dark Always Dark and Always Show Dark Map toggle off -> light. But it seems to be wrong, b/c CarPlay's toolbar is still dark, and I receive light. Is there a way to get a dark style when choosing Always Dark and Always Show Dark Map toggle off? Or at least get updates when the Always Show Dark Map toggle changes?
0
0
80
3d
AVAudioRecorder records silence
We have application using PTT Framework to record audio messages when app is backgrounded. Right now we are using AVAudioRecorder for that purpose. And problem is one specific user has frequent issue - recorded audio contains only silence. I've checked almost everything I can imagine but didn't find any possible reason of issue. Conditions: AVAudioRecorder uses following configuration: [ AVEncoderAudioQualityKey: AVAudioQuality.low.rawValue, AVFormatIDKey : kAudioFormatMPEG4AAC, AVNumberOfChannelsKey: 1, AVSampleRateKey: 16000.0 ] App waits both didBeginTransmitting and didActivate audioSession from PTChannelManager (audio session has playback category at that moment) App does AVAudioSession category change to playAndRecord App gets routeChangeNotification with categoryChange and category = playAndRecord There is no any interruption notifications from AVAudioSession during recording There is no any error notification from AVAudioRecorder Any idea what exactly I do wrong? Is there anything else I should check? Thanks in advance. P.S. it looks like recording audio with AudioUnit has the same issue, but let's exclude it from question atm for simplicity.
2
0
93
3d
Pre-approval for Family Controls Entitlement?
Hi there, I am planning an app that requires use of the Family Controls Entitlement to access data on the user's screen time. I understand that this has to be requested from Apple before it can be used in production. I have found the following form to request approval, but it requires an App and bundle ID, which suggests that approval can only be requested after the app has been developed. https://developer.apple.com/contact/request/family-controls-distribution I'd like to avoid the situation where I spend a lot of time on developing the app, only to find out that the Family Controls Entitlement will not be granted for my use case. Is there any way that I can request provisional pre-approval for my app? Perhaps based on an app description and some mockups? Or, at least some idea of whether my particular use case is likely to be approved? Thanks.
1
0
145
4d
CarKeyRemoteControlSession always returning empty
We are developing an iOS app to connect to vehicles and trigger predefined vehicle controls (door lock/unlock) via the Digital Key framework. We are currently blocked on several aspects and would appreciate your expertise to clarify the following queries. How can we list down connected vehicle information? What is the method to retrieve connection status? How can we perform vehicle control actions (e.g., door lock/unlock)? STEPS TO REPRODUCE Starting the CarKeyRemoteControlSession to Fetch Vehicle Reports Currently, we are using the following API to start a CarKeyRemoteControlSession: open class func start( delegate: any CarKeyRemoteControlSessionDelegate, subscriptionRange subscriptionFunctionIDRange: ClosedRange? = nil, with delegateCallbackQueue: DispatchQueue? = nil ) async throws -> CarKeyRemoteControlSession After successfully creating the session, we check for vehicle reports using the vehicleReports property of CarKeyRemoteControlSession: public var vehicleReports: [VehicleReport] { get throws }
0
0
108
4d
How to Properly Request Full Access to Contacts After User Selects Limited Access?
Hello Apple Developers, I’m developing an iOS app that requires access to the user’s contacts. I understand that starting from iOS 14, Apple introduced two levels of contact permissions: 1️⃣ Full Access – The app can read all contacts. 2️⃣ Limited Access – The app can only access contacts selected by the user. My Question: If a user initially grants Limited Access, is it allowed by Apple’s guidelines to request Full Access later? 🔹 I understand that re-requesting permission immediately after the user denies it is against Apple’s policies. 🔹 However, if the user has already granted Limited Access, and we first show an explanation modal explaining why Full Access is beneficial, can we then prompt them to change their settings via openAppSettings()? 🔹 Alternatively, can we use Permission.contacts.request() again to re-prompt the user for Full Access, or will iOS prevent the permission prompt from appearing again? How We Handle This in the App: 1️⃣ If a user selects Limited Access, we respect their choice and only access their selected contacts. 2️⃣ Later, if Full Access is necessary for an enhanced experience, we display a clear explanation modal explaining why the app needs Full Access. 3️⃣ If the user agrees, we attempt to guide them to openAppSettings(), allowing them to manually change the permission. 4️⃣ However, if Permission.contacts.request() can be used to directly request Full Access again, we would like to know if this is acceptable. We want to ensure that our implementation follows Apple’s privacy guidelines while providing the best user experience. Any official guidance or best practices on this matter would be greatly appreciated. Thank you in advance!
1
0
136
5d
Request array with AppIntents
Hi, I’m trying to get an array of strings from the user using AppIntents, but I’m encountering an issue. The shortcut ends without prompting the user for input or saving the value, though it doesn’t crash. I need to get the user to input multiple tasks in an array, but the current approach isn’t working as expected. Here’s the current method I’m using: // Short code snippet showing the current method private func collectTasks() async throws -> [String] { var collectedTasks: [String] = tasks ?? [] while true { if !collectedTasks.isEmpty { let addMore = try await $input.requestConfirmation("Would you like to add another task?") if !addMore { break } } let newTask = try await $input.requestValue("Please enter a task:") collectedTasks.append(newTask) } return collectedTasks } The Call func perform() async throws -> some IntentResult { let finalTasks = try await collectTasks() // Some more Code } Any advice or suggestions would be appreciated. Thanks in advance!
0
0
127
6d
Request Array with AppIntent
Hi everyone, i'm trying to request in a AppIntent an array of strings. But I want to give the user the chance to add more than one String. Yet, I do it so: import AppIntent struct AddHomework: AppIntent { // some Parameters @Parameter(title: "Tasks") var tasks: [String]? @Parameter(title: "New Task") //Only for the special request var input: String? private func collectTasks() async throws -> [String] { var collectedTasks: [String] = tasks ?? [] while true { if !collectedTasks.isEmpty { let addMore = try await $input.requestConfirmation(for: "Möchtest du noch eine Aufgabe hinzufügen?") if !addMore { break } } let newTask = try await $input.requestValue("Please enter your task:") collectedTasks.append(newTask) } return collectedTasks } @MainActor func perform() async throws -> some IntentResult { let finalTasks = try await collectTasks() // some more code return .result() } } But this is not working. The Shortcut is ending without requesting anything. But it is not crashing. I would thankfully for some help.
0
0
133
6d
Universal link not working
I’m seeking guidance on an issue with my iOS app’s universal link for email verification. The link successfully opens my app, but the verification logic never runs. Here is my setup and the problem details: Associated Domains & AASA I have Associated Domains set to applinks:talkio.me in Xcode. The AASA file is located at https://talkio.me/.well-known/apple-app-site-association with the following contents: { "applinks": { "apps": [], "details": [ { "appID": "VMCWZ2A2KQ.com.elbaba.Flake2", "paths": [ "/verify*" ] } ] } } The direct link we send in the email looks like: https://talkio.me/verify?mode=verifyEmail&oobCode=XYZ&apiKey=ABC When tapped, the app launches, but the universal link handler code below never logs the URL nor triggers the verifyEmailUsing logic. SceneDelegate Logic In my SceneDelegate.swift, I handle universal links in both scene(:willConnectTo:options:) and scene(:continue:userActivity:restorationHandler:): func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { // ... if let urlContext = connectionOptions.urlContexts.first { let url = urlContext.url print("SceneDelegate: App launched with URL: (url.absoluteString)") handleUniversalLink(url: url) } } func scene(_ scene: UIScene, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool { print("⚠️ scene(_:continue:) got called!") guard let url = userActivity.webpageURL else { print("No webpageURL in userActivity.") return false } print("SceneDelegate: Universal Link => (url.absoluteString)") handleUniversalLink(url: url) return true } private func handleUniversalLink(url: URL) { let urlString = url.absoluteString if let oobCode = getQueryParam(urlString, named: "oobCode") { verifyEmailUsing(oobCode) } else { print("No oobCode found => not a verify link.") } } // ... Expected Log: SceneDelegate: App launched with URL: https://talkio.me/verify?mode=verifyEmail&oobCode=XYZ&apiKey=ABC However, I only see: SceneDelegate: sceneDidBecomeActive called No mention of the universal link is printed. Result: The app opens on tapping the link but does not call handleUniversalLink(...). Consequently, Auth.auth().checkActionCode(oobCode) and Auth.auth().applyActionCode(oobCode) are never triggered. What I Tried: Verified the AASA file is served over HTTPS, with content type application/json. Reinstalled the app to refresh iOS’s associated domain cache. Confirmed my Team ID (VMCWZ2A2KQ) and Bundle ID (com.elbaba.Flake2) match in the app’s entitlements. Confirmed the link path "/verify*" matches the link structure in emails. Despite these checks, the universal link logic is not invoked. Could you help me identify why the link is not recognized as a universal link and how to ensure iOS calls my SceneDelegate methods with the correct URL? Any guidance on diagnosing or resolving this universal link issue would be greatly appreciated.
1
0
104
6d
How to validate a property list has the right structure
I need to read data from the user. For convenience, the data will be in a property list, so it's easy to get a dictionary containing the property list data. But, since it's coming from outside, I need to validate that the data is in the required format, i.e. it has the right keys and the right sort of data for each key, e.g. <name> has a string, <keys> has an array of appropriate values. Since this is part of a long-established product, and targets 10.13, I want to do this in Objective-C if possible. I've been working mostly with Swift in recent years, so I've forgotten a lot of what I used to know about Objective-C, I'm sure. My first thought was to obtain the value for each key and check the class type with isa, but I see that's deprecated in macOS 13 with no replacement. I don't see another way to check the class. I'm sure other people have solved the same problem, but my searches have not turned up any answers.
2
0
177
1w