iOS 13 notification service extension seems to ignore app specific preferred language. Is it a bug?

Viewed 365

I use notification service extension to modify content of user notifications, especially localizing it's content as well as sound file.

This works as expected, extension simply inherits system language. Since iOS 13 it is possible to set app specific preferred language in app's settings. In this case however service extension ignores preferred language and still uses the system language.

Is this a bug? Or am I doing something wrong? I can overcome this with a workaround but I guess there should a legal way to achieve this.

1 Answers

My current workaround to share app-specific preferred language in notification service extension is:

  1. enable app groups
  2. in host app create shared user defaults using the app group identifier
  3. when app is launched save preferred language into shared defaults
  4. when notification extension is launched load preferred language from shared defaults
  5. read localized strings from a table corresponding to the language
Related