info.plist

Can't localize info.plist strings

浪子不回头ぞ 提交于 2020-01-03 07:08:06
问题 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.

Qt Target with special characters

孤者浪人 提交于 2020-01-03 05:10:22
问题 I have a QT application and right know I need to change the app name to something like "A&B". I have tried to change the TARGET in my .pro file, but I am having problems with the " & " character in macOS . I have also tried to use qmake functions like val_escape , system_quote , shell_quote but nothing worked for me. As a last resource, I have tried to change the CFBundleName in my .plist file, which worked for app menus and etc, but not for the app name (still having problems with &, as make

iOS app running in the background

别说谁变了你拦得住时间么 提交于 2020-01-03 04:59:05
问题 I am trying to be able to set how long my app will remain in the background. I want to be able to have the control over how long my app can stay active in the background until it is closed. Is there something I can add to the Info.plist that can set that, with the bool that is the switch to have it run in the background or not? I have read and found that Apple doesn't let apps remain in the background for longer than 10min, but I have done some testing and found other live apps that are

NSLocationWhenInUseUsageDescription localization using .strings file not working

别来无恙 提交于 2019-12-30 17:26:28
问题 I've completed translating my app to Turkish using Base Localization. However, I also need to translate NSLocationWhenInUseUsageDescription key in my Info.plist file. I did exactly what I did for everything else: Went to File inspector and checked Turkish: Then I went to the new strings resource and completed my translation by adding this key to the localization file: "NSLocationWhenInUseUsageDescription" = "[my Turkish description of location permissions]"; Saved, compiled, even deleted app

Writing to build directory info.plist using Xcode's “New Build System”

☆樱花仙子☆ 提交于 2019-12-30 10:54:04
问题 Before using the "New Build System", we had a build phase script like this: infoplist="$BUILT_PRODUCTS_DIR/$INFOPLIST_PATH" builddate=`date` /usr/libexec/PlistBuddy -c "Set :BuildDateString $builddate" "${infoplist}" The point of this way to write to the plist at runtime without dirtying the project and having to stash the changes. This still works well and perfectly when using the "Legacy Build System". On the "New Build System", this script does not work. The directory variables and writing

Writing to build directory info.plist using Xcode's “New Build System”

浪尽此生 提交于 2019-12-30 10:53:28
问题 Before using the "New Build System", we had a build phase script like this: infoplist="$BUILT_PRODUCTS_DIR/$INFOPLIST_PATH" builddate=`date` /usr/libexec/PlistBuddy -c "Set :BuildDateString $builddate" "${infoplist}" The point of this way to write to the plist at runtime without dirtying the project and having to stash the changes. This still works well and perfectly when using the "Legacy Build System". On the "New Build System", this script does not work. The directory variables and writing

Writing to build directory info.plist using Xcode's “New Build System”

為{幸葍}努か 提交于 2019-12-30 10:53:28
问题 Before using the "New Build System", we had a build phase script like this: infoplist="$BUILT_PRODUCTS_DIR/$INFOPLIST_PATH" builddate=`date` /usr/libexec/PlistBuddy -c "Set :BuildDateString $builddate" "${infoplist}" The point of this way to write to the plist at runtime without dirtying the project and having to stash the changes. This still works well and perfectly when using the "Legacy Build System". On the "New Build System", this script does not work. The directory variables and writing

List of Fonts Provided by Application (iOS)

拈花ヽ惹草 提交于 2019-12-30 08:30:46
问题 does anyone know how to get a list of custom fonts from the 'Fonts provided by application' key in the info.plist file in Xcode? Thanks 回答1: The following code reads the list of custom font files from the Info.plist, and extracts the full font name from the font file. (Parts of the code is copied from https://stackoverflow.com/a/17519740/1187415 with small modifications and ARC adjustments). Objective-C NSDictionary* infoDict = [[NSBundle mainBundle] infoDictionary]; NSArray* fontFiles =

How to read Info.Plist at run-time in react-native iOS app?

◇◆丶佛笑我妖孽 提交于 2019-12-30 06:37:09
问题 At run time, is there a way to read CFBundleVersion from the Info.Plist ? I want to display the version info in the app's "About Box". Thanks in advance, -Ed 回答1: I suggest you use this very well done library You'll have all the info you need I think. EDIT You can also use some Obj-C in your AppDelegate.m file. Just add these lines : NSString *version = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]; NSDictionary *props = @{@"version" : version}; and

How to programmatically register a custom URL scheme?

半世苍凉 提交于 2019-12-29 06:49:11
问题 Is it possible to add/remove custom URL schemes for my application while it's running? Right now the CFBundleURLSchemes property is set in Info.plist. 回答1: According to this discussion on Cocoa Dev the answer is no, custom URL schemes can't be registered programmatically. You must specify them in Info.plist . (but using LSRegisterURL , you can ask Launch Services to reload your application's Info.plist if you programmatically change it. But that's ugly.). 回答2: Launch Services will do that.