Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated readme with firebase instructions #329

Merged
merged 2 commits into from
Oct 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 33 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,56 +38,55 @@ flutter:

Command to run to update the translations
```
flutter packages pub run icapps_translations
fvm flutter packages pub run icapps_translations
```

## Json Serializable & Kiwi

```
flutter packages pub run build_runner build
flutter packages pub run build_runner build --delete-conflicting-outputs
flutter packages pub run build_runner watch
fvm flutter packages pub run build_runner build --delete-conflicting-outputs
fvm flutter packages pub run build_runner watch
```
## Environments

`--release` is not available for emulators. Performance will be better

### Dev, Debug
```
flutter run --flavor dev -t lib/main.dart
fvm flutter run --flavor dev -t lib/main.dart

flutter run --release --flavor dev -t lib/main.dart
fvm flutter run --release --flavor dev -t lib/main.dart
```

### Dummy

Note: a hot reload is required after launch to use the correct launch file.

```
flutter run --flavor dev -t lib/main_dummy.dart
fvm flutter run --flavor dev -t lib/main_dummy.dart

flutter run --release --flavor dev -t lib/main_dummy.dart
fvm flutter run --release --flavor dev -t lib/main_dummy.dart
```

### Alpha
```
flutter run --flavor alpha -t lib/main_alpha.dart
fvm flutter run --flavor alpha -t lib/main_alpha.dart

flutter run --release --flavor alpha -t lib/main_alpha.dart
fvm flutter run --release --flavor alpha -t lib/main_alpha.dart
```

### Beta
```
flutter run --flavor beta -t lib/main_beta.dart
fvm flutter run --flavor beta -t lib/main_beta.dart

flutter run --release --flavor beta -t lib/main_beta.dart
fvm flutter run --release --flavor beta -t lib/main_beta.dart
```

### Prod, Release
```
flutter run --flavor prod -t lib/main_prod.dart
fvm flutter run --flavor prod -t lib/main_prod.dart

flutter run --release --flavor prod -t lib/main_prod.dart
fvm flutter run --release --flavor prod -t lib/main_prod.dart
```

## Niddler
Expand All @@ -100,7 +99,7 @@ Niddler is also available for Android & Java (OkHttp: https://github.com/icapps/

## Linting

To check your code matches our linting. The analysis_options.yaml contains all our code checks.
To check your code matches our linting. The `analysis_options.yaml` contains all our code checks.

```
flutter analyze
Expand All @@ -111,13 +110,13 @@ flutter analyze
In order to run our test we need to run

```
flutter test
fvm flutter test
```

If we want to update our golden files we need to run

```
flutter test --update-goldens
fvm flutter test --update-goldens
```

## Fastlane
Expand All @@ -135,15 +134,21 @@ This script will run a dart script. The dart script itself will ask you some inp

#### Add provisioning files

```
place the provisioning profiles -> provision_profile/**
naming should be the same as provided in the iOS/Configuration/** files (underscore will be replaced with a space in the configuration files)
```
Add the provisioning profiles in the ios/provisioning/ folder. The naming of the files should be the same as provided in the `ios/Configuration/{flavor}.xcconfig` files (underscore will be replaced with a space in the configuration files)

#### Firebase

To setup firebase you will need to create a new firebase project with 8 new apps, 1 for each flavor on both iOS and Android.

When creating the iOS apps on firebase you will be able to download a `GoogleService-Info.plist` file which you will need to rename according to the flavor you just created an app for e.g.: You just created the iOS App for the Dev flavor so your file should be named `GoogleService-Info-dev.plist`.
Each `.plist` file you download from firebase needs to be placed in the ios/Configuration/GoogleService/ folder. Whenever the project is run with a different flavor from the currently active flavor, it will automatically copy the correct `GoogleService-Info-{flavor}.plist` file into the ios/Runner/ folder.

When creating the Android apps you will be able to download a `google-services.json` file, you only need to download this file once at the end of the last Android app setup on firebase. This `.json` file contains all the configurations for the 4 Android apps which you just created. Add the `.json` file in the android/app/src/ folder.

#### Languages

```
Configure the required languages in xCode
Configure the required languages in Xcode
```

### icapps Translations
Expand All @@ -157,34 +162,34 @@ Update the translations.py file (edit the todos)
Obfuscation is enabled by default when using fastlane for building. The symbol files are stored in
`./build/debug-info/#{options[:flavor]}`

**Important**: Add the following regex to jenking configuration to also archive the symbol files
**Important**: Add the following regex to jenkins configuration to also archive the symbol files
```
**/*.symbols
```

### Icons

Replace the files in assets_launcher_icons/
Replace the files in the `assets_launcher_icons/**` folder.

You can also change the adaptive_icon_background in the flutter_launcher_icons-{flavor}.yaml (currently "#CB2E63") (only available for Android 8.0 devices and above)
You can also change the adaptive_icon_background in the `flutter_launcher_icons-{flavor}.yaml` (currently "#CB2E63") (only available for Android 8.0 devices and above)

After this, run the following command

```
flutter pub run flutter_launcher_icons:main -f flutter_launcher_icons-dev.yaml
fvm flutter pub run flutter_launcher_icons:main -f flutter_launcher_icons-dev.yaml
```

### Common issues

```
No Flavor provided
No flavor provided
```

Add a flavor to your configuration. Extra info can be found in this issue -> https://github.com/icapps/flutter-template/issues/3

### Questions?

For question contact Koen Van Looveren
For question contact William Verhaeghe

### Finish

Expand Down