Programmatically switch between appicon-sets at runtime - ios

I created two versions of my iOS app with Xcode 6 : free and paid. To visually differentiate one from the other I use different background colors : the free version is orange while the paid version is red. I am using one single project for both versions, and a global boolean variable changes the entire app from free to paid (and vice versa).
Of course, all the icons must be different too. I need two appicon sets: one full with orange icons, and the other with red icons.
So my problem is: how to programmatically switch between two appicon sets at runtime? How to tell my project that, if the global variable is false, use the orange icons set, and if it is true use the red icons set?
Next image ilustrate the two appicon sets, but how to call them in-code?
The idea is that, if by the end of the month you forget to pay your subscription, the app becomes orange, then you visually realise you forgot to pay, and after you pay the app turns red again.

You can try below method introduced in iOS 10.3
https://developer.apple.com/reference/uikit/uiapplication/2806818-setalternateiconname

Short answer: You can't do that.
Long answer: Supposed you want to have one paid app and one free app (in contrast to one free app with in app purchases) you should use different targets for your free and paid version. You can use different info.plist files for each target and in those file specify the image to use as the app icon. Also you can change the app and bundle name there, so that you have two different apps on the App Store.
Add a preprocessor macro that identifies your target, you can then use that in your code to define the differences at compile time:
#ifdef LITE_VERSION
[self showAds];
#else
[self showUsefulInformation];
#endif

Apple don't allow the switching of App icons during runtime. So it is not possible to switch between the App icons. If you need to do it create two apps in iTunesConnect with different app names.

Related

Is it possible to change an app icon depending on the market?

I have an app published in the U.S and in several countries, including Japan. I'd like to change the icon in Japan. I couldn't find anything on iTunes related to this issue.
Is this possible?
Thanks!
You cannot have different icons for the same app.
You will need to release two versions of your app - one in the Japanese store and one for all other territories.

In-app preferences screen in an iOS 7 app

I'm fairly new to iOS development and I am porting an Android app to iOS 7. The Android app provides a screen that allows the user to change a number of non persistent settings. Because these are not saved, it doesn't seem appropriate to me to expose them, on iOS, as preferences via a settings bundle and the built-in Settings app. So I'm looking at an in-app settings screen, which I understand is allowed - but perhaps not encouraged - by Apple.
Some questions:
Am I correct that an in-App approach is allowed by Apple? Most example code seems to use settings bundles. Am I going to have problems when the app is submitted to the App Store?
I can put the settings UI in a simple UITableViewController, but is there an approved way to expose this to the user? XCode 5 doesn't provide a settings identifier (and icon) for toolbar buttons, and the "Info" identifier (letter i inside a circle) seems to have been dropped too. Should I use a custom icon? Are there any de facto standards?
I haven't seen this kind of UI element before on iOS but my exposure to the platform as a user is limited.
There is nothing wrong with doing an in-app preference (table)view. You won't be rejected for that (this point seems to be way too much exagerated outside the iOS community). There are guidelines that you can follow: iOS Human Interface Guidelines... or not. As long as you don't use private APIs (assuming you know how to access them anyway), you're fine! So you can use a custom icon, the "i" button, or any UI element that convey the reasonable meaning of providing access to more info/preference.
In your code, you can use the class NSUserDefaults (with the standardUserDefaults) to store your preferences.
Many apps have in-app settings. It's fine. Apple even states that it is fine. Just don't have both.
Use a custom icon. Many apps seem to use an icon that looks like a gear.

Icons for two versions of the same iPhone/iPad App

I'm try to develop "pro" version of an app which is already at store. As far as I understand I need a seperate icon for the pro version. Is it possible to change the icon completely? For example instead of typing "pro", can I change the colours of the icon?
A common question: is there any relationship between two versions of the same app? Or are they completely separate apps?
Thank you
If you want to have different icons, you have to separate both apps, they cannot be the same. You'll have to do 2 separated apps in your case.
Also, remember, you'll want to upload a different Large icon (iTunes Artwork) file to iTunes Connect. Since that image, not the icon file inside the app bundle, is what your potential customers will see.

How do I define my app home screen group name?

I'd like to define a default folder name on home screen for my apps (which are Ad Hoc distributed), such as the default apps when they are dragged to ("Productivity", "Utilities", "Games", "Navigation"):
Instead of default name "Folder":
How can I achieve this?
Edit:
I tried adding LSApplicationCategoryType to Info.plist, but that doesn't seem to affect anything.
I think this will work only on AppStore versions. I tested with bunch of my Ad-hoc releases and their AppStore releases. - For ad-hoc releases - "Folder" name appears. For AppStore versions - App, which is moved onto other app - it's category name is used. (In case Ad-hoc is moved onto AppStore app, then AppStore app's category is used).
Anyways, I checked out that LSApplicationCategoryType https://developer.apple.com/library/ios/documentation/general/Reference/InfoPlistKeyReference/Articles/LaunchServicesKeys.html#//apple_ref/doc/uid/TP40009250-SW8
Did You use for example for "Education" - public.app-category.education ?
Either way - it might not even be intended to work on debug/ad-hoc releases as stated in the same page:
LSApplicationCategoryType (String - OS X) is a string that contains
the UTI corresponding to the app’s type. The App Store uses this
string to determine the appropriate categorization for the app. Table
2 lists the supported UTIs for apps.
...which sounds like, that this value is used by App-Store, to correctly set Applications category, which then is used to categorize applications on springboard.
So I guess, this will work only when App is downloaded from App Store.

Confusion on universal app/iPad target

There are many similar questions, but I haven't really found the answer for this.
I'm making an iPad version of a large iPhone app. Which is the best way to go when distributing? I understand that when turning the app into a "Universal" app, all resources (images etc) for the iPad version are also downloaded to iPhones.
This is probably not desired, so to me it sounds better to use the built-in XCode function to duplicate the target into an iPad target. (This is nice since it will generate iPad-specific versions of all the NIB-files)
However, I'm afraid that this will split the app into two versions on the app store. I want to make it look like a universal app on app store, with the little "+"-sign. Is it possible to make it look like a universal app, when it's actually two different targets?
In a Universal app there is only one binary.
If you create to targets you can compile for either iPhone or iPad, but then you'll have two different apps.
So, no it is not possible to make two apps look and behave like an universal app.
I don't think that the images etc being present in both versions are such a serious problem.
They get compressed and can mostly be used for both versions.
I would prefer having a universal app that syncs via iCloud on all my devices than having to download two versions of the app... Apple does it too, e.g. in iBooks.

Resources