mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-11-26 08:14:55 +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:allowBackup="false">
|
||||
<activity
|
||||
android:name="com.example.syncrow_app.MainActivity"
|
||||
android:name="com.syncrow.mobile.MainActivity"
|
||||
android:exported="true"
|
||||
android:launchMode="singleTop"
|
||||
android:theme="@style/LaunchTheme"
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package com.example.syncrow_application
|
||||
package com.syncrow.mobile
|
||||
|
||||
import io.flutter.embedding.android.FlutterActivity
|
||||
|
||||
|
||||
@ -17,8 +17,7 @@ import 'package:syncrow_app/firebase_options_staging.dart' as staging;
|
||||
/// );
|
||||
/// ```
|
||||
class DefaultFirebaseOptions {
|
||||
static FirebaseOptions get currentPlatform {
|
||||
const flavor = String.fromEnvironment('flavor');
|
||||
static FirebaseOptions currentPlatform(String flavor) {
|
||||
if (kIsWeb) {
|
||||
throw UnsupportedError(
|
||||
'DefaultFirebaseOptions have not been configured for web - '
|
||||
@ -30,11 +29,12 @@ class DefaultFirebaseOptions {
|
||||
return dev.DefaultFirebaseOptions.currentPlatform;
|
||||
case 'staging':
|
||||
return staging.DefaultFirebaseOptions.currentPlatform;
|
||||
case 'prod':
|
||||
case 'production':
|
||||
return prod.DefaultFirebaseOptions.currentPlatform;
|
||||
default:
|
||||
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',
|
||||
databaseURL: 'https://syncrow-staging-79446.asia-southeast1.firebasedatabase.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',
|
||||
databaseURL: 'https://syncrow-prod-79446.asia-southeast1.firebasedatabase.app/',
|
||||
storageBucket: 'syncrow-staging.appspot.com',
|
||||
iosBundleId: 'com.example.syncrow.app',
|
||||
iosBundleId: 'com.syncrow.iot.ex',
|
||||
);
|
||||
|
||||
static const FirebaseOptions web = FirebaseOptions(
|
||||
|
||||
@ -73,6 +73,6 @@ class DefaultFirebaseOptions {
|
||||
projectId: 'syncrow-prod-79446',
|
||||
databaseURL: 'https://syncrow-staging-79446.asia-southeast1.firebasedatabase.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();
|
||||
|
||||
await Firebase.initializeApp(
|
||||
options: DefaultFirebaseOptions.currentPlatform,
|
||||
options: DefaultFirebaseOptions.currentPlatform('production'),
|
||||
name: 'syncrow_app',
|
||||
);
|
||||
|
||||
//final SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
|
||||
@ -40,7 +40,8 @@ void main() {
|
||||
initialSetup();
|
||||
|
||||
await Firebase.initializeApp(
|
||||
options: DefaultFirebaseOptions.currentPlatform,
|
||||
options: DefaultFirebaseOptions.currentPlatform('dev'),
|
||||
name: 'syncrow_app',
|
||||
);
|
||||
|
||||
//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_dotenv/flutter_dotenv.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/utils/bloc_observer.dart';
|
||||
import 'package:syncrow_app/utils/helpers/localization_helpers.dart';
|
||||
|
||||
import 'firebase_options.dart';
|
||||
import 'my_app.dart';
|
||||
|
||||
void main() {
|
||||
@ -40,7 +40,8 @@ void main() {
|
||||
initialSetup();
|
||||
|
||||
await Firebase.initializeApp(
|
||||
options: DefaultFirebaseOptions.currentPlatform,
|
||||
options: DefaultFirebaseOptions.currentPlatform('staging'),
|
||||
name: 'syncrow_app',
|
||||
);
|
||||
|
||||
//final SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
|
||||
Reference in New Issue
Block a user