Saturday, November 21, 2026
HomeiOS Developmentios - UNNotificationServiceExtension, Locale returns incorrect languageCode

ios – UNNotificationServiceExtension, Locale returns incorrect languageCode

[ad_1]

I’m making an attempt to localize push notifications, passing in information localization map with key as a language code.
For the modification notification utilizing UNNotificationServiceExtension, however caught on the problem: Locale.present.languageCode all the time returns en (calling from UNNotificationServiceExtension). My telephone and app locale is ready to uk.

I do know {that a} doable answer will be to retailer the language code within the UserDefaults, nevertheless it appears to me like a workaround. Has somebody discovered the problem to get the proper language code from the extension?

Here’s a debug information from service extension

[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments