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.

Posts under General subtopic

Post

Replies

Boosts

Views

Activity

Spotlight doesn't show .html file results
When I search for text in a .html file using the Command-Spacebar spotlight popup the .html file is never shown in the results. On the other hand the .html file does show in the result when I search in the Finder window search field, or when I search in the Terminal using mdfind. Why is this and how can I fix? I want to use spotlight to find .html files. You can reproduce the problem like this: echo spotlighttest > testone.txt % echo spotlighttest > testtwo.html % mdfind spotlighttest 2024-12-30 14:22:28.552 mdfind[28326:550500] [UserQueryParser] Loading keywords and predicates for locale "en_US" 2024-12-30 14:22:28.553 mdfind[28326:550500] [UserQueryParser] Loading keywords and predicates for locale "en" ~/Desktop/Spotlighttest/testone.txt ~/Desktop/Spotlighttest/testtwo.html I believe this shows that both files are index properly, but if you then do Command-Spacebar and search for "Spotlighttest" I think you will see that only testone shows as a result. Edit I believe this is a change in macOS 15.x and used to work correctly in previous macOS
6
0
451
Dec ’24
When user opened my application, it crashed immediately. [Firebase crash report CFNetwork]
When user opened my application, it crashed immediately. This is crash log message from firebase. com.apple.CFNetwork.Connection EXC_BAD_ACCESS KERN_INVALID_ADDRESS After restarting iPhone, user can use my application without crash. I cannot reproduce this crash from other device. Here are .ips crash log that I changed to .txt. crashLog-2024-12-26-182447.txt crashLog-2024-12-26-182449.000.txt crashLog-2024-12-26-182535.000.txt crashLog-2024-12-26-182535.txt Do you have any idea to fix this?
2
0
615
Jan ’25
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
255
Feb ’25
Launch URL
Hi I am developing a game app with Epic Unreal Engine. I am testing this as testFlight these days. My problem is “launch URL” what a function in Unreal Engine. This is a function that allows user to search the Internet with the entered URL. It worked well before. But not now. I don't know when it did start not working. It's like after the iPhone IOS update or the Xcode update. Mac sequoia 15.1.1 Xcode 16.2 ( Unreal Engine 5.4.4 ) IOS is 18.2. but It didn't work since the just previous version. Any advice can I get?
0
0
263
Dec ’24
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
334
Feb ’25
UIViewController.view.backgroundColor auto changed when present
This is easy to reproduce,in dark mode, 2 UIViewControllers A and B, A present B. code: class AAA: UIViewController { override func viewDidLoad() { super.viewDidLoad() navigationItem.title = "AAA" view.backgroundColor = .systemBackground } override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) { present(UINavigationController(rootViewController: BBB()), animated: true) } } class BBB: UIViewController { override func viewDidLoad() { super.viewDidLoad() navigationItem.title = "BBB" view.backgroundColor = .systemBackground } override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) { dismiss(animated: true) } } before present: after present: Obviously, the backgroundColor of the view has changed. I guess it's because view's backgroundColor is the same as the the window, so changed the color to distinguish between the controller and the background, but this brought unexpected changes which is confusing. I want to know how this happened and how I can manually control it
1
0
295
Jan ’25
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
323
Feb ’25
Any way to adjust the speechRecognitionMetadata pause duration?
Speech Framework I've been checking for SFSpeechRecognitionMetadata to determine the end of a sentence when using Voice Recognition. Yet it doesn't detect small pauses but only large ones, so that I've transcribed basically an entire paragraph before going onto the next one. Besides implementing your own timer, are there any other ways to have more natural pauses to detect the end of sentences, similar to the browser's Web Speech recognition? Since it's in Safari, I assume there should be some similar feature that can be equivalent in MacOS.
0
0
343
Dec ’24
Issue with Missing Private Key After Adding Push Notification Certificate to Keychain
Hi All, I have created a Push Notification certificate from my Apple Developer account. After downloading the aps.cer file and adding it to my Keychain, the certificate was added successfully, but the private key is missing. Has anyone encountered a similar issue in the past? What could be causing this problem?
0
0
413
Dec ’24
Screen-time in Device Activity Report Extension vs In Phone Settings
Am showing daily screen-time of a user in my app in Device Activity Report Extension. The only way to get that is to sum up all the activityDuration of apps/categories/domains. But it differs a lot from phone's settings screen-time, why? I have debugged in details and counted manually the time spent on each app and it turned out that the calculation is appearing correctly in my app but Phone settings showing quite less time on top (Day).
0
0
392
Jan ’25
Issue with Live CallerID URL Caching
I've been testing the Live CallerID feature using the Apple-provided local server example - live-caller-id-lookup-example. I've been running a local server with tunneling using ngrok for the initial setup. Everything was working perfectly with the following setup: @main final class CallerID: LiveCallerIDLookupProtocol { var context: LiveCallerIDLookupExtensionContext { LiveCallerIDLookupExtensionContext( serviceURL: URL(string: "https://example-tunnel.ngrok.io")!, tokenIssuerURL: URL(string: "https://example-tunnel.ngrok.io")!, userTierToken: Data(base64Encoded: "BBBB")! ) } } However, after I updated the URLs to the production ones, I encountered an issue: @main struct CallerID: LiveCallerIDLookupProtocol { var context: LiveCallerIDLookupExtensionContext { LiveCallerIDLookupExtensionContext( serviceURL: URL(string: "https://example.net/")!, tokenIssuerURL: URL(string: "https://example/issue")!, userTierToken: Data(base64Encoded: "BBBB")! ) } } The problem is that during calls or when updating PIR parameters, the application still attempts to connect to the initial ngrok tunnel URLs instead of using the new production URLs. I can confirm this because the logs on my local server show incoming requests, indicating that the application is still referencing the old ngrok tunnel URLs. Steps I’ve taken to resolve the issue include: Deleting and reinstalling the application. Using reset(forExtensionWithIdentifier:) Unfortunately, these attempts have not been successful. I even extracted the binary of the app and extension to inspect the strings, confirming that the correct production URLs are present. The server was started with the following command: PIRService --hostname 127.0.0.1 service-config.json Could this be some sort of caching bug on the iOS side, or am I missing something?
0
0
411
Dec ’24
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
402
Feb ’25
How can I create a AppIntent with SwiftData correctly?
I currently create a AppIntent that contains a custom AppEntity, it shows like this struct GetTimerIntent: AppIntent { static let title: LocalizedStringResource = "Get Timer" @Parameter(title: "Timer") var timer: TimerEntity func perform() async throws -> some IntentResult { .result(value: timerText(timer.entity)) } static var parameterSummary: some ParameterSummary { Summary("Get time of \(\.$timer)") } func timerText(_ timer: ETimer) -> String { // Implementation Folded } } struct TimerEntity: AppEntity { var entity: ETimer static let defaultQuery: TimerQuery = .init() static var typeDisplayRepresentation: TypeDisplayRepresentation { TypeDisplayRepresentation(name: "Timer") } var id: UUID { entity.identifier } var displayRepresentation: DisplayRepresentation { DisplayRepresentation(title: "\(entity.title)") } } To get the timers, I create a TimerQuery type to fetch them from SwiftData containers. struct TimerQuery: EntityQuery, Sendable { func entities(for identifiers: [UUID]) async throws -> [TimerEntity] { print(identifiers) let context = ModelContext(ModelMigration.sharedContainer) let descriptor = FetchDescriptor<ETimer>( predicate: #Predicate { identifiers.contains($0.identifier) }, sortBy: [.init(\.index)] ) let timers = try context.fetch(descriptor) print(timers.map(\.title)) return timers.map { TimerEntity(entity: $0) } } } Everything looks make sense since I code it. When I'm testing, the console jump No ConnectionContext found for 105553169752832 and I can't get my datas. How can I solve this issue?
1
0
922
Jan ’25
iOS 18.3.1 - QLPreviewControllerView closing triggers AX Lookup problem - errorCode:1100 error:Permission denied portName:'com.apple.iphone.axserver' PID:1022
Since iOS 18.3.1, In lower iOS versions it works fine though. QLPreviewController shows a blank white screen instead of showing the document. Additionally, it does not display the 'Done' option at the top-right to close the view. Presenting the QLPreviewController works fine to display the document, but for the second time, it renders the blank white screen as described. While launching QLPreviewControllerView for the first time. I'm receiving the following message in the console and it displays the document. LaunchServices: store (null) or url (null) was nil: Error Domain=NSOSStatusErrorDomain Code=-54 "process may not map database" UserInfo={NSDebugDescription=process may not map database, _LSLine=72, _LSFunction=_LSServer_GetServerStoreForConnectionWithCompletionHandler} Attempt to map database failed: permission was denied. This attempt will not be retried. Closing the QLPreviewController with the help of the 'Done' option from top-right or swipe to close triggers the following message in the console. Connection to appex interrupted AX Lookup problem - errorCode:1100 error:Permission denied portName:'com.apple.iphone.axserver' PID:1022 ( 0 AXRuntime 0x00000001d2cd7758 _AXGetPortFromCache + 796 1 AXRuntime 0x00000001d2cdd02c AXUIElementPerformFencedActionWithValue + 700 2 UIKit 0x0000000258cdf488 7F0274D9-D3C9-3193-B606-1C74BE53B86C + 1537160 3 libdispatch.dylib 0x0000000101bb888c _dispatch_call_block_and_release + 32 4 libdispatch.dylib 0x0000000101bba578 _dispatch_client_callout + 20 5 libdispatch.dylib 0x0000000101bc2454 _dispatch_lane_serial_drain + 840 6 libdispatch.dylib 0x0000000101bc325c _dispatch_lane_invoke + 408 7 libdispatch.dylib 0x0000000101bd06fc _dispatch_root_queue_drain_deferred_wlh + 328 8 libdispatch.dylib 0x0000000101bcfd0c _dispatch_workloop_worker_thread + 580 9 libsystem_pthread.dylib 0x0000000225ea4680 _pthread_wqthread + 288 10 libsystem_pthread.dylib 0x0000000225ea2474 start_wqthread + 8 ) Trying to open he document again, Ultimately results in the white blank screen to be displayed with no options to close. It displays the Navigation bar only for the fraction of time. Leading users to force close the app and start again.
1
0
217
Mar ’25
Filtering MMS Messages with Multimedia Content (Images, Videos, etc.)
Hi Apple Developer, I’m working on a message-filtering application and reviewing Apple's documentation on message filtering. The documentation clearly states that MMS messages can be filtered. (https://developer.apple.com/documentation/identitylookup/sms-and-mms-message-filtering) When we refer to MMS, it includes images, short videos, and other supported multimedia formats. However, the ILMessageFilterQueryRequest only provides the message body as a String, meaning we can access text and links but not images or other media files. Could you please confirm whether Apple allows third-party applications to access multimedia content sent from unknown numbers? Looking forward to your quick response. Thanks, Rijul Singhal
0
0
274
Feb ’25