Hi I would like to implement check option like html radio button behavior where only one option is selectable at a time. I would like to implement this in ios app settings (Settings.bundle). I couldn't find a single example anywhere but I do see other apps have this implemented. Please see screenshot below.
Ok PSMultiValueSpecifier was the word that helped me. Thank you Rudedog.
To further add so it can help others. You can use below plist code to achieve. I got it from https://github.com/allanalves/Environment-Manager-iOS/blob/master/Settings.bundle/Root.plist
<dict>
<key>Type</key>
<string>PSGroupSpecifier</string>
<key>Title</key>
<string>Server</string>
<key>FooterText</key>
<string>Don't forget to choose the "Custom URL" option if you want to specify an URL above.</string>
</dict>
<dict>
<key>Type</key>
<string>PSMultiValueSpecifier</string>
<key>Title</key>
<string>Environment</string>
<key>Key</key>
<string>environment</string>
<key>DefaultValue</key>
<string>production</string>
<key>Values</key>
<array>
<string>production</string>
<string>homologation</string>
<string>development</string>
<string>custom</string>
</array>
<key>Titles</key>
<array>
<string>Production</string>
<string>Homologation</string>
<string>Development</string>
<string>Custom URL</string>
</array>
</dict>
Related
I've been trying to change my app icon using CFBundleAlternateIcons, but nothing happens.
I'm actually using a plugin for the Flutter SDK - flutter_dynamic_icon, when I change the icon using the plugin, it show a popup says 'You have changed the icon for MyApp' but nothing changes.
My question seems to be a repeat of this question: [https://stackoverflow.com/questions/64426880/xcode-ios-cfbundlealternateicons-not-changing] which already has an answer but it doesn't work for me.
I'm also trying to do the same as this article on medium: [https://medium.com/flutter-community/programatically-change-ios-app-icon-in-flutter-c9e84bc541a2] and the result is the same as when I used flutter_dynamic_icon.
Here is my info.plist:
<key>CFBundleIcons</key>
<dict>
<key>CFBundleAlternateIcons</key>
<dict>
<key>teamfortress</key>
<dict>
<key>UIPrerenderedIcon</key>
<false/>
<key>CFBundleIconFiles</key>
<array>
<string>teamfortress</string>
</array>
</dict>
<key>chills</key>
<dict>
<key>UIPrerenderedIcon</key>
<false/>
<key>CFBundleIconFiles</key>
<array>
<string>chills</string>
</array>
</dict>
<key>photos</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>photos</string>
</array>
</dict>
<key>UIPrerenderedIcon</key>
<false/>
</dict>
</dict>
I think something is wrong with my info.plist.
Has anyone experienced this problem?. Please help me, thanks a lot.
I've figured out the answer recently, for some reasons, my app can only be able to change app icon dynamically when I add icon images directly in Runner folder in Xcode and run flutter project from it.
Hope it's helpful for you if you're encountering with above problem.
I get this error when submitting my app to the App Store recently.
ITMS-90892: Missing recommended icon - The bundle does not contain an alternate app icon for iPad of exactly '167x167' pixels, in .png format for iOS versions supporting iPad Pro. To support older operating systems, the icon may be required in the bundle outside of an asset catalog. Make sure the Info.plist file includes appropriate entries referencing the file. See
It's related to the alternate icons in the app structure and the names I think but has nothing to do with the assets catalog. In my app a user can choose and icon for the Home Screen.
I have 4 icons to choose and 4 sizes for each icon named e.g. - AA_appIcon#2x, AA_appIcon#2x~iPad, AA_appIcon#3x, AA_appIcon83.5#2x~iPad and it used to work fine, but now I get this error for the one name AA_appIcon83.5#2x~iPad.
It is in the correct size 167x167, so not sure what the problem is.
It just happen in the last few days, didn't happen on my previous submission a month ago.
The naming format must have recently changed or something.
Is anyone able to spot the error?
This is the info.plist
<dict>
<key>CFBundleAlternateIcons</key>
<dict>
<key>AA</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>AA_appIcon</string>
</array>
<key>UIPrerenderedIcon</key>
<string>No</string>
</dict>
<key>Cake</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>Cake_appIcon</string>
</array>
<key>UIPrerenderedIcon</key>
<string>No</string>
</dict>
<key>NA</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>NA_appIcon</string>
</array>
<key>UIPrerenderedIcon</key>
<string>No</string>
</dict>
<key>OA</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>OA_appIcon</string>
</array>
<key>UIPrerenderedIcon</key>
<string>No</string>
</dict>
</dict>
<key>CFBundlePrimaryIcon</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>Cake_appIcon</string>
</array>
<key>UIPrerenderedIcon</key>
<false/>
</dict>
</dict>
<dict>
<key>CFBundleAlternateIcons</key>
<dict>
<key>AA</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>AA_appIcon</string>
</array>
<key>UIPrerenderedIcon</key>
<string>No</string>
</dict>
<key>Cake</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>Cake_appIcon</string>
</array>
<key>UIPrerenderedIcon</key>
<string>No</string>
</dict>
<key>NA</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>NA_appIcon</string>
</array>
<key>UIPrerenderedIcon</key>
<string>No</string>
</dict>
<key>OA</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>OA_appIcon</string>
</array>
<key>UIPrerenderedIcon</key>
<string>No</string>
</dict>
</dict>
<key>CFBundlePrimaryIcon</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>Cake_appIcon</string>
</array>
<key>UIPrerenderedIcon</key>
<false/>
</dict>
</dict>
Here's what you need as of late 2021 if you're getting error ITMS-90890 or ITMS-90892, etc.
File Name
size
IconName#2x.png
120x120
IconName#3x.png
180x180
IconName#2x~ipad.png
152x152
IconName#3x~ipad.png
167x167
*Note the lack of capitalization on ~ipad!
Based on #Warpling answer, here is everything you need to setup alternate icon correctly:
1. Create the icon files
First, you'll have to create a folder named AlternateAppIcons inside your main project (where the info.plist file is located).
Now, inside the folder you've created, add the files with the names and sizes that described in the table:
File Name
Size
IconName#2x.png
120x120
IconName#3x.png
180x180
IconName#2x~ipad.png
152x152
IconName#3x~ipad.png
167x167
I'd recommend you to use Icon Set Creator to generate all sizes, then
Make sure that the file names are exactly the same (case sensitive) after the #.
When you change IconName, make sure to change it as well in the info.plist.
2. Configure info.plist
You'll have to add this to the info.plist:
<key>CFBundleIcons</key>
<dict>
<key>CFBundleAlternateIcons</key>
<dict>
<key>IconName</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>IconName</string>
</array>
</dict>
</dict>
<key>CFBundlePrimaryIcon</key>
<dict>
<key>CFBundleIconFiles</key>
<array/>
<key>UIPrerenderedIcon</key>
<false/>
</dict>
</dict>
<key>CFBundleIcons~ipad</key>
<dict>
<key>CFBundleAlternateIcons</key>
<dict>
<key>IconName</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>IconName</string>
</array>
</dict>
</dict>
<key>CFBundlePrimaryIcon</key>
<dict>
<key>CFBundleIconFiles</key>
<array/>
<key>UIPrerenderedIcon</key>
<false/>
</dict>
</dict>
3. Change the icon programmatically
All you have to do is to validate that the app supports alternate icons and change it:
guard UIApplication.shared.supportsAlternateIcons else { return }
UIApplication.shared.setAlternateIconName("IconName")
*You may want to create some enum helper like this.
Nevermind
I just renamed the icon from AA_appIcon83.5#2x~iPad.png to AA_appIcon#3x~ipad.png and the error went away and the icon picker still works from within the app.
I am currently working on a "share" feature in my app. I have custom objects that I am parsing to JSON and I currently have a working implementation to export them as a "___.blueprint" file. So I have created my own custom extension and I have set up everything when it comes to the UTIs and all.
Exporting works well and I have no issue when sending it via email. I can easy tap the mail attachment and select my own app. Importing and handling the data inside the app works as well.
However, When I send the file via AirDrop or messages, iOS doesn't know what to do with it. It doesn't suggest my app as an option to open it with. My info.plist looks like this:
<array>
<dict>
<key>CFBundleTypeName</key>
<string>Blueprint Data</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>LSItemContentTypes</key>
<array>
<string>com.ferdinandgoeldner.breadme.blueprint</string>
</array>
</dict>
</array>
...
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
</array>
<key>UTTypeDescription</key>
<string>Blueprint Data</string>
<key>UTTypeIconFiles</key>
<array/>
<key>UTTypeIdentifier</key>
<string>com.ferdinandgoeldner.breadme.blueprint</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>blueprint</string>
</array>
<key>public.mime-type</key>
<array>
<string>blueprint</string>
</array>
</dict>
</dict>
</array>
<key>UTImportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
</array>
<key>UTTypeDescription</key>
<string>Blueprint Data</string>
<key>UTTypeIconFiles</key>
<array/>
<key>UTTypeIdentifier</key>
<string>com.ferdinandgoeldner.breadme.blueprint</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>blueprint</string>
</array>
<key>public.mime-type</key>
<array>
<string>blueprint</string>
</array>
</dict>
</dict>
</array>
I am really lost as to why iOS does allow me to direct the file to my app which can clearly handle the format, but does not think of letting me "open" the file in my application. What am I missing?
I got it to work!
I am not entirely sure what solved it, though.
Here are the steps I performed that made it work.
I chose a more specific UTI type.
Deinstalled all versions of my app.
I created a UTI with a shorter extension (.bmb)
I am pretty sure that .blueprint is a datatype that is not super unique, so I chose an extension that's more unique.
I also carefully ready this page of the Apple Developer Documentation. That also seemed to help me get a better grasp of how to make this stuff happen and what was going on under the hood.
I am still partially unsure of what solved the issue but tweaking several parameters made it happen.
To whoever finds this thread: Good luck. It is possible even though it seems like nothing helps. Keep experimenting and try the steps I described above. ;)
Terminating app due to uncaught exception 'GADInvalidInitializationException', reason: 'The Google Mobile Ads SDK was initialized without an application ID. Google AdMob publishers, follow instructions here: https://googlemobileadssdk.page.link/admob-ios-update-plist to set GADApplicationIdentifier with a valid App ID. Google Ad Manager publishers, follow instructions here: https://googlemobileadssdk.page.link/ad-manager-ios-update-plist
you can work around it by adding the key-value pair in the documentation linked above to your Info.plist file.
Open your info.plist file and put that line:
key = GADIsAdManagerApp
value = true
An update is made, see the official link: https://firebase.google.com/docs/admob/ios/quick-start#add-app-id-to-info-plist
You should add the following pair (key, value) to your Info.plist file:
<key>GADApplicationIdentifier</key>
<string>ca-app-pub-3940256099942544~1458002511</string><!-- add your AdMob app ID-->
I hope this will help.
Please make sure that you add your actual admob app id in Info.plist and not an ad id. If you use an ad id as app id in the Info.plist, the SDK will crash.
In my case, I misspelled -ObjC. Check the capital letters and the hyphen, as well as the position where you write it. You should write it in: Other Linker Flags in your project's build settings
As google mentioned in their guide under "Manual download" tab :
You must do the following :
Go to your project XCode >Targets > Build settings > Other linker flags
and add "-ObjC" as shown in the guide :
Comes to think of it every one is trying to use the Admob using CocoaPods, tend to jump the manual download tab, but the issue is that the section related to "Other Linked Flags" is inside this last, so it must be separated in order to make it visible as a "To Do" step to accomplish the guide.
Enjoy;
This way you can use. It worked for me for Google Mobile Ads SDK 8.1.0:
<key>GADApplicationIdentifier</key>
<string>ca-app-pub-xxxxYOUR_IDxxxxx</string>
<key>NSUserTrackingUsageDescription</key>
<string>This identifier will be used to deliver personalized ads to you.</string>
<key>SKAdNetworkItems</key>
<array>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>cstr6suwn9.skadnetwork</string>
</dict>
</array>
<key>GADIsAdManagerApp</key>
<true/>
All Ad Networks added: (https://developers.google.com/admob/ios/ios14)
<key>GADApplicationIdentifier</key>
<string>ca-app-pub-xxxxYOUR_IDxxxxx</string>
<key>NSUserTrackingUsageDescription</key>
<string>This identifier will be used to deliver personalized ads to you.</string>
<key>SKAdNetworkItems</key>
<array>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>cstr6suwn9.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>4fzdc2evr5.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>2fnua5tdw4.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>ydx93a7ass.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>5a6flpkh64.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>p78axxw29g.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>v72qych5uu.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>c6k4g5qg8m.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>s39g8k73mm.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>3qy4746246.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>3sh42y64q3.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>f38h382jlk.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>hs6bdukanm.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>prcb7njmu6.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>wzmmz9fp6w.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>yclnxrl5pm.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>4468km3ulz.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>t38b2kh725.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>7ug5zh24hu.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>9rd848q2bz.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>n6fk4nfna4.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>kbd757ywx3.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>9t245vhmpl.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>2u9pt9hc89.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>8s468mfl3y.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>av6w8kgt66.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>klf5c3l5u5.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>ppxm28t8ap.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>424m5254lk.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>uw77j35x4d.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>e5fvkxwrpn.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>zq492l623r.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>3qcr597p9d.skadnetwork</string>
</dict>
</array>
<key>GADIsAdManagerApp</key>
<true/>
Do not forget these steps on iOS. That solved the problem for me.
"This step is required as of Google Mobile Ads SDK version 7.42.0."
So, for my case, I had 2 targets, 1 pro app and another free app. And I added the GADthingamabob key in the Info.plist file found under left panel. Turns out this one only updates the Pro app info plist. What you need to do is to select the Lite target, and then goto Info panel and add the GADthingamabob there then it no longer crashes. I don't even need to add GADIsAdManagerApp thingy.
on info.plist always use your actual project
id.(ca-app-pub-xxxxYOUR_IDxxxxx)
and if you're debugging then at the time of instantiation of
GADBannerView, use the dummy
adUnitID("ca-app-pub-3940256099942544/2934735716")
make sure you replace this dummy adUnitID by your actual project id.
for more detailed information, please visit:- google admob documentation
To do it, simply
Go to Info.plist in your runner folder and click on the " + " button next to the properties list. Add GADApplicationIdentifier
property of type string and set its value to the AdMob app ID but not unit ID.
Again click on " + " next to the properties list. Add SKAdNetworkItems and change its type to an array.
Inside SKAdNetworkItems add a new property with the name SKAdNetworkIdentifier with the value cstr6suwn9.skadnetwork
It should work fine.
Delete 'GADApplicationIdentifier' and it's VALUE from Info.plist
Add 'GADApplicationIdentifier' and it's VALUE manually again
Build an App
Add key, value in info-plist
<key>GADApplicationIdentifier</key>
<string>ca-app-pub-xxxxxxxxxxxx/xxxxxx</string>
<key>GADIsAdManagerApp</key>
<true/>
I am trying to create a custom template in Xcode. In my TemplateInfo.plist, for key Options, I have the code pasted below. This template will be for a class that more often than not (but not always) will use delegation when events occur.
The issue I am having is with the value at the very bottom, RequiredOptions. I want the text box to be enabled only if the withProtocol checkbox is checked. However, I can't figure out what value and type of value to use. I have tried the following:
<true/> (as below) - The text box is always enabled.
<string>YES</string> - The text box is always disabled.
<integer>1</integer> - The text box is always enabled.
Does anyone have any ideas for what else I could try? Better yet, does anyone know of a decent reference for Xcode templates?
I have already read through Apple's plist manual pages and the article at this website.
<array>
<dict>
<key>Description</key>
<string>The name of the class to create</string>
<key>Identifier</key>
<string>productName</string>
<key>Name</key>
<string>Class</string>
<key>NotPersisted</key>
<true/>
<key>Required</key>
<true/>
<key>Type</key>
<string>text</string>
</dict>
<dict>
<key>Default</key>
<string>false</string>
<key>Identifier</key>
<string>withXIB</string>
<key>Name</key>
<string>With XIB for user interface</string>
<key>Type</key>
<string>checkbox</string>
</dict>
<dict>
<key>Description</key>
<string>Choose whether or not a delegate skeleton is included.</string>
<key>Default</key>
<string>false</string>
<key>Identifier</key>
<string>withProtocol</string>
<key>Name</key>
<string>With delegate skeleton</string>
<key>Type</key>
<string>checkbox</string>
</dict>
<dict>
<key>Description</key>
<string>The name of the protocol used for delegation.</string>
<key>Identifier</key>
<string>protocolName</string>
<key>Name</key>
<string>Protocol</string>
<key>NotPersisted</key>
<true/>
<key>Required</key>
<true/>
<key>Type</key>
<string>text</string>
<key>RequiredOptions</key>
<dict>
<key>withProtocol</key>
<true/>
</dict>
</dict>
</array>
I fixed my own problem by replacing <true/> with <string>true</string>.
Correct way of adding a required option based on a checkbox
The key of the RequiredOptions dictionary must be the identifier of the other option, and the value of the dictionary must be the array of subset of values from the option that allow the current option to be enabled.
<key>RequiredOptions</key>
<dict>
<key>withXIB</key>
<array>
<string>true</string>
</array>
</dict>
In your case, true gets the job done.
Tested on Xcode 12 ✅