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

How to find renamed app using old name in Spotlight?
We are planning on renaming our app. The new name is not like the current name. It will be renamed in the App Store as well as the App display name. Yet, we still want new and existing users to be able to find the app by using the old name in search/spotlight under iOS. A great example of this is entering Twitter to find the X app and it shows up in the App section in the Spotlight search. Are there any guidelines, settings, or tricks for doing this? Some have suggested adding a Spotlight search term but that will not have it show up in the App section I fear.
1
0
97
1w
Widget Configuration's Selected Parameter Always Reverts to Default
I created an intent for a configurable widget that lets users choose an option for a parameter called "domain." I've successfully loaded the selectable items for this parameter using the following code: import Intents class IntentHandler: INExtension, ConfigChartIntentHandling { func provideDomainOptionsCollection(for intent: ConfigChartIntent) async throws -> INObjectCollection<Domain> { let prefs = UserDefaults(suiteName: "group.name") let domains = prefs?.stringArray(forKey: "domains") if let domains { let optionsCollection = domains.map { Domain(identifier: $0, display: $0) } return INObjectCollection(items: optionsCollection) } else { // If no options, provide an empty list or a default option return INObjectCollection(items: []) } } } The issue occurs when I select a value for the "domain" parameter. Each time I select a value and then reopen the configuration modal, the field reverts back to "Choose." Here's a screenshot illustrating the behavior: Additionally, the widget doesn’t refresh after I change the "domain" value. However, another parameter using an enum ("Stats Type") works as expected. Is there something I might be missing? My Environment: MacOS Sonoma XCode 15.4
0
0
100
1w
Does Live Activity always receive updates for pushToStartTokenUpdates and activityUpdates?
Our context involves smart kitchen appliances, where cooking may be initiated by an app or directly by the device. When the app is not running, we can only start a Live Activity through a remote push notification. However, an increasing number of users report issues where they cannot update or terminate the Live Activity. While we can reproduce this issue in some cases, it is inconsistent and lacks a clear pattern. I have a sample project and would like to confirm the following questions: When the app is not running, does each pushToStartToken update wake the app and reliably trigger the callback below? for await pushToken in Activity<DeviceAttributes>.pushToStartTokenUpdates { } When the app is not running, does each pushTokenUpdates update wake the app and reliably trigger the callback below? Task { for await activity in Activity<DeviceAttributes>.activityUpdates { Task { for try await tokenData in activity.pushTokenUpdates { } } } } Must pushToStartTokenUpdates and pushTokenUpdates be placed directly in application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?), or can they be in another wrapper, such as an RxSwift wrapper? If pushTokenUpdates is updated, but the received pushToken fails to synchronize to the server due to network issues, how should this be handled? Alternatively, if you have any better suggestions, I would be very grateful to hear them. Here is a simple example.
1
0
69
2w
Google admob not working for specific bundle identifier iOS
I'm integrating AdMob rewarded interstitial ads into my live iOS app using CocoaPods and package dependency management. The ads are working fine when I use the bundle identifier com.CreativeCub.ProgrammingHu, but when I use the correct identifier com.CreativeCub.ProgrammingHub, the ads stop working. Here’s what I’ve tried: Verified that the bundle identifier matches across Xcode and AdMob. Double-checked the App ID and Ad Unit ID in the AdMob dashboard for com.CreativeCub.ProgrammingHub. Reinstalled the AdMob SDK using CocoaPods. Attempted to integrate AdMob using Swift Package Manager. Created a test project to rule out potential issues with my existing project. Despite these steps, ads only work when I use the shortened bundle identifier (com.CreativeCub.ProgrammingHu), which is not the correct one. Contacted Google admob support for the same but did not worked Tried running in different MacBook system
2
0
154
2w
iOS App terminates but does not generate Crash Report
The app exits immediately on startup, there is no crash message, and I can't get any valuable diagnostic information. It doesn't even get to the main function. It feels like exit is being called somewhere, and then I used atexit to register the relevant handler. Finally, I found the following stack printout It looks like it's a dynamic linking issue, so what's the best way to troubleshoot it. This problem only occurs in release versions.
1
0
75
2w
iOS Message Filter Extension - deferQueryRequestToNetwork(completion:) error
iOS Message Filter Extension - deferQueryRequestToNetwork(completion:) error I made a test app using the iOS App template and added a target using the Message Filter Extension template which invokes deferQueryRequestToNetwork(completion:) when receiving an SMS. The app and the extension have same "Associated Domains Capabilities" with "messagefilter" pointing to a server which receives query requests and returns proper responses. The extension has the "ILMessageFilterExtensionNetworkURL" key in Info.plist file which specifies the server URL. deferQueryRequestToNetwork(completion:) throws a com.apple.calls.messagefilter error which reads "Extension's containing app (appID ) unauthorized to defer requests to host "
0
0
95
2w
DST, DateEncodingStrategy.iso8601, and UTC Fun
Hello, My code calls a macOS system library which returns Foundation Date properties. I have a program that will run every night, and output the data via the Swift JSONEncoder and uses DateEncodingStrategy.iso8601. As you likely know, a DST shift happened over the weekend here in the US. In my output, every single Date changed by 1 hour, despite the fact that nothing in the underlying data changed overnight. Here is an example diff in the output. I see the "Z", which I think should not be affected by DST changes. - "dateAdded" : "2003-12-15T17:02:56Z", - "dateModified" : "2007-03-07T04:31:16Z", + "dateAdded" : "2003-12-15T18:02:56Z", + "dateModified" : "2007-03-07T05:31:16Z", Here is a sample of the data: public struct Track: Codable, Hashable { var dateAdded: Date? var dateModified: Date? } And the encoding is here: extension Array where Element == Track { public func jsonData() throws -> Data { let encoder = JSONEncoder() encoder.outputFormatting = [.prettyPrinted, .sortedKeys] encoder.dateEncodingStrategy = .iso8601 return try encoder.encode(self) } } Pretty basic stuff overall. So my questions are: Am I correct in my assumption that .iso8601 is UTC, and that UTC is daylight savings shift agnostic? Is this the right way to ensure the my JSON is encoded in UTC? If the library I am calling is building its Date incorrectly, how may I work around the problem? I'm not reporting the library name right now, in order to ensure that my code is doing the right thing without assumptions. Thanks for any tips!
4
0
157
2w
INPlayMediaIntentHandling, Unable to Trigger App to Play Specific Podcast
I have an app that's capable of playing podcasts via Siri requests, e.g. "Hey Siri, play [Podcast Name]". I’m using INPlayMediaIntentHandling, that is, the SiriKit domain intents, as opposed to the newer AppIntents framework for its ability to select my app for audio playback without the need to specify the name of the app in the user's request to Siri. This works great overall for the many podcasts I’ve tested the app with, with the exception of one. There's a podcast called "The Headlines", and I when I test the app with the request "Hey Siri, play The Headlines", my app is never selected. Instead, Apple Podcasts begins playback of a show called "NPR News Now". Oddly, if the Apple Podcasts app is deleted, my app will still not be selected by the system, and instead, Siri responds with "I don’t see an app for that. You’ll need to download one" with a button to open the App Store. Additionally, if I do add the app name to the request using this style of intent, Siri responds with "[App Name] hasn’t added support for that with Siri." However, I’d still like to accomplish this without requiring the app name in the Siri request. There's nothing complex in my setup: The target declares one supported intent, INPlayMediaIntent, with "Podcasts" selected as a supported media category. The Siri entitlement is enabled. My INSiriAuthorizationStatus is .authorized. My intent handler is specified in my AppDelegate as follows: func application(_ application: UIApplication, handlerFor intent: INIntent) -> Any? { return IntentHandler.shared } My intent handler is simple: final class IntentHandler: NSObject, INPlayMediaIntentHandling { static let shared = IntentHandler() func handle(intent: INPlayMediaIntent) async -> INPlayMediaIntentResponse { print("IntentHandler: processing intent: \(intent)") /** code to start playback based on information found in `intent` **/ } When requesting Siri to "Play The Headlines", my handler code is not called at all. For all other supported shows, the print statement executes, and playback begins as expected. Is there any way I can get my app to be selected instead of Apple Podcasts for this request?
1
0
121
2w
Issue with Siri Not Displaying Prompt in App Intent
Hello everyone, I'm currently working on an App Intent for my iOS app, and I’ve encountered a frustrating issue related to how Siri prompts for a category selection. Here’s an overview of what I’m dealing with: extension Category: AppEntity, @unchecked Sendable { var displayRepresentation: DisplayRepresentation { DisplayRepresentation(title: "\(name)") } static var typeDisplayRepresentation = TypeDisplayRepresentation(name: "Category") typealias DefaultQueryType = ShortcutsCategoryQuery static var defaultQuery: ShortcutsCategoryQuery = ShortcutsCategoryQuery() } struct ShortcutsCategoryQuery: EntityQuery { func entities(for identifiers: [String]) async throws -> [Category] { let context = await ModelContext(sharedModelContainer) let categories = try CategoryDataProvider(context: context).getItems() return categories.filter { identifiers.contains($0.id) } } func entities(matching string: String) async throws -> [Category] { return try await suggestedEntities() } func suggestedEntities() async throws -> [Category] { let context = await ModelContext(sharedModelContainer) do { let categories = try CategoryDataProvider(context: context).getItems() if categories.isEmpty { print("No categories found.") } return categories.map { category in Category( id: category.id, name: category.name, stringSymbol: category.stringSymbol, symbol: category.symbol, stringColor: category.stringColor, color: category.color ) } } catch { print(error) return [] } } } The issue arises when I use Siri to invoke the intent. Siri correctly asks me to select a category but does not display any options unless I said something that Siri recognized, like "Casa(House) or *****(Test)" in portuguese. Only then does it show the list of available categories. I would like the categories to appear immediately when Siri asks for a selection. I've already tried refining the ShortcutsCategoryQuery and debugging various parts of my code, but nothing seems to fix this behavior.
1
0
179
2w
App unexpectedly crashes after installation from testflight
I've an app running for some time in the Appstore now. Recently I had to renew my singing certficicates to be able to publish my app again. I renewed the certificates, updated my provisioning profile and signed a new app version to publish only to find out that the app crashes during the splash screen. I added new features to the app so my first thought was that there would be an issue there. To test that, I built the latest stable version of the app and signed it with the new profivisioning profile. The result was exactly the same crash as the new build. My assumption is that the crash is caused by bad signing (?) but I am not sure because I'm lacking experience on that front. I do have a crash report from testflight and logs from the device where the app crashed. Testflight crash: TestFlight crashlog Device error logs: Device error logs Hope someone can help my out because I'm at a dead end :(
1
0
146
2w
How to force update data from child phone ? FamilyControls / Screen Time Api / DeviceActivity
The data displayed about a child’s apps can be outdated (DeviceActivityReport), leading to misinformation for the user. When I access the “Screen Time” section (for child in the parent device) in the iPhone settings, I see there is an update functionality to force load the actual data. I have tried various workarounds, such as attempting to force an update on the child’s device to call DeviceActivityReport and opening system settings, but none of these have been successful :( How can I implement something similar? Is there a way to force update this data ?
0
2
160
2w
iPhone mirroring screen switching (request & question)
iPhone mirroring is available from macOS 15. When running an app with iPhone mirroring Can I know whether the app currently being mirrored is running at the top of the Mac app or screen? Or is there a way to know whether it is hidden by another app on the Mac or re-displayed? If not, I hope it will be added in a future update. And I hope there is an API that can tell whether the current app is connected to iPhone mirroring or not.
0
0
130
2w
iPhone Mirroring UITextView Selectable
iPhone mirroring function has been added to this macOS. I am also currently using the iPhone mirroring function. However, when isSelectable is set to true in UITextView and isEditable is set to false (isScrollEnabled is also set to false.) Editing is not possible, but selection is possible. (In non-mirroring mode) But in iPhone mirroring mode, selection is not possible Is there an option for UITextView that allows text selection or a separate setting in macOS? Or can this be fixed in the iPhone mirroring app when macOS is updated in the future? (If it is a bug or error?) It seems to work normally in cases where UITextView is used but Edit is possible, such as in the memo app.
0
0
110
2w
Setting up app lunch argument using ProcessInfo.processInfo.arguments not working in iOS 18
Hi, I'm trying to set up FIRDebugEnabled as launch arguments in app delegate based on user choice using ProcessInfo.processInfo.arguments. Which is working fine in iOS 17 and below devices and stoped working in iOS 18 Here is my sample, if condition { var arguments = ProcessInfo.processInfo.arguments arguments.append("-FIRDebugEnabled") ProcessInfo.processInfo.setValue(arguments, forKey: "arguments") }
2
0
203
2w
While screen after publishing
I recently published a new version of my app (I'm fairly new to this) once it was marked ready for distribution I can see it updated in App Store and it allowed me to update. but when I open the app my previous launch screen is present then the screen gos white and stalls. what did I do wrong
1
0
109
2w