Are you tired of creating separate apps for each brand? Do you want to create an app that can be easily customized to fit different brands' identities? Look no further! In this article, we'll explore the concept of white labeling and how to achieve it using Xamarin Forms applications.

White-label apps are applications built by a private label app development company and rebranded and resold by other businesses. In simpler terms, there are applications whose same codebase can be used by multiple brands simply by configuring the application with the desired branding. This concept is perfect for app startup ideas that require customization to fit different clients or partners.

To create a white-labeled app in Xamarin Forms, we'll follow a simple approach using just one solution and creating different project configurations to indicate which app branding should compile. We'll start by creating config options in each project (Forms, Android, iOS, and General solution) and then match each configuration created. This will allow us to define new configuration symbols per each App configuration that can be used for conditional compilation.

Handling Options Per App

To achieve white-labeling, we need to handle various app-specific options such as:

  • App Icons/Splash/App Name
  • Styles
  • Texts
  • Configs (Api Urls/keys, etc)
  • Assets

We'll tackle each of these options separately:

App Icons/Splash/App Name

To handle these options, we'll do it on each platform. On Android, we'll create a copy of the AndroidManifest file and change the AppName/Package Name. We'll also open the Android .csproject file and load the specific Android manifest corresponding to the configuration symbol.

On iOS, we'll create a copy of the Info.plist file and change the AppName/Bundle Identifier/App Icon/Splash etc. In the iOS .csproject file, we'll set the Info.plist to be included according to the selected configuration.

Styles

To handle different styles per app, we'll create a style file per application and then load one style or the other depending on the configuration symbol.

Texts

To handle different texts per application, we'll create a .resx file per application. By using the configuration symbols, we'll load one .resx file or the other.

Images

To handle different images per application, we can use a naming convention by adding "App Name" at the end of every image. Then, we can use an ImageExtension and according to the ImageName specified in XAML, it will add the app suffix.

Tips and Best Practices

When developing with white-labeling in mind, remember:

  • Develop thinking on scalability: even if the purpose of the application is not white label, it's important to develop with scalability in mind.
  • Use a .resx file to store our strings, use style files, and use naming conventions for images. This way, if that app needs to become a white-labeling app, it will be much easier to do.

Final Thoughts

There are many ways to handle white labeling in mobile applications. Another great option is to use this library by Dan Siegel which autogenerates the config options. However, it will depend on how deep you want to go with your white labeling.

In conclusion, white-labeling in Xamarin Forms applications allows for easy customization and scalability. By following these steps and best practices, you can create a robust and adaptable application that can be easily rebranded for different clients or partners.