Skip to content

Commit 54e08d1

Browse files
committed
fix: Set a non-null apiKey for demo projects in Dart
On Android the underlying Java SDK will throw an exception if the api key is empty. Setting it to any arbitrary value is sufficient.
1 parent e8fbff7 commit 54e08d1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/firebase_core/firebase_core/lib/src/firebase.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class Firebase {
6868
// for backwards compatibility and simply override the user-provided
6969
// options.
7070
options = FirebaseOptions(
71-
apiKey: '',
71+
apiKey: '12345',
7272
appId: '1:1:$platformString:1',
7373
messagingSenderId: '',
7474
projectId: demoProjectId,

packages/firebase_core/firebase_core/test/firebase_core_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ void main() {
7070
const String demoProjectId = 'demo-project-id';
7171
const String expectedName = demoProjectId;
7272
const FirebaseOptions expectedOptions = FirebaseOptions(
73-
apiKey: '',
73+
apiKey: '12345',
7474
// Flutter tests use android as the default platform.
7575
appId: '1:1:android:1',
7676
messagingSenderId: '',

0 commit comments

Comments
 (0)