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

DeviceActivityReportExtension / ScreenTimeBriefReport does not localize strings
Hello, In one of our apps we use DeviceActivityReportExtension to show the user how much screen time is remaining. The calculation is working as expected, but we have noticed that the labels in our ScreenTimeBriefReport are not localized to the device language. Example: Device with language set to Swedish App fully translated to English and Swedish Result: All labels in app are using the Swedish translations, except the strings in our ScreenTimeBriefReport instance. These labels are using the English localization. I've verified it's using the English localization from our Localizable.xcstrings file. I tried logging device language from our ScreenTimeBriefReport instance, but I could not see anything in Console.app. I guess this is intentional so no sensitive user information can be extracted. Is this a known feature or bug? If it's the latter, is there a known workaround? Sincerely, César
1
0
546
Jan ’25
Failed Message when running the default app.
Hi, My env. is .. Xcode: Version 16.2 (16C5032a) macOS Sequoia: Version 15.1 And I have 2 problems. Please give me the advice.. Failed Message. When I run the automatically generated app as it is, the following error(warning?) message appears in the terminal. Can't find or decode reasons Failed to get or decode unavailable reasons NSBundle file:///System/Library/PrivateFrameworks/MetalTools.framework/ principal class is nil because all fallbacks have failed Not on the simulator And the result is not running in the simulator, but instead appears as a window. (The simulator works fine when launched separately, but the app from the current project doesn’t show up in it.)
1
0
340
Jan ’25
Testing iOS Smart Banner in Debug or Non-Production Mode.
Hello, I'm currently working with Smart App Banners and trying to test how they appear and behave on iOS. However, I need to test the Smart Banner in a debug or non-production environment to ensure everything works as expected. According to the documentation for Smart App Banners (https://developer.apple.com/documentation/webkit/promoting-apps-with-smart-app-banners?language=objc), it appears that the banner only shows in production builds or live apps. Is there any way to trigger or test the Smart Banner in a debug mode or non-production environment? Any advice or workaround for testing this feature would be greatly appreciated! Thank you in advance!
1
0
1k
Mar ’25
Deeplink between two standalone watchos App
I have two standalone app written for watchos (standalone). One to authenticate and one for connectivity to real-world devices. The connectivity app uses the authentication app before every action, Im testing this with two xcode projects I have created and tried different things ended up with this error. authapp://authenticate?callback=linkingapp://callback -[SPApplicationDelegate extensionConnection:openSystemURL:]:2418: URL with scheme "authapp" not supported how to get the url scheme working? Tested this in simulator and real device. info.plist and AppDelegate files are placed in both apps.
1
0
1.1k
Feb ’25
Intermittent White Screen Issue on iOS 18.1.1 for a Hybrid Shopping App
Hello everyone, I’m running an Objective-C–based hybrid (native + web) shopping application and encountering a recurring issue on devices running iOS 18.1.1: When the app launches, it only shows a white screen with the native frame visible—no web content loads. Restarting or reinstalling the app doesn’t help. In one instance, toggling Airplane Mode on and off brought the app back to normal, but this workaround isn’t consistent. There are no crash logs, so we can’t determine if it’s caused by a network error, cache conflict, or an OS-level bug. So far, we have only seen this issue on iOS 18.1.1 devices. Because our app is a shopping platform, this significantly impacts users. Questions: Could this be related to a known bug or limitation in iOS 18.1.1? Are there recommended diagnostic steps or workarounds for a hybrid app that shows a white screen without generating crash logs? Which additional details (e.g., system logs, network traces, device configurations) might help isolate the cause? Any insights or suggestions would be greatly appreciated. Thank you in advance!
0
0
119
Feb ’25
Feedback Assistant nonresponse
Hi All, Had a question. Is there a point to submit anything through the feedback assistant (https://feedbackassistant.apple.com)? I mean it doesn't seem like any engagement occurs through the platform on any issues submitted.
2
0
254
Dec ’24
Using Flutter with CallKit
When using CallKit in my flutter app audio(both mic and speaker) stop working. When not using call kit to answer calls the app work fine. I am using the flutter flutter_callkit_incoming to use callkit and flutter_webrtc for the telephony. Flutter_callkit_incoming has some boilerplate code code include sections to uncomment when using webrtc and I have seen multiple fixes to suggest to make sure the to configure sharedAudioSession before the callkit is sent. Neither of this approaches seemed to have worked.
2
0
399
Feb ’25
Sequoia - Messages not receiving after 7+ hrs of uptime
Issue: Using Messages in macOS Sequoia, I stop receiving any messages after 7+ hrs of the system being on. Troubleshooting: any messages sent to the target account doesn't show up when this issue occurs. I'm able to send messages from the target account which is received. only way to get it working is to reboot the computer but those messages sent never arrive to the target account even after reboot. upon reboot the behavior functions as expected. however the issue returns after 7hrs+ after reboot. logout and log back in when the system is in this state doesn't resolve the issue. only a reboot but the issues eventually returns. note the 7hrs+ is tested and is more accurately 7-10 hrs.
1
0
385
Dec ’24
How to implement continuous speech recognition in the background?
Hi, I'd like to develop an app which runs speech recognition even after going into background. I know I can accomplish this using audio background mode and the process the audio but I am not sure if this workaround would get accepted into App Store because of the processing limitations while in the background. How can I accomplish this while still being compliant with Apples privacy policy and other restrictions? Thanks, Marek
0
0
475
Dec ’24
transferRepresentation for AppEntity containing parameters of multiple types
I have an App Intent that returns a MyEntity value with the following properties: struct MyEntity: AppEntity { @Property(title: "Title") var title: String? @Property(title: "Image") var image: IntentFile? } I created a Shortcut that takes the output value of this intent and passes it as the input to the Send Message action. When I tap the MyEntity parameter in the message action, it shows to be of Type MyEntity. Below that, I can select 1 of 3 options: MyEntity, Title, or Image. When I run the shortcut, a new message compose window appears with the following behavior depending on the selected option: MyEntity - the message draft is empty Title - the message draft shows the title string Image - the message draft shows the image My expected and desired result when MyEntity is selected would be a message draft populated with the image and the title string as text. How would I achieve this? Is it possible? I've experimented with conforming MyEntity to Transferable. That's enabled use cases such as passing the MyEntity input as Type Image for example. Do I need to create a custom UTType to represent MyEntity, or is that unrelated to my issue? I haven't explored this yet but seems potentially related!
0
0
397
Jan ’25
DeviceActivityMonitor.intervalDidEnd never getting called
I'm trying to build an app with a DeviceActivityMonitor extension that executes some code after 15 minutes. I can confirm that the extension is set up correctly and that intervalDidStart is executed, but for some reason the intervalDidEnd method never gets called. What I'm doing in both is just registering a local notification. class DeviceActivityMonitorExtension: DeviceActivityMonitor { let store = ManagedSettingsStore() override func intervalDidStart(for activity: DeviceActivityName) { createPushNotification( title: "Session activated!", body: "" ) super.intervalDidStart(for: activity) } override func intervalDidEnd(for activity: DeviceActivityName) { createPushNotification( title: "Session ended", body: "" ) super.intervalDidEnd(for: activity) } private func createPushNotification(title: String, body: String) { let content = UNMutableNotificationContent() content.title = title content.body = body // Configure the recurring date. var dateComponents = Calendar.current.dateComponents([.era, .year, .month, .day, .hour, .minute, .second], from: Date().addingTimeInterval(1.0)) dateComponents.calendar = Calendar.current dateComponents.timeZone = TimeZone.current // Create the trigger as a repeating event. let trigger = UNCalendarNotificationTrigger(dateMatching: dateComponents, repeats: false) let uuidString = UUID().uuidString let request = UNNotificationRequest(identifier: uuidString, content: content, trigger: trigger) // Schedule the request with the system. let notificationCenter = UNUserNotificationCenter.current() notificationCenter.add(request) } } And this is the method that is starting the monitoring session: @objc public static func startSession() -> String? { // Calculate start and end times let center = DeviceActivityCenter() let minutes = 15 let startDate = Date().addingTimeInterval(1) guard let endDate = Calendar.current.date(byAdding: .minute, value: minutes, to: startDate) else { return "Failed to create end date?" } // Create date components and explicitly set the calendar and timeZone let startComponents = Calendar.current.dateComponents([.era, .year, .month, .day, .hour, .minute, .second], from: startDate) let endComponents = Calendar.current.dateComponents([.era, .year, .month, .day, .hour, .minute, .second], from: endDate) // Create schedule let schedule = DeviceActivitySchedule( intervalStart: startComponents, intervalEnd: endComponents, repeats: false ) print("Now", Date()) print("Start", startDate, startComponents) print("End", endDate, endComponents) print(schedule.nextInterval) do { // Use a consistent activity name for our simple implementation let activity = DeviceActivityName("SimpleSession") try center.startMonitoring(activity, during: schedule) return nil } catch { return "Failed to start monitoring: \(error)" } } I can confirm my dates & date components make sense with the 4 print statements. Here is the output: Now 2025-02-12 04:21:32 +0000 Start 2025-02-12 04:21:33 +0000 era: 1 year: 2025 month: 2 day: 11 hour: 20 minute: 21 second: 33 isLeapMonth: false End 2025-02-12 04:36:33 +0000 era: 1 year: 2025 month: 2 day: 11 hour: 20 minute: 36 second: 33 isLeapMonth: false Optional(2025-02-12 04:21:33 +0000 to 2025-02-12 04:36:33 +0000) I get the Session activated! notification but never get the Session ended notification. Half an hour later, I've tried debugging the DeviceActivityCenter by printing out the activities property and can see that it is still there. When I try to print out the nextInterval property on the schedule object i get from calling center.schedule(for:), it returns nil. I'm running this on an iPhone 8 testing device with developer mode enabled. It has iOS 16.7.10. I'm totally lost as to how to get this to work.
1
0
367
Feb ’25
Secure Integration of Apple Calendar (iCalendar) in a Third-Party App
Hi everyone, We’re integrating Apple Calendar (iCalendar) into our Codapet app but haven’t found any official Apple APIs for event management and synchronisation. Currently, we use CalDAV with Apple ID authentication and an app-specific password (ASP), storing the ASP encrypted in our database and decrypting it for each API call. We’re looking for a more secure and recommended approach to this integration. Does Apple provide dedicated APIs for calendar sync, or is there a better alternative to avoid sending the ASP with every request? Any guidance or best practices would be greatly appreciated! Thanks!
0
0
133
Mar ’25
How to properly share code between launch in background and launch in foreground?
I've been reading this question: https://developer.apple.com/forums/thread/701945 and watching the videos on background tasks But can't arrive to a concrete solution. Q1: Are there any tips (or sample app) on how to handle a launch in background in a streamlined way? How to have a shared code that is ran for both 'launch in background' & 'launch in foreground'? Specifically the case I'm talking about is: You set up some observance of some OS callback at a Foo screen of your app. Example app should request and then send push-to-start live activity tokens to server. Or setup location tracking. App is then suspended and then later terminated but is eligible for relaunch App is then launched in background because it has requested a push-to-start live activity token or an update for location tracking. User DOES NOT go back to screen Foo. So at this point app is no longer tracking / listening to updates for token update or location changes. How should I architecture my code for this? I'm trying to see if there's a an approach where I can avoid having multiple places in code where I do the same thing. Currently what I'm doing is as such: Q2: Is it then correct to say that anytime you've launched your app, whether it's in foreground or background then you must immediately match 'all observations done by the previous app launch'? Like store items in UserDefaults and upon launch retrieve them and do: handleGeneralAppLaunchFlow() // ALSO if defaults.contains("didLastLaunchSetupLiveActivtiyTokenObservance") { for await ptsToken in Activity<EmojiRangers> .pushToStartTokenUpdates { ... } } if defaults.contains("didLastLaunchSetupLocationTracking") { locationManager = CLLocationManager() locationManager?.delegate = itsDelegate locationManager?.allowsBackgroundLocationUpdates = true locationManager?.showsBackgroundLocationIndicator = true locationManager?.startUpdatingLocation() } // Other checks for prior observance setup Q3: Actually I think even if app is launched in foreground then because you may not end up at screen Foo again, then you must setup things regardless of app state and just based on prior observations set. Right? Q4: And then later if the user ever made it again to screen Foo, then we just skip the re-do of the observance, or maybe to just keep things simple, we'd just redo without over-engineering things? I tried to mark my questions with Q1- Q4.
1
0
187
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
267
Feb ’25
adding forecastNextHour to dataset significantly changes currentWeather
I have been struggling with getting accurate data from the weatherkit api. It tends to be just different enough from the weather app on the phone. While debugging this I randomly added forecastNextHour to my dataset string and it suddenly made everything match the app and the data looked good. For example there is at this moment a snow storm in Billings. This url: https://weatherkit.apple.com/api/v1/weather/en-US/45.79/-108.50?dataSets=currentWeather,forecastHourly,forecastNextHour&timezone=America/Denver&country=US says that there is heavy snow, and there is a 100% chance for the next few hours. This matches the iOS app. This url without forecastNextHour: https://weatherkit.apple.com/api/v1/weather/en-US/45.79/-108.50?dataSets=currentWeather,forecastHourly&timezone=America/Denver&country=US Says it is hazy and there is a small chance of snow of snow for the next few hours. Like 20-30 percent. This does not match any weather data I can find. I have even checked the forecastStart times and the current weather asOf time. They all match up and are accurate. Is there some unknown reason that without forecastNextHour the API becomes inaccurate? Thanks!
2
0
283
Feb ’25
How to get the real app language code + variation?
Hello, I have the app localised to many languages and its variants, like English from Australia or Dutch from Belgium. My phone language is en_UK and the region is configured to ES. I cannot find a way to get the regional language code (ex: en_au, nl_be), it always gets simplified to the language (ex: en, nl), or adds my device region (ex: en-ES, nl-ES). Here I attach some examples while I have the app on en_au Locale.preferredLanguages ▿ 3 elements - 0 : "en-ES" - 1 : "ca-ES" - 2 : "es-ES" Bundle.main.preferredLocalizations ▿ 1 element - 0 : "en" NSLocale.current.languageCode ▿ Optional&lt;String&gt; - some : "en" Locale.current ▿ en_001@rg=eszzzz (fixed en_001@rg=eszzzz) - identifier : "en_001@rg=eszzzz" - locale : "fixed en_001@rg=eszzzz" Locale.autoupdatingCurrent.languageCode ▿ Optional&lt;String&gt; - some : "en" Locale.current.languageCode ▿ Optional&lt;String&gt; - some : "en" Locale.preferredLanguages[0] "en-ES"
2
0
982
Jan ’25