6177214e-ce7c-49e3-99de-ff9721b26f63 — Commit 279a2c65

AuthorNKL<nikolaj.king@gmail.com>
Date2025-01-14 10:57:16 +0100
added flavors for app

Changed files

azure/templates/build-android.yml                  |  2 +-
 .../android/app/src/dev/google-services.json       | 29 +++++++
 .../android/app/src/stage/google-services.json     | 29 +++++++
 comwell_key_app/firebase.json                      |  2 +-
 comwell_key_app/flutterfire-config.sh              | 52 +++++++++++++
 .../ios/Runner.xcodeproj/project.pbxproj           | 19 +++++
 .../ios/flavors/dev/GoogleService-Info.plist       | 30 ++++++++
 .../ios/flavors/stage/GoogleService-Info.plist     | 30 ++++++++
 comwell_key_app/lib/firebase_options_dev.dart      | 89 ++++++++++++++++++++++
 comwell_key_app/lib/firebase_options_stage.dart    | 75 ++++++++++++++++++
 comwell_key_app/lib/main.dart                      | 35 +++------
 comwell_key_app/lib/main_dev.dart                  |  6 ++
 comwell_key_app/lib/main_prod.dart                 |  6 ++
 comwell_key_app/lib/main_stage.dart                |  6 ++
 comwell_key_app/lib/main_test.dart                 |  6 ++
 comwell_key_app/lib/utils/firebase.dart            | 26 +++++++
 .../macos/Runner/GoogleService-Info.plist          | 10 +--
 17 files changed, 422 insertions(+), 30 deletions(-)

Diff

diff --git a/azure/templates/build-android.yml b/azure/templates/build-android.yml
index b8e92042..16d75e3b 100644
--- a/azure/templates/build-android.yml
+++ b/azure/templates/build-android.yml
@@ -73,7 +73,7 @@ steps:
inputs:
buildNumber: "$(Build.BuildId)"
target: "aab"
- extraArgs: "-t lib/main.dart"
+ extraArgs: "-t lib/main_test.dart"
buildFlavour: "releasetest"
projectDirectory: "$(Build.SourcesDirectory)/comwell_key_app"
diff --git a/comwell_key_app/android/app/src/dev/google-services.json b/comwell_key_app/android/app/src/dev/google-services.json
new file mode 100644
index 00000000..8ee455b8
--- /dev/null
+++ b/comwell_key_app/android/app/src/dev/google-services.json
@@ -0,0 +1,29 @@
+{
+ "project_info": {
+ "project_number": "735004599167",
+ "project_id": "comwell-phoenix-dev",
+ "storage_bucket": "comwell-phoenix-dev.firebasestorage.app"
+ },
+ "client": [
+ {
+ "client_info": {
+ "mobilesdk_app_id": "1:735004599167:android:3581fdbebd07fd5982f04a",
+ "android_client_info": {
+ "package_name": "com.comwell.phoenix.dev"
+ }
+ },
+ "oauth_client": [],
+ "api_key": [
+ {
+ "current_key": "AIzaSyBDb2WXsmgYppkmAo9vNIEsj9P99--zT8M"
+ }
+ ],
+ "services": {
+ "appinvite_service": {
+ "other_platform_oauth_client": []
+ }
+ }
+ }
+ ],
+ "configuration_version": "1"
+}
\ No newline at end of file
diff --git a/comwell_key_app/android/app/src/stage/google-services.json b/comwell_key_app/android/app/src/stage/google-services.json
new file mode 100644
index 00000000..4aca10be
--- /dev/null
+++ b/comwell_key_app/android/app/src/stage/google-services.json
@@ -0,0 +1,29 @@
+{
+ "project_info": {
+ "project_number": "243753787895",
+ "project_id": "comwell-phoenix-stage",
+ "storage_bucket": "comwell-phoenix-stage.firebasestorage.app"
+ },
+ "client": [
+ {
+ "client_info": {
+ "mobilesdk_app_id": "1:243753787895:android:17b0c823d8c936c6b98ef2",
+ "android_client_info": {
+ "package_name": "com.comwell.phoenix.stage"
+ }
+ },
+ "oauth_client": [],
+ "api_key": [
+ {
+ "current_key": "AIzaSyD_WsovZ7HMkALG_2wb41h31SZXSqNrvrQ"
+ }
+ ],
+ "services": {
+ "appinvite_service": {
+ "other_platform_oauth_client": []
+ }
+ }
+ }
+ ],
+ "configuration_version": "1"
+}
\ No newline at end of file
diff --git a/comwell_key_app/firebase.json b/comwell_key_app/firebase.json
index edd44d34..0a7dfa45 100644
--- a/comwell_key_app/firebase.json
+++ b/comwell_key_app/firebase.json
@@ -1 +1 @@
-{"flutter":{"platforms":{"android":{"default":{"projectId":"comwell-phoenix","appId":"1:1031550326508:android:04a896341af4f448cdf7c9","fileOutput":"android/app/google-services.json"}},"ios":{"default":{"projectId":"comwell-phoenix","appId":"1:1031550326508:ios:05ac9b069efbbac9cdf7c9","uploadDebugSymbols":false,"fileOutput":"ios/Runner/GoogleService-Info.plist"}},"macos":{"default":{"projectId":"comwell-phoenix","appId":"1:1031550326508:ios:045894b7b1978c36cdf7c9","uploadDebugSymbols":false,"fileOutput":"macos/Runner/GoogleService-Info.plist"}},"dart":{"lib/firebase_options.dart":{"projectId":"comwell-phoenix","configurations":{"android":"1:1031550326508:android:04a896341af4f448cdf7c9","ios":"1:1031550326508:ios:05ac9b069efbbac9cdf7c9","macos":"1:1031550326508:ios:045894b7b1978c36cdf7c9","web":"1:1031550326508:web:ac21b20cf60305e9cdf7c9","windows":"1:1031550326508:web:fc58da0d89a34cdecdf7c9"}}}}}}
\ No newline at end of file
+{"flutter":{"platforms":{"android":{"default":{"projectId":"comwell-phoenix","appId":"1:1031550326508:android:04a896341af4f448cdf7c9","fileOutput":"android/app/google-services.json"},"buildConfigurations":{"src/dev":{"projectId":"comwell-phoenix-dev","appId":"1:735004599167:android:3581fdbebd07fd5982f04a","fileOutput":"android/app/src/dev/google-services.json"},"src/stage":{"projectId":"comwell-phoenix-stage","appId":"1:243753787895:android:17b0c823d8c936c6b98ef2","fileOutput":"android/app/src/stage/google-services.json"}}},"ios":{"default":{"projectId":"comwell-phoenix","appId":"1:1031550326508:ios:05ac9b069efbbac9cdf7c9","uploadDebugSymbols":false,"fileOutput":"ios/Runner/GoogleService-Info.plist"},"buildConfigurations":{"Debug-develop":{"projectId":"comwell-phoenix-dev","appId":"1:735004599167:ios:276b6bc3fc059e9b82f04a","uploadDebugSymbols":false,"fileOutput":"ios/flavors/dev/GoogleService-Info.plist"},"Release-Stage":{"projectId":"comwell-phoenix-stage","appId":"1:243753787895:ios:24f02e213657204db98ef2","uploadDebugSymbols":false,"fileOutput":"ios/flavors/stage/GoogleService-Info.plist"}}},"macos":{"default":{"projectId":"comwell-phoenix-dev","appId":"1:735004599167:ios:33eaf052498b528b82f04a","uploadDebugSymbols":false,"fileOutput":"macos/Runner/GoogleService-Info.plist"}},"dart":{"lib/firebase_options.dart":{"projectId":"comwell-phoenix","configurations":{"android":"1:1031550326508:android:04a896341af4f448cdf7c9","ios":"1:1031550326508:ios:05ac9b069efbbac9cdf7c9","macos":"1:1031550326508:ios:045894b7b1978c36cdf7c9","web":"1:1031550326508:web:ac21b20cf60305e9cdf7c9","windows":"1:1031550326508:web:fc58da0d89a34cdecdf7c9"}},"lib/firebase_options_dev.dart":{"projectId":"comwell-phoenix-dev","configurations":{"android":"1:735004599167:android:3581fdbebd07fd5982f04a","ios":"1:735004599167:ios:276b6bc3fc059e9b82f04a","macos":"1:735004599167:ios:33eaf052498b528b82f04a","web":"1:735004599167:web:8411274579b222eb82f04a","windows":"1:735004599167:web:97277ae7b23ea63b82f04a"}},"lib/firebase_options_stage.dart":{"projectId":"comwell-phoenix-stage","configurations":{"android":"1:243753787895:android:17b0c823d8c936c6b98ef2","ios":"1:243753787895:ios:24f02e213657204db98ef2","web":"1:243753787895:web:2da67a12aa776b17b98ef2"}}}}}}
\ No newline at end of file
diff --git a/comwell_key_app/flutterfire-config.sh b/comwell_key_app/flutterfire-config.sh
new file mode 100644
index 00000000..9d6e43a9
--- /dev/null
+++ b/comwell_key_app/flutterfire-config.sh
@@ -0,0 +1,52 @@
+#!/bin/bash
+# Script to generate Firebase configuration files for different environments/flavors
+# Feel free to reuse and adapt this script for your own projects
+
+if [[ $# -eq 0 ]]; then
+ echo "Error: No environment specified. Use 'dev', 'stg', or 'prod'."
+ exit 1
+fi
+
+case $1 in
+ develop)
+ flutterfire config \
+ --project=comwell-phoenix-dev \
+ --out=lib/firebase_options_dev.dart \
+ --ios-bundle-id=com.comwell.phoenix.dev \
+ --ios-out=ios/flavors/dev/GoogleService-Info.plist \
+ --android-package-name=com.comwell.phoenix.dev \
+ --android-out=android/app/src/dev/google-services.json
+ ;;
+ releasetest)
+ flutterfire config \
+ --project=comwell-phoenix-test \
+ --out=lib/firebase_options_test.dart \
+ --ios-bundle-id=com.comwell.phoenix.test \
+ --ios-out=ios/flavors/test/GoogleService-Info.plist \
+ --android-package-name=com.comwell.phoenix.test \
+ --android-out=android/app/src/test/google-services.json
+ ;;
+ stage)
+ flutterfire config \
+ --project=comwell-phoenix-stage \
+ --out=lib/firebase_options_stage.dart \
+ --ios-bundle-id=com.comwell.phoenix.stage \
+ --ios-out=ios/flavors/stage/GoogleService-Info.plist \
+ --android-package-name=com.comwell.phoenix.stage \
+ --android-out=android/app/src/stage/google-services.json
+ ;;
+
+ prod)
+ flutterfire config \
+ --project=comwell-phoenix \
+ --out=lib/firebase_options_prod.dart \
+ --ios-bundle-id=com.comwell.phoenix \
+ --ios-out=ios/flavors/prod/GoogleService-Info.plist \
+ --android-package-name=com.comwell.phoenix \
+ --android-out=android/app/src/prod/google-services.json
+ ;;
+ *)
+ echo "Error: Invalid environment specified. Use 'dev', 'stg', or 'prod'."
+ exit 1
+ ;;
+esac
\ No newline at end of file
diff --git a/comwell_key_app/ios/Runner.xcodeproj/project.pbxproj b/comwell_key_app/ios/Runner.xcodeproj/project.pbxproj
index 4e2e819d..5fe0e671 100644
--- a/comwell_key_app/ios/Runner.xcodeproj/project.pbxproj
+++ b/comwell_key_app/ios/Runner.xcodeproj/project.pbxproj
@@ -181,6 +181,7 @@
89BF24564EDAAAD5D0F72D1E /* [CP] Copy Pods Resources */,
60A3A0652C6E297E0034E2D1 /* ShellScript */,
FA6E6FAC2B9ED1B9005DB4C1 /* Remove Duplicate Signature */,
+ 7026AC593B6CC0F0960CFF23 /* FlutterFire: "flutterfire bundle-service-file" */,
);
buildRules = (
);
@@ -312,6 +313,24 @@
shellPath = /bin/sh;
shellScript = "# Type a script or drag a script file from your workspace to insert its path.\nif [ \"$XCODE_VERSION_MAJOR\" = \"1500\" ]; then\n echo \"Remove signature files (Xcode 15 workaround)\"\n\n rm -rf \"$BUILD_DIR/Release-TestRelease-iphoneos/seos_mobile_keys_plugin/SeosMobileKeysSDK.xcframework-ios.signature\"\n find \"$BUILD_DIR/${CONFIGURATION}-iphoneos\" -name \"*.signature\" -type f | xargs -r rm\nfi\n";
};
+ 7026AC593B6CC0F0960CFF23 /* FlutterFire: "flutterfire bundle-service-file" */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputFileListPaths = (
+ );
+ inputPaths = (
+ );
+ name = "FlutterFire: \"flutterfire bundle-service-file\"";
+ outputFileListPaths = (
+ );
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "\n#!/bin/bash\nPATH=${PATH}:$FLUTTER_ROOT/bin:$HOME/.pub-cache/bin\nflutterfire bundle-service-file --plist-destination=${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app --build-configuration=${CONFIGURATION} --platform=ios --apple-project-path=${SRCROOT}\n";
+ };
89BF24564EDAAAD5D0F72D1E /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
diff --git a/comwell_key_app/ios/flavors/dev/GoogleService-Info.plist b/comwell_key_app/ios/flavors/dev/GoogleService-Info.plist
new file mode 100644
index 00000000..e54763e2
--- /dev/null
+++ b/comwell_key_app/ios/flavors/dev/GoogleService-Info.plist
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>API_KEY</key>
+ <string>AIzaSyAApmLc6jj2GNlGrXVFtKJo3A5AD9EXqhA</string>
+ <key>GCM_SENDER_ID</key>
+ <string>735004599167</string>
+ <key>PLIST_VERSION</key>
+ <string>1</string>
+ <key>BUNDLE_ID</key>
+ <string>com.comwell.phoenix.dev</string>
+ <key>PROJECT_ID</key>
+ <string>comwell-phoenix-dev</string>
+ <key>STORAGE_BUCKET</key>
+ <string>comwell-phoenix-dev.firebasestorage.app</string>
+ <key>IS_ADS_ENABLED</key>
+ <false></false>
+ <key>IS_ANALYTICS_ENABLED</key>
+ <false></false>
+ <key>IS_APPINVITE_ENABLED</key>
+ <true></true>
+ <key>IS_GCM_ENABLED</key>
+ <true></true>
+ <key>IS_SIGNIN_ENABLED</key>
+ <true></true>
+ <key>GOOGLE_APP_ID</key>
+ <string>1:735004599167:ios:276b6bc3fc059e9b82f04a</string>
+</dict>
+</plist>
\ No newline at end of file
diff --git a/comwell_key_app/ios/flavors/stage/GoogleService-Info.plist b/comwell_key_app/ios/flavors/stage/GoogleService-Info.plist
new file mode 100644
index 00000000..e49854eb
--- /dev/null
+++ b/comwell_key_app/ios/flavors/stage/GoogleService-Info.plist
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>API_KEY</key>
+ <string>AIzaSyCJT0sclbwev_-bMTlDafrWbnCw3y3jlhk</string>
+ <key>GCM_SENDER_ID</key>
+ <string>243753787895</string>
+ <key>PLIST_VERSION</key>
+ <string>1</string>
+ <key>BUNDLE_ID</key>
+ <string>com.comwell.phoenix.stage</string>
+ <key>PROJECT_ID</key>
+ <string>comwell-phoenix-stage</string>
+ <key>STORAGE_BUCKET</key>
+ <string>comwell-phoenix-stage.firebasestorage.app</string>
+ <key>IS_ADS_ENABLED</key>
+ <false></false>
+ <key>IS_ANALYTICS_ENABLED</key>
+ <false></false>
+ <key>IS_APPINVITE_ENABLED</key>
+ <true></true>
+ <key>IS_GCM_ENABLED</key>
+ <true></true>
+ <key>IS_SIGNIN_ENABLED</key>
+ <true></true>
+ <key>GOOGLE_APP_ID</key>
+ <string>1:243753787895:ios:24f02e213657204db98ef2</string>
+</dict>
+</plist>
\ No newline at end of file
diff --git a/comwell_key_app/lib/firebase_options_dev.dart b/comwell_key_app/lib/firebase_options_dev.dart
new file mode 100644
index 00000000..ec90d9ee
--- /dev/null
+++ b/comwell_key_app/lib/firebase_options_dev.dart
@@ -0,0 +1,89 @@
+// File generated by FlutterFire CLI.
+// ignore_for_file: type=lint
+import 'package:firebase_core/firebase_core.dart' show FirebaseOptions;
+import 'package:flutter/foundation.dart'
+ show defaultTargetPlatform, kIsWeb, TargetPlatform;
+
+/// Default [FirebaseOptions] for use with your Firebase apps.
+///
+/// Example:
+/// ```dart
+/// import 'firebase_options_dev.dart';
+/// // ...
+/// await Firebase.initializeApp(
+/// options: DefaultFirebaseOptions.currentPlatform,
+/// );
+/// ```
+class DefaultFirebaseOptions {
+ static FirebaseOptions get currentPlatform {
+ if (kIsWeb) {
+ return web;
+ }
+ switch (defaultTargetPlatform) {
+ case TargetPlatform.android:
+ return android;
+ case TargetPlatform.iOS:
+ return ios;
+ case TargetPlatform.macOS:
+ return macos;
+ case TargetPlatform.windows:
+ return windows;
+ case TargetPlatform.linux:
+ throw UnsupportedError(
+ 'DefaultFirebaseOptions have not been configured for linux - '
+ 'you can reconfigure this by running the FlutterFire CLI again.',
+ );
+ default:
+ throw UnsupportedError(
+ 'DefaultFirebaseOptions are not supported for this platform.',
+ );
+ }
+ }
+
+ static const FirebaseOptions web = FirebaseOptions(
+ apiKey: 'AIzaSyDGpYrWahQifMFqWW5gMbLy3CluzDxpFBQ',
+ appId: '1:735004599167:web:8411274579b222eb82f04a',
+ messagingSenderId: '735004599167',
+ projectId: 'comwell-phoenix-dev',
+ authDomain: 'comwell-phoenix-dev.firebaseapp.com',
+ storageBucket: 'comwell-phoenix-dev.firebasestorage.app',
+ measurementId: 'G-51EE8TQBVS',
+ );
+
+ static const FirebaseOptions android = FirebaseOptions(
+ apiKey: 'AIzaSyBDb2WXsmgYppkmAo9vNIEsj9P99--zT8M',
+ appId: '1:735004599167:android:3581fdbebd07fd5982f04a',
+ messagingSenderId: '735004599167',
+ projectId: 'comwell-phoenix-dev',
+ storageBucket: 'comwell-phoenix-dev.firebasestorage.app',
+ );
+
+ static const FirebaseOptions ios = FirebaseOptions(
+ apiKey: 'AIzaSyAApmLc6jj2GNlGrXVFtKJo3A5AD9EXqhA',
+ appId: '1:735004599167:ios:276b6bc3fc059e9b82f04a',
+ messagingSenderId: '735004599167',
+ projectId: 'comwell-phoenix-dev',
+ storageBucket: 'comwell-phoenix-dev.firebasestorage.app',
+ iosBundleId: 'com.comwell.phoenix.dev',
+ );
+
+ static const FirebaseOptions macos = FirebaseOptions(
+ apiKey: 'AIzaSyAApmLc6jj2GNlGrXVFtKJo3A5AD9EXqhA',
+ appId: '1:735004599167:ios:33eaf052498b528b82f04a',
+ messagingSenderId: '735004599167',
+ projectId: 'comwell-phoenix-dev',
+ storageBucket: 'comwell-phoenix-dev.firebasestorage.app',
+ iosBundleId: 'com.assa.comwellKeyApp',
+ );
+
+ static const FirebaseOptions windows = FirebaseOptions(
+ apiKey: 'AIzaSyDGpYrWahQifMFqWW5gMbLy3CluzDxpFBQ',
+ appId: '1:735004599167:web:97277ae7b23ea63b82f04a',
+ messagingSenderId: '735004599167',
+ projectId: 'comwell-phoenix-dev',
+ authDomain: 'comwell-phoenix-dev.firebaseapp.com',
+ storageBucket: 'comwell-phoenix-dev.firebasestorage.app',
+ measurementId: 'G-TTQZTN4P26',
+ );
+
+}
\ No newline at end of file
diff --git a/comwell_key_app/lib/firebase_options_stage.dart b/comwell_key_app/lib/firebase_options_stage.dart
new file mode 100644
index 00000000..526fe2bf
--- /dev/null
+++ b/comwell_key_app/lib/firebase_options_stage.dart
@@ -0,0 +1,75 @@
+// File generated by FlutterFire CLI.
+// ignore_for_file: type=lint
+import 'package:firebase_core/firebase_core.dart' show FirebaseOptions;
+import 'package:flutter/foundation.dart'
+ show defaultTargetPlatform, kIsWeb, TargetPlatform;
+
+/// Default [FirebaseOptions] for use with your Firebase apps.
+///
+/// Example:
+/// ```dart
+/// import 'firebase_options_stage.dart';
+/// // ...
+/// await Firebase.initializeApp(
+/// options: DefaultFirebaseOptions.currentPlatform,
+/// );
+/// ```
+class DefaultFirebaseOptions {
+ static FirebaseOptions get currentPlatform {
+ if (kIsWeb) {
+ return web;
+ }
+ switch (defaultTargetPlatform) {
+ case TargetPlatform.android:
+ return android;
+ case TargetPlatform.iOS:
+ return ios;
+ case TargetPlatform.macOS:
+ throw UnsupportedError(
+ 'DefaultFirebaseOptions have not been configured for macos - '
+ 'you can reconfigure this by running the FlutterFire CLI again.',
+ );
+ case TargetPlatform.windows:
+ throw UnsupportedError(
+ 'DefaultFirebaseOptions have not been configured for windows - '
+ 'you can reconfigure this by running the FlutterFire CLI again.',
+ );
+ case TargetPlatform.linux:
+ throw UnsupportedError(
+ 'DefaultFirebaseOptions have not been configured for linux - '
+ 'you can reconfigure this by running the FlutterFire CLI again.',
+ );
+ default:
+ throw UnsupportedError(
+ 'DefaultFirebaseOptions are not supported for this platform.',
+ );
+ }
+ }
+
+ static const FirebaseOptions web = FirebaseOptions(
+ apiKey: 'AIzaSyC4IsuVYzsgRNK7ox1ca9_hPi4gjpwkoPI',
+ appId: '1:243753787895:web:2da67a12aa776b17b98ef2',
+ messagingSenderId: '243753787895',
+ projectId: 'comwell-phoenix-stage',
+ authDomain: 'comwell-phoenix-stage.firebaseapp.com',
+ storageBucket: 'comwell-phoenix-stage.firebasestorage.app',
+ measurementId: 'G-FW956P2NNV',
+ );
+
+ static const FirebaseOptions android = FirebaseOptions(
+ apiKey: 'AIzaSyD_WsovZ7HMkALG_2wb41h31SZXSqNrvrQ',
+ appId: '1:243753787895:android:17b0c823d8c936c6b98ef2',
+ messagingSenderId: '243753787895',
+ projectId: 'comwell-phoenix-stage',
+ storageBucket: 'comwell-phoenix-stage.firebasestorage.app',
+ );
+
+ static const FirebaseOptions ios = FirebaseOptions(
+ apiKey: 'AIzaSyCJT0sclbwev_-bMTlDafrWbnCw3y3jlhk',
+ appId: '1:243753787895:ios:24f02e213657204db98ef2',
+ messagingSenderId: '243753787895',
+ projectId: 'comwell-phoenix-stage',
+ storageBucket: 'comwell-phoenix-stage.firebasestorage.app',
+ iosBundleId: 'com.comwell.phoenix.stage',
+ );
+}
diff --git a/comwell_key_app/lib/main.dart b/comwell_key_app/lib/main.dart
index 6daf70de..16bba56b 100644
--- a/comwell_key_app/lib/main.dart
+++ b/comwell_key_app/lib/main.dart
@@ -1,39 +1,28 @@
-import 'package:comwell_key_app/firebase_options.dart';
+import 'package:comwell_key_app/utils/firebase.dart';
import 'package:comwell_key_app/utils/locator.dart';
import 'package:easy_localization/easy_localization.dart';
-import 'package:firebase_analytics/firebase_analytics.dart';
+import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'comwell_app.dart';
-import 'package:firebase_core/firebase_core.dart';
-import 'firebase_options.dart';
-void main() async {
+
+
+//import 'firebase_options_test.dart' as test';
+void runMainApp(FirebaseOptions firebaseOptions) async {
WidgetsFlutterBinding.ensureInitialized();
await EasyLocalization.ensureInitialized();
await dotenv.load(fileName: ".env");
- await Firebase.initializeApp(
- options: DefaultFirebaseOptions.currentPlatform,
-);
+ await configureFirebase;
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
- //TODO: As default the analytics is disabled, but it should be enabled when the user accepts the terms and conditions
- FirebaseAnalytics.instance.setAnalyticsCollectionEnabled(true);
- FirebaseAnalytics.instance.setConsent(
- analyticsStorageConsentGranted: true,
- adStorageConsentGranted: true,
- adUserDataConsentGranted: true,
- adPersonalizationSignalsConsentGranted: true,
- );
setupLocator();
runApp(EasyLocalization(
- supportedLocales: const [Locale('en', 'US'), Locale('da', 'DK')],
- path:
- 'assets/translations', // <-- change the path of the translation files
- fallbackLocale: const Locale('da', 'DK'),
- child: ComwellApp()));
+ supportedLocales: const [Locale('en', 'US'), Locale('da', 'DK')],
+ path:
+ 'assets/translations', // <-- change the path of the translation files
+ fallbackLocale: const Locale('da', 'DK'),
+ child: ComwellApp()));
}
-
-
\ No newline at end of file
diff --git a/comwell_key_app/lib/main_dev.dart b/comwell_key_app/lib/main_dev.dart
new file mode 100644
index 00000000..64db2747
--- /dev/null
+++ b/comwell_key_app/lib/main_dev.dart
@@ -0,0 +1,6 @@
+import 'package:comwell_key_app/firebase_options.dart';
+import 'package:comwell_key_app/main.dart';
+
+void main() async {
+ runMainApp(DefaultFirebaseOptions.currentPlatform);
+}
\ No newline at end of file
diff --git a/comwell_key_app/lib/main_prod.dart b/comwell_key_app/lib/main_prod.dart
new file mode 100644
index 00000000..64db2747
--- /dev/null
+++ b/comwell_key_app/lib/main_prod.dart
@@ -0,0 +1,6 @@
+import 'package:comwell_key_app/firebase_options.dart';
+import 'package:comwell_key_app/main.dart';
+
+void main() async {
+ runMainApp(DefaultFirebaseOptions.currentPlatform);
+}
\ No newline at end of file
diff --git a/comwell_key_app/lib/main_stage.dart b/comwell_key_app/lib/main_stage.dart
new file mode 100644
index 00000000..64db2747
--- /dev/null
+++ b/comwell_key_app/lib/main_stage.dart
@@ -0,0 +1,6 @@
+import 'package:comwell_key_app/firebase_options.dart';
+import 'package:comwell_key_app/main.dart';
+
+void main() async {
+ runMainApp(DefaultFirebaseOptions.currentPlatform);
+}
\ No newline at end of file
diff --git a/comwell_key_app/lib/main_test.dart b/comwell_key_app/lib/main_test.dart
new file mode 100644
index 00000000..64db2747
--- /dev/null
+++ b/comwell_key_app/lib/main_test.dart
@@ -0,0 +1,6 @@
+import 'package:comwell_key_app/firebase_options.dart';
+import 'package:comwell_key_app/main.dart';
+
+void main() async {
+ runMainApp(DefaultFirebaseOptions.currentPlatform);
+}
\ No newline at end of file
diff --git a/comwell_key_app/lib/utils/firebase.dart b/comwell_key_app/lib/utils/firebase.dart
new file mode 100644
index 00000000..eb6580be
--- /dev/null
+++ b/comwell_key_app/lib/utils/firebase.dart
@@ -0,0 +1,26 @@
+import 'package:firebase_analytics/firebase_analytics.dart';
+import 'package:firebase_core/firebase_core.dart';
+import 'package:flutter/services.dart';
+
+import '../firebase_options.dart' as prod;
+import '../firebase_options_stage.dart' as stage;
+import '../firebase_options_dev.dart' as dev;
+
+Future<void> configureFirebase() async {
+ final firebaseOptions = switch (appFlavor) {
+ 'prod' => prod.DefaultFirebaseOptions.currentPlatform,
+ 'stage' => stage.DefaultFirebaseOptions.currentPlatform,
+ //'test' => test.DefaultFirebaseOptions.currentPlatform,
+ 'dev' => dev.DefaultFirebaseOptions.currentPlatform,
+ _ => throw UnsupportedError('Invalid flavor: $appFlavor'),
+ };
+ await Firebase.initializeApp(options: firebaseOptions);
+//TODO: As default the analytics is disabled, but it should be enabled when the user accepts the terms and conditions
+ FirebaseAnalytics.instance.setAnalyticsCollectionEnabled(true);
+ FirebaseAnalytics.instance.setConsent(
+ analyticsStorageConsentGranted: true,
+ adStorageConsentGranted: true,
+ adUserDataConsentGranted: true,
+ adPersonalizationSignalsConsentGranted: true,
+ );
+}
\ No newline at end of file
diff --git a/comwell_key_app/macos/Runner/GoogleService-Info.plist b/comwell_key_app/macos/Runner/GoogleService-Info.plist
index f67bad1f..899fec0b 100644
--- a/comwell_key_app/macos/Runner/GoogleService-Info.plist
+++ b/comwell_key_app/macos/Runner/GoogleService-Info.plist
@@ -3,17 +3,17 @@
<plist version="1.0">
<dict>
<key>API_KEY</key>
- <string>AIzaSyBgjzugYkBvtPwrx8SHqHsCCPFwxuOquyQ</string>
+ <string>AIzaSyAApmLc6jj2GNlGrXVFtKJo3A5AD9EXqhA</string>
<key>GCM_SENDER_ID</key>
- <string>1031550326508</string>
+ <string>735004599167</string>
<key>PLIST_VERSION</key>
<string>1</string>
<key>BUNDLE_ID</key>
<string>com.assa.comwellKeyApp</string>
<key>PROJECT_ID</key>
- <string>comwell-phoenix</string>
+ <string>comwell-phoenix-dev</string>
<key>STORAGE_BUCKET</key>
- <string>comwell-phoenix.firebasestorage.app</string>
+ <string>comwell-phoenix-dev.firebasestorage.app</string>
<key>IS_ADS_ENABLED</key>
<false></false>
<key>IS_ANALYTICS_ENABLED</key>
@@ -25,6 +25,6 @@
<key>IS_SIGNIN_ENABLED</key>
<true></true>
<key>GOOGLE_APP_ID</key>
- <string>1:1031550326508:ios:045894b7b1978c36cdf7c9</string>
+ <string>1:735004599167:ios:33eaf052498b528b82f04a</string>
</dict>
</plist>
\ No newline at end of file