mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-11-26 08:54:54 +00:00
Refactor application package structure and update Firebase iOS bundle IDs for different environments.
This commit is contained in:
@ -14,7 +14,7 @@
|
|||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
android:allowBackup="false">
|
android:allowBackup="false">
|
||||||
<activity
|
<activity
|
||||||
android:name="com.example.syncrow_app.MainActivity"
|
android:name="com.syncrow.mobile.MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:launchMode="singleTop"
|
android:launchMode="singleTop"
|
||||||
android:theme="@style/LaunchTheme"
|
android:theme="@style/LaunchTheme"
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
package com.example.syncrow_application
|
package com.syncrow.mobile
|
||||||
|
|
||||||
import io.flutter.embedding.android.FlutterActivity
|
import io.flutter.embedding.android.FlutterActivity
|
||||||
|
|
||||||
|
|||||||
@ -17,8 +17,7 @@ import 'package:syncrow_app/firebase_options_staging.dart' as staging;
|
|||||||
/// );
|
/// );
|
||||||
/// ```
|
/// ```
|
||||||
class DefaultFirebaseOptions {
|
class DefaultFirebaseOptions {
|
||||||
static FirebaseOptions get currentPlatform {
|
static FirebaseOptions currentPlatform(String flavor) {
|
||||||
const flavor = String.fromEnvironment('flavor');
|
|
||||||
if (kIsWeb) {
|
if (kIsWeb) {
|
||||||
throw UnsupportedError(
|
throw UnsupportedError(
|
||||||
'DefaultFirebaseOptions have not been configured for web - '
|
'DefaultFirebaseOptions have not been configured for web - '
|
||||||
@ -30,11 +29,12 @@ class DefaultFirebaseOptions {
|
|||||||
return dev.DefaultFirebaseOptions.currentPlatform;
|
return dev.DefaultFirebaseOptions.currentPlatform;
|
||||||
case 'staging':
|
case 'staging':
|
||||||
return staging.DefaultFirebaseOptions.currentPlatform;
|
return staging.DefaultFirebaseOptions.currentPlatform;
|
||||||
case 'prod':
|
case 'production':
|
||||||
return prod.DefaultFirebaseOptions.currentPlatform;
|
return prod.DefaultFirebaseOptions.currentPlatform;
|
||||||
default:
|
default:
|
||||||
throw UnsupportedError(
|
throw UnsupportedError(
|
||||||
'DefaultFirebaseOptions are not supported for this flavor.',
|
'DefaultFirebaseOptions have not been configured for web - '
|
||||||
|
'you can reconfigure this by running the FlutterFire CLI again.',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -73,6 +73,6 @@ class DefaultFirebaseOptions {
|
|||||||
projectId: 'syncrow-prod-79446',
|
projectId: 'syncrow-prod-79446',
|
||||||
databaseURL: 'https://syncrow-staging-79446.asia-southeast1.firebasedatabase.app/',
|
databaseURL: 'https://syncrow-staging-79446.asia-southeast1.firebasedatabase.app/',
|
||||||
storageBucket: 'syncrow-prod-79446.firebasestorage.app',
|
storageBucket: 'syncrow-prod-79446.firebasestorage.app',
|
||||||
iosBundleId: 'com.syncrow.mobile.dev',
|
iosBundleId: 'com.syncrow.iot.ex.dev',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -62,7 +62,7 @@ class DefaultFirebaseOptions {
|
|||||||
projectId: 'syncrow-staging',
|
projectId: 'syncrow-staging',
|
||||||
databaseURL: 'https://syncrow-prod-79446.asia-southeast1.firebasedatabase.app/',
|
databaseURL: 'https://syncrow-prod-79446.asia-southeast1.firebasedatabase.app/',
|
||||||
storageBucket: 'syncrow-staging.appspot.com',
|
storageBucket: 'syncrow-staging.appspot.com',
|
||||||
iosBundleId: 'com.example.syncrow.app',
|
iosBundleId: 'com.syncrow.iot.ex',
|
||||||
);
|
);
|
||||||
|
|
||||||
static const FirebaseOptions web = FirebaseOptions(
|
static const FirebaseOptions web = FirebaseOptions(
|
||||||
|
|||||||
@ -73,6 +73,6 @@ class DefaultFirebaseOptions {
|
|||||||
projectId: 'syncrow-prod-79446',
|
projectId: 'syncrow-prod-79446',
|
||||||
databaseURL: 'https://syncrow-staging-79446.asia-southeast1.firebasedatabase.app/',
|
databaseURL: 'https://syncrow-staging-79446.asia-southeast1.firebasedatabase.app/',
|
||||||
storageBucket: 'syncrow-prod-79446.firebasestorage.app',
|
storageBucket: 'syncrow-prod-79446.firebasestorage.app',
|
||||||
iosBundleId: 'com.syncrow.mobile.staging',
|
iosBundleId: 'com.syncrow.iot.ex.staging',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -42,7 +42,8 @@ void main() {
|
|||||||
initialSetup();
|
initialSetup();
|
||||||
|
|
||||||
await Firebase.initializeApp(
|
await Firebase.initializeApp(
|
||||||
options: DefaultFirebaseOptions.currentPlatform,
|
options: DefaultFirebaseOptions.currentPlatform('production'),
|
||||||
|
name: 'syncrow_app',
|
||||||
);
|
);
|
||||||
|
|
||||||
//final SharedPreferences prefs = await SharedPreferences.getInstance();
|
//final SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||||
|
|||||||
@ -40,7 +40,8 @@ void main() {
|
|||||||
initialSetup();
|
initialSetup();
|
||||||
|
|
||||||
await Firebase.initializeApp(
|
await Firebase.initializeApp(
|
||||||
options: DefaultFirebaseOptions.currentPlatform,
|
options: DefaultFirebaseOptions.currentPlatform('dev'),
|
||||||
|
name: 'syncrow_app',
|
||||||
);
|
);
|
||||||
|
|
||||||
//final SharedPreferences prefs = await SharedPreferences.getInstance();
|
//final SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||||
|
|||||||
@ -5,11 +5,11 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||||
import 'package:permission_handler/permission_handler.dart';
|
import 'package:permission_handler/permission_handler.dart';
|
||||||
import 'package:syncrow_app/firebase_options_staging.dart';
|
|
||||||
import 'package:syncrow_app/services/locator.dart';
|
import 'package:syncrow_app/services/locator.dart';
|
||||||
import 'package:syncrow_app/utils/bloc_observer.dart';
|
import 'package:syncrow_app/utils/bloc_observer.dart';
|
||||||
import 'package:syncrow_app/utils/helpers/localization_helpers.dart';
|
import 'package:syncrow_app/utils/helpers/localization_helpers.dart';
|
||||||
|
|
||||||
|
import 'firebase_options.dart';
|
||||||
import 'my_app.dart';
|
import 'my_app.dart';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
@ -40,7 +40,8 @@ void main() {
|
|||||||
initialSetup();
|
initialSetup();
|
||||||
|
|
||||||
await Firebase.initializeApp(
|
await Firebase.initializeApp(
|
||||||
options: DefaultFirebaseOptions.currentPlatform,
|
options: DefaultFirebaseOptions.currentPlatform('staging'),
|
||||||
|
name: 'syncrow_app',
|
||||||
);
|
);
|
||||||
|
|
||||||
//final SharedPreferences prefs = await SharedPreferences.getInstance();
|
//final SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||||
|
|||||||
Reference in New Issue
Block a user