From 32dd6c986c44ec55fcc16b5fb58a402ca523a442 Mon Sep 17 00:00:00 2001 From: "audric.sabatier" Date: Sun, 20 Nov 2022 14:23:21 +0100 Subject: [PATCH] ADD : Firebase to project --- .../android/app/google-services.json | 39 +++++++++++ .../ios/Runner/GoogleService-Info.plist | 34 +++++++++ .../ios/firebase_app_id_file.json | 7 ++ .../lib/firebase_options.dart | 69 +++++++++++++++++++ .../dafl_project_flutter/lib/model/user.dart | 2 +- Sources/dafl_project_flutter/pubspec.lock | 21 ++++++ Sources/dafl_project_flutter/pubspec.yaml | 1 + 7 files changed, 172 insertions(+), 1 deletion(-) create mode 100644 Sources/dafl_project_flutter/android/app/google-services.json create mode 100644 Sources/dafl_project_flutter/ios/Runner/GoogleService-Info.plist create mode 100644 Sources/dafl_project_flutter/ios/firebase_app_id_file.json create mode 100644 Sources/dafl_project_flutter/lib/firebase_options.dart diff --git a/Sources/dafl_project_flutter/android/app/google-services.json b/Sources/dafl_project_flutter/android/app/google-services.json new file mode 100644 index 0000000..09fbda3 --- /dev/null +++ b/Sources/dafl_project_flutter/android/app/google-services.json @@ -0,0 +1,39 @@ +{ + "project_info": { + "project_number": "943188299704", + "project_id": "daflmusic-b3b74", + "storage_bucket": "daflmusic-b3b74.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:943188299704:android:995199bd5229a330a9c94d", + "android_client_info": { + "package_name": "com.example.dafl_project_flutter" + } + }, + "oauth_client": [ + { + "client_id": "943188299704-qp12a784hmdo97v7qq78ekasgrfkmo52.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyBehHyqsXbBm1I7fBSG2bPOQvpDX-8Rm7I" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "943188299704-qp12a784hmdo97v7qq78ekasgrfkmo52.apps.googleusercontent.com", + "client_type": 3 + } + ] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/Sources/dafl_project_flutter/ios/Runner/GoogleService-Info.plist b/Sources/dafl_project_flutter/ios/Runner/GoogleService-Info.plist new file mode 100644 index 0000000..dc10d4e --- /dev/null +++ b/Sources/dafl_project_flutter/ios/Runner/GoogleService-Info.plist @@ -0,0 +1,34 @@ + + + + + CLIENT_ID + 943188299704-h4035qno57lll2km151rdh3bgbb22vk7.apps.googleusercontent.com + REVERSED_CLIENT_ID + com.googleusercontent.apps.943188299704-h4035qno57lll2km151rdh3bgbb22vk7 + API_KEY + AIzaSyCnQnCeu7gdc1_uIOxXVNQT1pG8xjD_tB8 + GCM_SENDER_ID + 943188299704 + PLIST_VERSION + 1 + BUNDLE_ID + com.example.daflProjectFlutter + PROJECT_ID + daflmusic-b3b74 + STORAGE_BUCKET + daflmusic-b3b74.appspot.com + IS_ADS_ENABLED + + IS_ANALYTICS_ENABLED + + IS_APPINVITE_ENABLED + + IS_GCM_ENABLED + + IS_SIGNIN_ENABLED + + GOOGLE_APP_ID + 1:943188299704:ios:bd6866b329aebb64a9c94d + + \ No newline at end of file diff --git a/Sources/dafl_project_flutter/ios/firebase_app_id_file.json b/Sources/dafl_project_flutter/ios/firebase_app_id_file.json new file mode 100644 index 0000000..bc79e45 --- /dev/null +++ b/Sources/dafl_project_flutter/ios/firebase_app_id_file.json @@ -0,0 +1,7 @@ +{ + "file_generated_by": "FlutterFire CLI", + "purpose": "FirebaseAppID & ProjectID for this Firebase app in this directory", + "GOOGLE_APP_ID": "1:943188299704:ios:bd6866b329aebb64a9c94d", + "FIREBASE_PROJECT_ID": "daflmusic-b3b74", + "GCM_SENDER_ID": "943188299704" +} \ No newline at end of file diff --git a/Sources/dafl_project_flutter/lib/firebase_options.dart b/Sources/dafl_project_flutter/lib/firebase_options.dart new file mode 100644 index 0000000..d53643c --- /dev/null +++ b/Sources/dafl_project_flutter/lib/firebase_options.dart @@ -0,0 +1,69 @@ +// File generated by FlutterFire CLI. +// ignore_for_file: lines_longer_than_80_chars, avoid_classes_with_only_static_members +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: 'AIzaSyBehHyqsXbBm1I7fBSG2bPOQvpDX-8Rm7I', + appId: '1:943188299704:android:995199bd5229a330a9c94d', + messagingSenderId: '943188299704', + projectId: 'daflmusic-b3b74', + storageBucket: 'daflmusic-b3b74.appspot.com', + ); + + static const FirebaseOptions ios = FirebaseOptions( + apiKey: 'AIzaSyCnQnCeu7gdc1_uIOxXVNQT1pG8xjD_tB8', + appId: '1:943188299704:ios:bd6866b329aebb64a9c94d', + messagingSenderId: '943188299704', + projectId: 'daflmusic-b3b74', + storageBucket: 'daflmusic-b3b74.appspot.com', + iosClientId: '943188299704-h4035qno57lll2km151rdh3bgbb22vk7.apps.googleusercontent.com', + iosBundleId: 'com.example.daflProjectFlutter', + ); +} diff --git a/Sources/dafl_project_flutter/lib/model/user.dart b/Sources/dafl_project_flutter/lib/model/user.dart index c8f73ce..e91ffba 100644 --- a/Sources/dafl_project_flutter/lib/model/user.dart +++ b/Sources/dafl_project_flutter/lib/model/user.dart @@ -1,5 +1,5 @@ import 'dart:async'; -import '../../../position/location.dart'; +import '../position/location.dart'; import '../exceptions/api_exception.dart'; import '../main.dart'; import 'music.dart'; diff --git a/Sources/dafl_project_flutter/pubspec.lock b/Sources/dafl_project_flutter/pubspec.lock index 0662299..463407f 100644 --- a/Sources/dafl_project_flutter/pubspec.lock +++ b/Sources/dafl_project_flutter/pubspec.lock @@ -127,6 +127,27 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "6.1.4" + firebase_core: + dependency: "direct main" + description: + name: firebase_core + url: "https://pub.dartlang.org" + source: hosted + version: "2.3.0" + firebase_core_platform_interface: + dependency: transitive + description: + name: firebase_core_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "4.5.2" + firebase_core_web: + dependency: transitive + description: + name: firebase_core_web + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" flutter: dependency: "direct main" description: flutter diff --git a/Sources/dafl_project_flutter/pubspec.yaml b/Sources/dafl_project_flutter/pubspec.yaml index 96ede70..b11d39c 100644 --- a/Sources/dafl_project_flutter/pubspec.yaml +++ b/Sources/dafl_project_flutter/pubspec.yaml @@ -29,6 +29,7 @@ dependencies: home_indicator: ^2.0.2 geolocator: ^9.0.2 flutter_styled_toast: ^2.1.3 + firebase_core: ^2.3.0 dev_dependencies: flutter_test: