Issue with Locale Updates on Network Extension in iOS

I have implemented a NEPacketTunnelProvider in my app, which sends local notifications to the user when the server is down. While the notifications are displayed successfully, I encountered an issue when changing the system locale settings on iOS. Specifically, the notifications still display in the previous locale, even after the system locale has been changed. The locale of the notifications only updates if I restart the device.

I am currently using Locale.current for setting the locale in my notifications. I have also tried using Locale.preferredLanguages, but it seems that the locale does not properly update in real-time.

Answered by DTS Engineer in 790487022

OK, thanks for confirming that.

When you change the language on the iOS, the system does sort of a faux restart, where it terminates all apps. When the user relaunches an app, it picks up the new language setting and everything works.

It sounds like this faux restart isn’t terminating your NE appex, and thus it never picks up the new setting. IMO this is a bug, and I recommend that you file it as such.

Please post your bug number, just for the record.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

What do you mean by “locale settings” here? The language (Settings > General > Language & Region > Preferred Languages)? Or the region (… > Region)?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

I mean The Preferred Languages (Settings > General > Language & Region > Preferred Languages). For example, if I have:

  1. English
  2. Spanish

but then I change it to:

  1. Spanish
  2. English

The notification is still being displayed in English.

Accepted Answer

OK, thanks for confirming that.

When you change the language on the iOS, the system does sort of a faux restart, where it terminates all apps. When the user relaunches an app, it picks up the new language setting and everything works.

It sounds like this faux restart isn’t terminating your NE appex, and thus it never picks up the new setting. IMO this is a bug, and I recommend that you file it as such.

Please post your bug number, just for the record.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

I've just opened the following issue: FB13881792

Issue with Locale Updates on Network Extension in iOS
 
 
Q