diff --git a/packages/firebase_core/firebase_core/example/android/app/google-services.json b/packages/firebase_core/firebase_core/example/android/app/google-services.json deleted file mode 100644 index 7f7e074c2429..000000000000 --- a/packages/firebase_core/firebase_core/example/android/app/google-services.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "project_info": { - "project_number": "159623150305", - "firebase_url": "https://flutter-firebase-plugins.firebaseio.com", - "project_id": "flutter-firebase-plugins", - "storage_bucket": "flutter-firebase-plugins.appspot.com" - }, - "client": [ - { - "client_info": { - "mobilesdk_app_id": "1:159623150305:android:236f9daea101f77e", - "android_client_info": { - "package_name": "io.flutter.plugins.firebasecoreexample" - } - }, - "oauth_client": [ - { - "client_id": "159623150305-q05bbbtsutr02abhips3suj7hujfk4bg.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyChk3KEG7QYrs4kQPLP1tjJNxBTbfCAdgg" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 1, - "other_platform_oauth_client": [] - }, - "ads_service": { - "status": 2 - } - } - } - ], - "configuration_version": "1" -} diff --git a/packages/firebase_core/firebase_core/example/test_driver/config.dart b/packages/firebase_core/firebase_core/example/test_driver/config.dart new file mode 100644 index 000000000000..aab6a0093f03 --- /dev/null +++ b/packages/firebase_core/firebase_core/example/test_driver/config.dart @@ -0,0 +1,35 @@ +import 'dart:io'; + +import 'package:firebase_core/firebase_core.dart'; +import 'package:flutter/foundation.dart'; + +class TestFirebaseConfig { + static FirebaseOptions get platformOptions { + if (kIsWeb) { + // Web + return const FirebaseOptions( + appId: '1:448618578101:web:0b650370bb29e29cac3efc', + apiKey: 'AIzaSyAgUhHU8wSJgO5MVNy95tMT07NEjzMOfz0', + projectId: 'react-native-firebase-testing', + messagingSenderId: '448618578101', + ); + } else if (Platform.isIOS || Platform.isMacOS) { + // iOS and MacOS + return const FirebaseOptions( + appId: '1:448618578101:ios:0b650370bb29e29cac3efc', + apiKey: 'AIzaSyAgUhHU8wSJgO5MVNy95tMT07NEjzMOfz0', + projectId: 'react-native-firebase-testing', + messagingSenderId: '448618578101', + iosBundleId: 'io.flutter.plugins.firebasecoreexample', + ); + } else { + // Android + return const FirebaseOptions( + appId: '1:448618578101:android:0446912d5f1476b6ac3efc', + apiKey: 'AIzaSyCuu4tbv9CwwTudNOweMNstzZHIDBhgJxA', + projectId: 'react-native-firebase-testing', + messagingSenderId: '448618578101', + ); + } + } +} diff --git a/packages/firebase_core/firebase_core/example/test_driver/firebase_core_e2e.dart b/packages/firebase_core/firebase_core/example/test_driver/firebase_core_e2e.dart index e2b299d767fb..0941f64f6cd8 100644 --- a/packages/firebase_core/firebase_core/example/test_driver/firebase_core_e2e.dart +++ b/packages/firebase_core/firebase_core/example/test_driver/firebase_core_e2e.dart @@ -2,36 +2,19 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'package:flutter/foundation.dart' show kIsWeb; - import 'package:firebase_core/firebase_core.dart'; import 'package:firebase_core_platform_interface/firebase_core_platform_interface.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:drive/drive.dart' as drive; +import 'config.dart'; + void main() => drive.main(testsMain); void testsMain() { String testAppName = 'TestApp'; - FirebaseOptions? testAppOptions; - - if (kIsWeb) { - testAppOptions = const FirebaseOptions( - appId: '1:448618578101:web:0b650370bb29e29cac3efc', - apiKey: 'AIzaSyAgUhHU8wSJgO5MVNy95tMT07NEjzMOfz0', - projectId: 'react-native-firebase-testing', - messagingSenderId: '448618578101', - ); - } else { - testAppOptions = const FirebaseOptions( - appId: '1:448618578101:ios:0b650370bb29e29cac3efc', - apiKey: 'AIzaSyAgUhHU8wSJgO5MVNy95tMT07NEjzMOfz0', - projectId: 'react-native-firebase-testing', - messagingSenderId: '448618578101', - iosBundleId: 'io.flutter.plugins.firebasecoreexample', - ); - } + FirebaseOptions? testAppOptions = TestFirebaseConfig.platformOptions; setUpAll(() async { await Firebase.initializeApp(name: testAppName, options: testAppOptions);