Localization of CFBundleDisplayName doesn't work on device - localization

I tried to make the localization of the app name using CFBundleDisplayName.
I made the localized InfoPlist.strings according two different language.
In one strings file wrote:
CFBundleDisplayName="x11111"
and in another:
CFBundleDisplayName="y22222"
And in file info.plist, I added "Application requires iPhone environment" property, and set the boolean value to YES.
And in info.plist,the "Bundle display name" I used "x11111".
The localization worked ok on the simulator, but when tested on the device , it did not work.
On device, the name I used for 'Bundle display name' in info.plist can only be showed.
By the way, I use cocos2d for the project.
Anything I missed or did wrong?

If your localisation files were supplied to you, and you need to add them, be sure to add them correctly on per file basis. In Xcode, while you are adding files, pay attention how you add them. This is how they should look in Xcode Project Navigator.
I have added them by selecting all folders which didn't add them correctly to project.

Related

App Store Connect issue ITMS-90129 keeps blocking upload

App Store Connect keeps blocking App upload by issuing
ITMS-90129: The bundle uses a bundle name or display name that is already taken.
So far I tried:
Changing the Display Name, Bundle Identifier (even with generated Hashcodes to make sure that the names really are not taken already)
Created alternative Profiles, Identifier and App in App Store Connect (also using the same mentioned hashcode)
Tried these changes in the Xcode input fields (under 'General') and also directly modifiyng the Info.Plist
Re-Exporting the project from Unity to XCode with the new naming (to make sure Unity is not writing some bundle id somewhere which is not visible in XCode)
(Update) Tried to Clean the build folder based on
minchaej suggestion
Additional information: The XCode project is exported from Unity and we're using Firebase which is installed via Pods.
I'm grateful for any hint where to continue looking - because I'm really running out of ideas. Thanks a lot for taking the time.
Cheers
vik
The solution for this (probably very Unity-to-XCode specific) issue was localization related:
I had to remove all but the English localization entry in the Localization section.
I'm not sure why there were other loca resources before (since we didn't set them up) but I assume these included an alternative app name which was causing the ITMS-90129 to pop up.
My salvation for ITMS-90129 is the next:
Remove definitions for
CFBundleName
CFBundleDisplayName
CFBundleSpokenName
for base(en) localisation InfoPlist.strings.
Setup this variables with single value $(PRODUCT_NAME) directly in Info.plist
Variable $(PRODUCT_NAME) define via root project Build Settings/Packaging/Product Name
Setup variable LSHasLocalizedDisplayName in YES value in Info.plist
Setup Russian (or other) localisation for variables
CFBundleName
CFBundleDisplayName
CFBundleSpokenName
via InfoPlist.strings
As I am personally assume, setup this variables via base localisation is the key of problems in which I am faced with

How to change app display name in Xcode 8 to add a space

I am trying to put a space in my app name (standalone sticker pack) in Xcode 8. The solutions I've seen on here are to change the Product Name (in packaging) or to change the "Bundle Display Name".
I've changed the product name and that hasn't worked (I cleaned, rebuilt, reset content and settings in simulator and logged out of xcode, logged back in and rebuilt app).
I can't see "Bundle Display Name" anywhere. Should I add it and if so, how do I do that?
I've read the thread How to change the name of an iOS app? and done the suggestions, but it's still showing in simulator and testflight without the space. Have I missed something?
Steps:
1. Open project Info.
2. Add a property Bundle display name into Custom iOS Target Properties. (as "Key")
3. Enter the display name, that will be shown on iPhone/iPad screen under an app icon. (as "Value")
It's my solution that works properly. Also you should delete previously installed app and reinstall it.
Just go to Target -> General -> In Identity -> Display Name. By default, it has your app display name which is unhighlighted. Enter here your new app display name.
There are two ways to change app display name.
Solution 1:
Goto Targets -> General Tab -> Identity section
In this you’ll find Display Name field where you set app display name.
Solution 2:
Bundle Display Name property is not present by default in Info.plist. You need to explicitly add this property.
Below image shows how to add this property.
Note: If still this new name is not reflected in your app then delete app and install it again.
When creating a new project, Xcode uses the Product Name by default. You can just change that in your Build Settings, even setting separate names for your schemes.
After changed Bundle display name make a Clean of project.
Change the Bundle Display Name (CFBundleDisplayName) in your Info.plist file
Check if you have any localization (InfoPlist.strings) files, and change the corresponding CFBundleDisplayName values in those files to the localized values.
That's it.
Goto Info.plist and add "Bundle display name" and set your rename in value box make sure the Bundle display name type is a string run the project automatically it will be changed
For xcode 9.3, Goto Targets, Build Settings, under packaging change Produce Name. See below screen shot
After this if it not changed, clean product to reopen X code.

iOS PRODUCT_NAME not the display and wrapper name

For my iOS app I am trying to have multiple build configurations so I can create development and production builds that target different servers, configurations etc.
In Xcode I have created another build configuration and scheme to target this configuration. So I have the separate configuration/schemes as:
Dev version
PRODUCT_NAME=MyApp-dev
BUNDLE_IDENTIFIER=com.organisation.myapp-dev
Original Version
PRODUCT_NAME=MyApp
BUNDLE_IDENTIFIER=com.organisation.myapp
Both configurations can be built with the different schemes. Both will run on the same device because of the different identifier, but the dev version still shows MyApp on the home screen. When looking in the build products, it produces a MyApp.app bundle with a target inside it of MyApp-dev.
Is there another setting to change the wrapper name from MyApp.app to MyApp-dev.app? And any other setting that may be preventing PRODUCT_NAME setting to be used in the app display name?
edit: In the info.plist file, both the CFBundleName and CFBundleDisplayName are set to $(PRODUCT_NAME)
n.b. I have done this before with another app and all is working fine there, hence the query if another developer has changed a more targeted setting that overrides this change.
There was a InfoPlist.strings file in the project that was overriding CFBundleDisplayName. I removed this definition from this file and all worked as desired.
The project is not localised and so I never considered this override! Hopefully if someone else comes across this, remember settings in Info.plist can be overriden with localised strings in this file.

Can't localize info.plist strings

I need to localize two keys of info.plist: NSLocationUsageDescription and NSCameraUsageDescription. So I tried to create a new file called InfoPlist.strings and then I localized it, but app always shows strings stored in info.plist file. What's wrong?
Official documentation from Information Property List Key Reference
Localized values are not stored in the Info.plist file itself.
Instead, you store the values for a particular localization in a
strings file with the name InfoPlist.strings. You place this file in
the same language-specific project directory that you use to store
other resources for the same localization. The contents of the
InfoPlist.strings file are the individual keys you want localized and
the appropriately translated value. The routines that look up key
values in the Info.plist file take the user’s language preferences
into account and return the localized version of the key (from the
appropriate InfoPlist.strings file) when one exists. If a localized
version of a key does not exist, the routines return the value stored
in the Info.plist file.
My InfoPlist.strings file:
NSCameraUsageDescription = "hello";
NSLocationUsageDescription = "hello hello";
Please check in the generated application package, whether the file is really stored in there and it is put to the correct location. Usually this is the missing step.
Just go into the project settings, open "Build Phases" and see whether
the file can be found in "Copy Bundle Resources"
Your plist file can have multiple versions for each language your application supports.
In Utilities \ File Inspector (on the right) click on "Localize":
And then choose the languages you want to have their own versions:
After that you will be able to enter each plist file and edit it as you want.
InfoPlist.strings doesn't consider your scheme's Application Region, but the region set in the device! On your device: Settings-> General -> Language & Region, check if iPhone Language is the one that you like.
Since iOS 10, you are required to add the privacy keys to your Info.plist.
<key>NSPhotoLibraryUsageDescription</key>
<string>Please allow access to the photo library.</string>
Of course, you still need those keys to be localized (and you can't localize the application's Info.plist). So you ALSO add those privacy keys to the InfoPlist.strings, which in turn are localized.
"NSPhotoLibraryUsageDescription" = "Please allow access to the photo library.";
As a matter of fact, my problem was that I had misspelled the NSLocationWhenInUseUsageDescription constant so of course it was not taken into account.
Sometimes you have to make a Clean first, Click Menu -> Product -> Clean.
In my case there was a conflict with other InfoPlist.strings file from another build target.
After double checking everything said in this thread, my last action was deleting the app and its' data then re-run/re-install it to Simulator and my localization worked for Info.plist
One more thing, I made the simulator main language the testing language I want (Arabic), and to change that in the simulator Settings>General>Language
The file needs to be inside of a directory indicating the language, for example en.lproj
It depends on your iPhone or iPad ‘s language, it will automatically pick the description from the "InfoPlist.strings" file.

How do I add extra plists in xCode in the Settings.bundle for use with the InAppSettingsKit iPhone library?

This is probably a really silly question. but I'm struggling with it :(
I am trying to add a Root.inApp.plist file to my project so that i can have inapp specific settings for my iPhone app.
I have integrated InAppSettingsKit fine, its currently only working with the one Root.plist file tho.
I would like to add a Root.inApp.plist file to my project so that i can have inapp specific settings.
When i try to add another property file in Xcode it doesn't seem to sit under the Settings.bundle, how do i get it to show up in my Settings.bundle structure like this?:
I have tried to import the inappsettingskit bundle file also without luck :( my project doesn't recognise the Settings.bundle for some reason
Please help
No way to do that in Xcode, I believe. Just reveal the Settings bundle in Finder and add the new file to it. It'll automatically show up in Xcode.
Duplicate your existing plist file, then right click any property and select iPhone Settings plist under Property List Type.

Resources