Change the Package Name
Give each phone app your own package name (Android) and bundle ID (iOS) before you connect Firebase and publish.
Google Play, the App Store and Firebase know each app by its package name. Pick your own, for example:
| App | Folder | Now | Yours, for example |
|---|---|---|---|
| Customer | customer/ | com.go4food.user | com.yourbrand.customer |
| Restaurant | restaurant/ | com.go4food.vendor | com.yourbrand.restaurant |
| Driver | driver/ | com.go4food.rider | com.yourbrand.driver |
The admin panel, the restaurant web panel and the customer website run in the browser and have no package name. Skip them on this page.
It can never change after you publish
Once an app is live on Google Play or the App Store, its package name is fixed. Choose carefully, and use a different one for each app. Use only lowercase letters, numbers, dots and underscores.
Android#
Open android/app/build.gradle.kts in the app folder and change one line:
defaultConfig {
applicationId = "com.yourbrand.customer"
...
}
That is all Google Play and Firebase need.
Optional: also change the namespace#
The same file has namespace = "com.go4food.user" (or .vendor, .rider). Users never see it, so you can leave it. To change it, change these together, or the app crashes on start:
namespace = "com.yourbrand.customer"inandroid/app/build.gradle.kts.- Move
MainActivity.ktfromandroid/app/src/main/kotlin/com/go4food/user/to.../com/yourbrand/customer/(restaurant:com/go4food/vendor/, driver:com/go4food/rider/). - Change the first line of
MainActivity.kttopackage com.yourbrand.customer. Change nothing else in that file. - Driver app only:
android/app/src/main/AndroidManifest.xmlalso haspackage="com.go4food.rider"on its first tag. Change it to the same value.
iOS#
- Open
ios/Runner.xcworkspacein Xcode. - Click Runner → target Runner → Signing & Capabilities.
- Set Bundle Identifier to your own (check the All tab so Debug, Release and Profile change).
- Select the RunnerTests target and set the same ID with
.RunnerTestsat the end.
In ios/Runner.xcodeproj/project.pbxproj, replace every PRODUCT_BUNDLE_IDENTIFIER = com.go4food.user with your own ID (three lines for Runner, three for RunnerTests, which end in .RunnerTests). Use com.go4food.vendor in the restaurant app and com.go4food.rider in the driver app.
ios/Runner/Info.plist reads the ID from this setting, so you do not change it there.
Do not change the Dart package name
The name: line in pubspec.yaml (customer, restaurant, driver) is used in every import in the code. Users never see it. Leave it as it is.
Old Firebase files still name the demo package
google-services.json, GoogleService-Info.plist and lib/firebase_options.dart still contain com.go4food… and the demo project. Do not edit them by hand: FlutterFire replaces all three on the next page.
Next
Now connect each app to your Firebase project with FlutterFire. If you change a package name after that, run FlutterFire again for that app.