I am creating a generic app which will have different builds for different customers. The app is 99.5% identical for each customer, the difference being each is branded with the customer's own particular images and text and app icon etc.
Obviously this could be done using flags such as:
#if defined (CUSTOMER_A)
NSString* text = @"Text for customer A";
UIImage *image = [UIImage imageNamed:@"customerAImage"];
#elseif defined (CUSTOMER_B)
NSString* text = @"Text for customer B";
UIImage *image = [UIImage imageNamed:@"customerBImage"];
But obviously I'd like to avoid this and just have:
NSString* text = @"Text";
UIImage *image = [UIImage imageNamed:@"image"];
(The text would be localizable, so it would be using NSLocalizedString in the final version).
I was wondering if a possible approach would be to place the project into a workspace along with a number of static libraries, each of which contains the specific text and images for each customer and then use different schemes to create different builds. So Scheme A would create a target built with the main project and static library A for example.
I started with a small proof of concept but before going too far with it I'd first like to check this is a feasible and reasonable approach, or if there's a better alternative. If it is feasible then a few questions come to mind:
how can an image in a static library be accessed from the code in the main project? Does a bundle have to be created to access the contents of the library, how is this done?
is it possible to change the application desktop and marketplace icons depending upon which scheme is used?
is it possible to specify a different set of distribution certificates etc. to be used per scheme?
is it true that static libraries cannot contain localized variants?
This is for iOS so its not possible to use a framework for this.
Thanks for any feedback.
(P.S. the build system will be automated using Jenkins).
A branded app is a mobile application created by a company to promote its brand. Branded apps typically reflect the brand's identity and feature its values, colours, logo, visual identity and style, slogan, and more.
So, mobile app branding is how users will perceive the app interacting with it: its visual image, its communication, and its reputation.
You just need to create multiple targets in your project and have resource folders for each target (customer/brand). Here's how to accomplish this:
Hope this helps!
How many variants do you plan on supporting? Having a target/project/etc becomes unwieldy if you have more than a handful. This is roughly what we do:
The skin "application" process basically consists of providing a list of "skin" directories, which are files to be copied into the application bundle. Any duplicate files are overwritten by the skin. The application's base Info.plist
is merged with any changes specified in the skin directory.
Essentially, we try to separate out the skinning as much as possible from the code itself. We have found that any solution involving Xcode itself involves much manual self-removal of hair from developers' scalps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With