How to Localize Push Notification Permission Dialog alert?

10,325

Solution 1

The only post I have found is Customizing the iOS permission dialog for push notifications Unfortunately, it is not possible to change the text / localisation of the message.

Solution 2

You won't see any change in system alert when you run the app in the simulator it will be in English try running it in a real device after changing device language. Now the system alert for push notification will be in device language. Hope it helps:)

Solution 3

You need to add the following lines into Info.plist:

<key>CFBundleDevelopmentRegion</key>
<string>en,ru</string>    

Value must contain at least two languages (it doesn't matter which ones).

Solution 4

You can change the messages for location permission, camera usage description, photo library usage description etc by adding a new file InfoPlist.strings and add strings for supported languages against keys NS*UsageDescription in the above file.

Share:
10,325

Related videos on Youtube

Sourabh Sharma
Author by

Sourabh Sharma

 iOS Developer....

Updated on September 14, 2022

Comments

  • Sourabh Sharma
    Sourabh Sharma over 1 year

    Push Notification Permission Alert Image

    I am trying from the last 3 hours but not able to find any method to localize it. I am using iOS 10.0 means UNUserNotificationCenter. I want to localize it in Spanish-Mexico(es-MX) Language.

    • Sourabh Sharma
      Sourabh Sharma over 7 years
      @Axel There is no key for PushNotification alert in InfoPlist to show custom message.
    • Muhammad Adnan
      Muhammad Adnan over 7 years
      I am sure that its immutable for developer. Try removing permission for your app in real device after changing language (other than english). Localization will be applied if its implemented by apple itself .Otherwise (NO) there is no way or no implementation provided for localizing permission text
  • Sourabh Sharma
    Sourabh Sharma over 7 years
    Thanks looking for more answer. If it will confirm I will accept your answer. I don't want to change just localize it.
  • Pavel Alexeev
    Pavel Alexeev over 5 years
    And what is NS*UsageDescription for push notifications? :)
  • Himani Sharma
    Himani Sharma almost 5 years
    If you know the answer please explain it using an example.
  • AnthonyMDev
    AnthonyMDev almost 5 years
    I don't believe there is one for push notifications. It will always display the default message for notifications, you can't change it. And it will localize based on device language.
  • Dhananjay M
    Dhananjay M almost 3 years
    What if we want the exact locale (region and language) specific messages like pt-pt or pt-br ?
  • Dhananjay M
    Dhananjay M almost 3 years
    I've tried with Xcode version 11.5 and it doesn't seem to work. Can you please confirm if it still works?