1

I have whitelabeling for my apps for different customers that are all based on the same app. Only minor configuration changes needed on the app.

One thing I find hard to figure out is a nice way to configure for different Bundle Id and Package Name. (Current solution found is refactoring which changes whole lot of code). The main purpose bundle ID change is to upload into different appstore, push notification all requires specific bundle ID.

In IOS, its quite simple, you change it in Bundle Identifier. In Flutter, its also simple, just Bundle Identifier change.

I feel there is a proper way to have Bundle Identifier configuration/variant management for Android without doing a whole refactoring.

Axil
  • 3,606
  • 10
  • 62
  • 136

2 Answers2

2

Option a) Use gradle build flavors. You can specify a separate applicationId for each build flavor. The only problem is that the list of flavors on your project will grow with each added white label customer.

Option b) Turn your app project in a android library (aar). Create new projects for each white label app and import the library as a dependency. You will need a project template since some configuration will be necessary to use the aar as a replacement for the whole app.

Alexander Hoffmann
  • 5,104
  • 3
  • 17
  • 23
  • for option a) are you talking about this https://developer.android.com/studio/build/build-variants ? – Axil Jan 21 '22 at 07:27
2

Just set a new applicationId in your build.gradle file. If you are using productFlavors, set different applicationId in your flavors, like:

productFlavors {
  one {
    applicationId "com.example.project.one"
  }
  two {
    applicationId "com.example.project.two"
  }
  three {
    applicationId "com.example.project.three"
  }
}
ZhangLei
  • 393
  • 1
  • 7
  • 17
  • would it work with complete different name for the application Id ? since its for different companies - "com.apple.my" and "com.microsoft.my" – Axil Jan 21 '22 at 07:58