On iOS Bundle.main.preferredLocalizations returns the list of languages the application bundle supports in user-preferred order with the first element being the language the application is running in.
Additionally Locale.preferredLanguages returns the list of languages in the order they are presented in Preferences.app > General > Language & Region > Preferred Languages with the first element being the user's "primary language" (i.e. the language the system is running in).
However this only seems to be true unless the user has chosen a per-app language which is different from the primary language in which case Locale.preferredLanguages.first is equal to Bundle.main.preferredLocalizations.first - regardless of the latter's position in the Preferred Languages list.
Furthermore this seems to change depending on the value of the "AppleLanguages" key in the User Defaults' global domain (see c.f. https://stackoverflow.com/a/42648166).
Is this behaviour documented anywhere?
Addendum: I know that according to https://forums.developer.apple.com/forums/thread/718512?answerId=733680022#733680022
AppleLanguages is an implementation detail, not something that’s considered API.
Locale.preferredLanguages is API, though.
General
RSS for tagDelve 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.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I have a timer displaying on widget which was working fine till iOS 17. However, it is not displayed in updated version. May someone provide the insight for this
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!
Does any ont encountered such crash? It only occured on iOS18 device.
Application Specific Information:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '_endUndoGroupRemovingIfEmpty:: _UITextUndoManager 0x30d3bca50 is in invalid state, endUndoGrouping called with no matching begin
UserInfo:(null)'
Pthread id: 2420148
Thread 0 Crashed:
0 CoreFoundation __exceptionPreprocess + 164
1 libobjc.A.dylib objc_exception_throw + 88
2 Foundation -[NSUndoManager endUndoGrouping] + 0
3 Foundation __NSFirePerformWithOrder + 296
4 CoreFoundation __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 36
5 CoreFoundation __CFRunLoopDoObservers + 552
6 CoreFoundation __CFRunLoopRun + 788
7 CoreFoundation CFRunLoopRunSpecific + 588
8 GraphicsServices GSEventRunModal + 164
9 UIKitCore -[UIApplication _run] + 816
10 UIKitCore UIApplicationMain + 340
11 application main (main.m:39)
12 (null) 0x00000001abfecde8 0x0 + 7180570088
The errors below pop up when I validate or distribute the mobile app; this error happens with the upgraded Xcode version. I have Xcode 16.2, and the minimum target deployment is 14.0. Please help me to resolve these errors. build was successful, I can launch my application from the simulator
Validation failed
Invalid Bundle. The bundle .app/Frameworks/hermes.framework does not support the minimum OS Version specified in the Info.plist. (ID: ee79350d-249e-4101-89fe-e41b2620f4d6)
Validation failed
Missing Info.plist value. A value for the key 'MinimumOSVersion' in bundle .app/Frameworks/hermes.framework is required. (ID: b0f58cd5-2c72-437b-98c9-1b2b4122c203)
Validation failed
Invalid MinimumOSVersion. Apps that only support 64-bit devices must specify a deployment target of 8.0 or later. MinimumOSVersion in ‘.app/Frameworks/hermes.framework' is ''. (ID: c2a6247f-21d6-438f-b52f-572425b7aa65)
Topic:
App & System Services
SubTopic:
General
A Mac Catalyst App Creates an AppKit Bundle Plugin in which @available does not work。
In AppKit Bundle Plugin, there is not watchOS and iOS version can not be higher than 28, but the log has been output.
if (@available(watchOS 18.0, *)) {
NSLog(@"bundle is available watchOS");
}
if (@available(iOS 28.0, *)) {
NSLog(@"bundle is available iOS");
}
demo link: https://pan.baidu.com/s/1s_5qmsL6Bh-df3A1PfD0OA
Extracted code: 5ndj
I'm developing a watchOS app for Watch Ultra 2 that implements water detection using CMSubmersionManager.
I would like to make it appear in the Auto-Launch settings menu, but my app is not appearing in the settings (Settings > General > Auto-Launch > When Submerged > Selected App)....
What additional steps should I take to make this work?
Environment
Device: Watch Ultra 2
watchOS: 11.2
Xcode: 16.0
Implementation
I have implemented the following as per documentation:
Added the Shallow Depth and Pressure capability and Entitlement.
Added the "Shallow Depth and Pressure" capability
Confirmed entitlement "com.apple.developer.submerged-shallow-depth-and-pressure" was automatically added
Note: I initially thought I should use "com.apple.developer.submerged-depth-and-pressure" (without "-shallow") since I'm targeting a maximum depth of 6 meters, but this resulted in compilation errors.
ref: https://developer.apple.com/forums/thread/740083
ref: https://developer.apple.com/forums/thread/735296
Added NSMotionUsageDescription and WKBackgroundModes
<key>NSMotionUsageDescription</key>
<string>Required for water detection</string>
<key>WKBackgroundModes</key>
<array>
<string>underwater-depth</string>
</array>
According to the documentation:
"It also adds your app to the list of apps that the system can autolaunch when the wearer submerges the watch."
What additional steps are needed to make the app appear in Auto-Launch settings? Has anyone successfully implemented this feature?
I am developing a macOS word-processing app that should be distributed via the Apple App Store. Some of the app's functions like generating HTML and PDF exports should be automatable via Shortcuts and via shell scripts.
To support the latter, I plan to include a command line tool inside the app that can be called from the Terminal or a shell script. The tool should be able to instruct the main app to then perform the desired commands.
A well-known AppStore app that uses this design is BBEdit which also contains multiple command line tools that offer functionality from the main app to users of the Terminal.
My technical questions now are:
Should the command line tool executable be sandboxed and if yes, how?
Even after many trials, I have not found a way to make a working sandboxed command line tool. If a sandboxed tool is started from the Terminal, it is immediately terminated with an exception in _libsecinit_appsandbox.cold.12. I am aware of the Apple developer documentation article Embedding A Helper Tool In A Sandboxed App, but it addresses a different architecture in which the helper tool is started from the main app and therefore is able to inherit its sandbox.
BBEdit is only sandboxing the main app, but not its embedded command line tools and is still allowed in the App Store. Is this the way to go for me as well or does BBEdit get some special treatment in the App Store?
How can the command line tool pass the permission to access files to the main app?
As my main app is sandboxed, it needs explicit permission from the user to be able to access files. Users of a command line tool give this permission by providing file paths as arguments. How can I pass these permissions along to the main app? BBEdit is able to do this even when the user has not given it full-disk access. I know that it is using Apple Events for the communication between the command line tool and the main app, but I am not sure how this allows to pass permissions. Can anyone shed light on how to implement a solution here?
Thanks!
Hello. I have a MacOS application to be distributed in a .pkg that is signed and notarized.
For the application to work, it needs some settings defined by us (non-secret strings that differ per client). My thought has been to use a .mobileconfig to send these settings using the com.apple.ManagedClient.preferences PayloadType. I can see these settings land correctly into the /Library/Managed Preferences directory (in the correct domain) when distributed using Apple Business Essentials as the MDM. However, I cannot read the settings using NSUserDefaults OR CFPreferences in objective-c (i've tried with my app unsigned and signed, but not signed ant notarized so far). I've seen some posts here and there about managed preferences being deprecated, so I'm not sure if this is my issue or if i'm simply reading the preferences incorrectly. I'll admit the conflict of some of these posts has me a bit confused about how the preferences subsystem works / whether it should be used at all. I'm on MacOS 15.3.
Two questions:
Does anything stand out as to why I wouldn't be able to read these properties?
Is there a better method I should be using to allow sending config via MDM to set application settings?
Thanks in advance!
Topic:
App & System Services
SubTopic:
General
I have my phone set to small icons on home screen, but it sill doesn't show the name of the app like when it is on large icons, please fix or just add names to large icons too so i stop running into this glitch.
Topic:
App & System Services
SubTopic:
General
So what's the point of being able to block unto 50 apps per ManagedSettingStore via store.application.blockedApplications (which works fine) until removing the blocked apps or clearing the store. Where the following occurs
if you have a social networking group with more than 9 apps only 9 apps will go back into the group and all the others will go onto the springboard all jumbled
if you end up with an empty group then tap into the group, it is removed then during the reset all apps are placed back on to the springboard
My app is available in TestFlight but has been rejected in App Review with the review feedback that the app clip "just shows a blank screen".
However, in the TestFlight app, the App Clip works as expected and brings up the clip. It also works correctly from Xcode testing.
Any ideas on what the problem could be? It is using the default App Clip link (appclip.apple.com)
Hi, I am trying to understand how this mechanism integrates with shortcuts (and i guess siri + apple intelligence in near future) and other apps.
Basic setup is an AppEntity that implements 'transferable' and is returning a DataRepresentation of 'text'.
got an AppIntent returns a one of the 'entitities' and I'm simply trying to pass the result to initially email or another app using shortcuts. even with canned 'hello world' string being marshalled into DataRepresentation(.text) I am not seeing anything in usual system targets like email, messages, notes. It opens the app ok, but no text is present. (note: if I use an incorrect DataRepresentation type with email it'll flat out fail saying 'not correct 'text' type)
What exactly do I need to do here and is there any example code I can look at?
thanks
I recently tried Apple TV after using android tv for a long time.
The main missing item is having a browser. I could not find one.
i tried building Firefox for TVOS, it failed with WebKit not available.
Is there a way to build WebKit and package it along with a browser package while building it?
I am trying to return a SceneView from a DeviceActivityReport. I have my DeviceActivityReportExtension correctly set up and I am able to display a view with text or other UI elements in it, but attempting to return a SceneView as part of the body just won't display. I have this example. When I display this SceneView in my main app, it displays correctly. When I put the same code inside the DeviceActivityReportExtension, the scene does not show up and an error failed to create a gl context appears repeatedly in the console. I'm pretty stumped and would appreciate any suggestions.
import SwiftUI
import SceneKit
struct TestScene: View {
var scene: SCNScene? {
SCNScene(named: "art.scnassets/environment.scn")
}
var cameraNode: SCNNode? {
let cameraNode = SCNNode()
cameraNode.camera = SCNCamera()
cameraNode.position = SCNVector3(x: 0, y: 0, z: 2)
return cameraNode
}
var body: some View {
SceneView(
scene: scene,
pointOfView: cameraNode,
options: [
.allowsCameraControl,
.autoenablesDefaultLighting,
.temporalAntialiasingEnabled
]
)
}
}
How to uninstall/delete Voice Control on macOS so that I can test my app for the case when the initial use of Voice Control causes it to be downloaded from Apple? Is there a folder in the macOS System or Library to delete to force a re-download of Voice Control?
My macOS app uses the older NSSpeechRecognizer to handle speech commands, but to use NSSpeechRecognizer required authorization via [SFSpeechRecognizer requestAuthorization...]. I do this and on a macOS system it can trigger a download of Voice Control, the macOS feature. An alert appears with:
"A 390 MB download is required to use speech recognition features in MyApp. You may need to quit and open MyApp again after download completes."
After transferring the App ownership to a different account, if you update the app on iOS, two identical apps will show up in Settings > Screen Time. Users can't control the blocking settings from before the update - the only fix is to restart the phone.
After the next execution of manageStore.shield.applications, users still can't manually disable the restrictions - their only option is to uninstall and reinstall the app. I believe this is related to how Screen Time API's authentication works - it's not just tied to the app's bundle ID, but also linked to the developer account's organization ID. Any suggestions for a clean solution that would allow smooth app updates after the transfer without running into these issues?
I have implemented ShowInAppSearchResultsIntent and AppShortcutsProvider. But on iOS 18.1+ getting and error in console :- Failed to generate TargetContentIdentifier for criteria.
In iOS 18.0 it's working fine.
The code I have implemented
@AssistantIntent(schema: .system.search)
struct SearchIntent: ShowInAppSearchResultsIntent {
// static let title: LocalizedStringResource = "Search in Cineverse for"
static let searchScopes: [StringSearchScope] = [.general]
@Parameter(requestValueDialog: IntentDialog("What would you like to search for?"))
var criteria: StringSearchCriteria
@MainActor
func perform() async throws -> some IntentResult {
let searchString = criteria.term
print("Searching for \(searchString)")
return .result()
}
}
class AppShortcuts: AppShortcutsProvider {
static var appShortcuts: [AppShortcut] {
AppShortcut(
intent: SearchIntent(),
phrases: [
"using \(.applicationName) search for",
"search on \(.applicationName) app"
],
shortTitle: "Search Movie",
systemImageName: "magnifyingglass"
)
}
}
There's a 128mb limit for donating items to core spotlight. As far as I understand, there's a warning that shows in the Xcode console when either approaching or hitting that limit. It would be great if there was an API to check the current status of available storage for QA purposes to see if we're either donating too much or can donate more. Thanks!
Hi,
My iphone 12 has been restarting unexpectedly, and often followed by wifi, bluetooth, and airdrop grayed out. I had to force restart/shutdown several times to turn it on again.
Found this analytics after crash. Please help if somebody know what this means:
ExcUserFault_CategoriesService-2024-12-23-064503.ips