Change app name programmatically - ios

I want to change the app name based on the app language selected by the user & not the system language.
Is there any solution?
Even if it is doable using private API, I would like to know.
I know there is only one way using plist but as it is read only, I won't be able to update the plist file.
VImp Note, I want to change as per app language and not as per system language.

You can localize your Info.plist file.
Just select Info.plist file,and in File Inspector,click Localize... button in the Localization section.

You can't change your apps name programmatically.Because the name is stored in the info.pist which resides in you apps main bundle is read only you can not change it. You only option is to use the localized functionality provided by iOS based on the system language.

Related

Can we add a custom URL into the info.plist in real time through the app ?

I want to access other apps through custom URLs. And for that I need to add the custom URLs to the info.plist in real time through my app. So how can I add the new URLs programatically ?
And are there any restrictions in terms of iOS versions supporting this updation ?
The app's bundle is read-only when it's installed on a device.
You can copy the plist file to a writable area, like your document directory, and modify that but I don't know what good it would do you.
If you're trying to save these URLs for later use, NSUserDefaults is a better idea.

Can we localize the iOS app name dynamically

I am developing an iOS framework (say xyz.framework) , in that I am trying to build a feature to localize the bundle display name (CFBundleDisplayName) where I should localize the app name (name of the app which consumes my xyz.framework)
As per my understanding we have to mention name of the app in infoPlist.Strings file and we should localize,
My question is can we pick the app name dynamically with out hardcoding it ? if yes how can I do it ?
Please help me out!
Take the first answer to this question:
How to localise a string inside the iOS info.plist file?
Since the name of the app needs to be localised before the app is running, it is obviously not possible to change it dynamically. I might download your app and never, ever run it.
No, Info.plist values must be hardcoded and cannot be changed at runtime (this actually makes sense if you think about it).
The same applies to the localized version.

XCode 5 localizing app name on the fly

"Application has localized display name" = YES in Info.plist
Localized CFBundleDisplayName & CFBundleName in InfoPlist.strings
When I change the language of the whole device, it works. It changes the name of my app.
When I install it, the name is in the language of the device.
I manually change the app language from inside the app with NSUserDefaults language setting. Everything inside the app is perfectly localized whenever I change the language from inside the app. (Needs a restart of app)
But the app name does not change this way, the only way for it to change is, changing the device language.
Am I missing something? Is there a way to change the app name when the language is changed?
Unfortunately, I don't think you can.
iOS has no way to tell what language preference is set inside each application (well, it could, but it's not done that way).
Instead, it uses the system-wide setting to find and display the appropriate CFBundleDisplayName for every application.
Developing a custom language preference inside an app is also not the recommended way. Apple expects users to set their language of choice in the device's Preferences, not from inside individual apps (see here: https://developer.apple.com/library/mac/documentation/MacOSX/Conceptual/BPInternational/Articles/InternatSupport.html#//apple_ref/doc/uid/20000278-SW1). As an example, there's no way to change Facebook's language from inside the app, but as soon as you change the device's global language setting, the Facebook app reflects the change.

Can a renaming on an iOS application be done in one locale only?

I have an iOS app that's used internationally.
This app supports push-notifications.
The app is used internationally.
however, recent legal problems force me to change its name in the U.S.
I don't want to change its name globally, just the U.S.
Whta's the minimal set of action I can take to get there as fast as I can?
Can I change the application name and some of its UI for a certain locale only? (ENG-US)
do must I deploy a new app altogether alongside the old one?
Note I must keep the "british" locale with the old UI, but must rename the application name and change some of its UI only for the U.S.
Is that possible? or will I be forced to deploy a new app just for the U.S.?
Thank you
Yes the CFBundleDisplayName and CFBundleName are localizable. You need to add your localizations in an InfoPlist.strings file and add specific localizations there.

How do I add a plist file to Setting.bundle programmatically?

I am trying to add a plist file to the Settings.bundle in my iOS project programmatically. How would I go about doing this?
I used Apple's API to find where to put a created plist file to see if the Settings.bundle would check there for a plist file but it doesn't recognize it and the child pane goes to a blank screen instead of showing the settings.
The reason for this is based on the user logging in to my app I want to have different settings show in the Settings App
You don't. Settings.bundle is supposed to be created at compile time, and is fixed (as well as signed as part of the application build process.)
See the Settings.bundle documentation which explicitly states (emphasis added):
A Settings bundle has the name Settings.bundle and resides in the top-level directory of your app’s bundle.
The emphasized part is what tells me you can't put the bundle anywhere else. This answer confirms what I just said.
Conditionally displayed settings are also not possible.
I don't think you can. The OS handles that independently, and you aren't allowed to run any code to affect it.
Instead, you are going to want to offer a settings screen within your app that allows full control over the presentation and function.

Resources