Programmatically localize info.plist on iOS

I am having a problem with a specific iOS translation issue. The application in which I am currently working receives all the texts that it displays from the web service. I was able to implement this everywhere with one single exception:

I have not yet found a way to programmatically change texts from info.plist, which will be used from the system in code that I can not control. The one I need to deal with is "Confidentiality - a description of the use of the camera." So far, any documentation that I have found tells me to add localized text versions for info.plist, but in this particular case this will not help me, because different clients can specify different texts for the same language, and sometimes I even I don’t know what language the texts are in, so I can not rely solely on the static data in the application to select the desired text version.

Is there a way to install such text programmatically or if it is not possible to catch a warning displaying it and replace it with one of my own?

+4
source share
2 answers

No, this is not possible, we cannot change the runtime of Info.plist. But if I were there instead of you, I will make one decision. Display a custom warning with the specified text from the api. Which asks that "we will use your camera." If the user says "OK", then displays a system warning for permission with a static localized string. It needs a 2-hour interaction, but it can help the user completely.

+1
source

info.plist. , info.plist "" "". .

, , . , , ( swizzle String table, )

0

Source: https://habr.com/ru/post/1694855/


All Articles