add firebase cli
This commit is contained in:
72
lib/firebase_options.dart
Normal file
72
lib/firebase_options.dart
Normal file
@@ -0,0 +1,72 @@
|
||||
// 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.dart';
|
||||
/// // ...
|
||||
/// await Firebase.initializeApp(
|
||||
/// options: DefaultFirebaseOptions.currentPlatform,
|
||||
/// );
|
||||
/// ```
|
||||
class DefaultFirebaseOptions {
|
||||
static FirebaseOptions get currentPlatform {
|
||||
if (kIsWeb) {
|
||||
throw UnsupportedError(
|
||||
'DefaultFirebaseOptions have not been configured for web - '
|
||||
'you can reconfigure this by running the FlutterFire CLI again.',
|
||||
);
|
||||
}
|
||||
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 android = FirebaseOptions(
|
||||
apiKey: 'AIzaSyA3v2o4UqvL61fw8sVHer6pYU9tGiBagu8',
|
||||
appId: '1:944560757353:android:d21ae04e44e82f10fa60f8',
|
||||
messagingSenderId: '944560757353',
|
||||
projectId: 'fcs-dev1',
|
||||
databaseURL: 'https://fcs-dev1.firebaseio.com',
|
||||
storageBucket: 'fcs-dev1.appspot.com',
|
||||
);
|
||||
|
||||
static const FirebaseOptions ios = FirebaseOptions(
|
||||
apiKey: 'AIzaSyBZICfIDWbWqjxHwY_jFnWv34EtCpiiE78',
|
||||
appId: '1:944560757353:ios:de037244faea4173fa60f8',
|
||||
messagingSenderId: '944560757353',
|
||||
projectId: 'fcs-dev1',
|
||||
databaseURL: 'https://fcs-dev1.firebaseio.com',
|
||||
storageBucket: 'fcs-dev1.appspot.com',
|
||||
androidClientId: '944560757353-1e5a1qdip1hu3p6531hvf89uf4up5ohk.apps.googleusercontent.com',
|
||||
iosClientId: '944560757353-o6emrja7ad8g8ulbcvvpah9a1tul3s21.apps.googleusercontent.com',
|
||||
iosBundleId: 'com.mokkon.fcs.dev',
|
||||
);
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:fcs/firebase_options.dart';
|
||||
import 'package:firebase_core/firebase_core.dart';
|
||||
import 'package:firebase_messaging/firebase_messaging.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -9,7 +10,10 @@ import 'data/provider/messaging_fcm.dart';
|
||||
|
||||
Future<void> main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
await Firebase.initializeApp();
|
||||
await Firebase.initializeApp(
|
||||
options: DefaultFirebaseOptions.currentPlatform,
|
||||
);
|
||||
|
||||
FirebaseMessaging.onBackgroundMessage(backgroundMessageHandler);
|
||||
|
||||
Config(
|
||||
|
||||
@@ -1,11 +1,17 @@
|
||||
import 'package:fcs/data/provider/messaging_fcm.dart';
|
||||
import 'package:firebase_core/firebase_core.dart';
|
||||
import 'package:firebase_messaging/firebase_messaging.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:logging/logging.dart';
|
||||
|
||||
import 'app.dart';
|
||||
import 'config.dart';
|
||||
|
||||
void main() {
|
||||
Future<void> main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
await Firebase.initializeApp();
|
||||
FirebaseMessaging.onBackgroundMessage(backgroundMessageHandler);
|
||||
|
||||
Config(
|
||||
flavor: Flavor.PRODUCTION,
|
||||
color: Colors.blue,
|
||||
|
||||
Reference in New Issue
Block a user