Before iOS 16.1 my app was woking good, if the user set the app language to other language than his device language, my app, widget + extensions all use this language...
After iOS 16.1 if user set the app language to other language than his device language, my app works with this language but the widget + extensions works with the device language, not my app language...
For Example:
@Environment(\.locale.languageCode) private var userLocal
before iOS 16.1 userLocal would be the app local, after iOS 16.1 it return the device local
Any idea why Apple did that? is this a bug?
How to set the widget language to match my app language now? even set .environment(\.locale, dose not work when use Strings(table: because it's still get the bundle that match device language.
Post
Replies
Boosts
Views
Activity
I have app that shows live activity and countdown till a date...
VStack {
Text("Countdown till You finish your homework")
Text(countdownTime, style: .timer)
}
After the time up, the live activity countup, the solution is to update the live activity via backgroundTask and this not always working, really apple sometimes fire the backgroundTask after hours.
Another solution is to set dismissalPolicy: .after(countdownTime), but once I did that the dynamic island not working and the activity status is ended after right calling...
await activity.end(using: state, dismissalPolicy: .after(countdownTime))
Can anyone help please, users feed back is why you we still see the old task on live activity. How come I can not update live activity? and how come if you set dismissalPolicy .after apple changes the activity status to ended and stop showing the dynamic island?
I am trying to use DateComponentsFormatter() with my AppIntent, but I can not find a way to localize the formatter string with the same language that LocalizedStringResource use...
Example (My App: Arabic, Device: English, Siri: English)
let formatter = DateComponentsFormatter()
formatter.unitsStyle = .full
formatter.maximumUnitCount = 2
formatter.allowedUnits = [.hour, .minute]
formatter.includesTimeRemainingPhrase = true
let relativeDate = formatter.string(from: .now, to: nextEvent.date) ?? ""
return .result(
value: value,
dialog: "intent_current_event\(relativeDate)"
)
The result is: Next event متبقي 4 ساعات و 5 دقائق
The relativeDate is in Arabic (App Language) and the "intent_current_event%@" localized in English (Siri Language)
Can anyone please help me to use the Formatter and get it to localized the same local as LocalizedStringResource.