Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions packages/firebase_core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 0.2.0

* Update firebase_core to 4.14.0.
* Update firebase_core_platform_interface to 8.1.1.
* Update minimum Flutter and Dart version to 3.27 and 3.6.
* Sync the example and integration test.
* Fix `androidClientId`, `iosClientId`, and `iosBundleId` being dropped from app options.

## 0.1.3

* Add an `implements` entry to the pubspec to improve discoverability on pub.dev.
Expand Down
4 changes: 2 additions & 2 deletions packages/firebase_core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ This package is not an _endorsed_ implementation of `firebase_core`. Therefore,

```yaml
dependencies:
firebase_core: ^2.4.0
firebase_core_tizen: ^0.1.3
firebase_core: ^4.14.0
firebase_core_tizen: ^0.2.0
```

Then you can import `firebase_core` in your Dart code:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Integration tests ported from upstream firebase_core v2.17.0:
// https://github.com/firebase/flutterfire/blob/firebase_core-v2.17.0/tests/integration_test/firebase_core/firebase_core_e2e_test.dart
// Integration tests ported from upstream firebase_core v4.14.0:
// https://github.com/firebase/flutterfire/blob/firebase_core-v4.14.0/tests/integration_test/firebase_core/firebase_core_e2e_test.dart
// Originally authored by the Chromium project authors under a BSD-style
// license.

Expand Down Expand Up @@ -80,7 +80,11 @@ void main() {
test('FirebaseApp.setAutomaticResourceManagementEnabled()', () async {
final FirebaseApp app = Firebase.app();

await app.setAutomaticResourceManagementEnabled(true);
try {
await app.setAutomaticResourceManagementEnabled(true);
} finally {
await app.setAutomaticResourceManagementEnabled(false);
}
});
});
}
25 changes: 9 additions & 16 deletions packages/firebase_core/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
// ignore_for_file: public_member_api_docs, avoid_print

import 'dart:async';
import 'dart:developer';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';

Expand All @@ -18,42 +17,36 @@ class MyApp extends StatelessWidget {

String get name => 'foo';

FirebaseOptions get firebaseOptions => DefaultFirebaseOptions.currentPlatform;

Future<void> initializeDefault() async {
final FirebaseApp app = await Firebase.initializeApp(
options: firebaseOptions,
options: DefaultFirebaseOptions.currentPlatform,
);
log('Initialized default app $app');
print('Initialized default app $app');
}

Future<void> initializeSecondary() async {
final FirebaseApp app = await Firebase.initializeApp(
name: name,
options: firebaseOptions,
options: DefaultFirebaseOptions.currentPlatform,
);

log('Initialized $app');
print('Initialized $app');
}

void apps() {
log('Currently initialized apps: ${Firebase.apps}');
print('Currently initialized apps: ${Firebase.apps}');
final List<FirebaseApp> apps = Firebase.apps;
print('Currently initialized apps: $apps');
}

void options() {
final FirebaseApp app = Firebase.app(name);
final FirebaseApp app = Firebase.app();
final FirebaseOptions options = app.options;
log('Current options for app $name: $options');
print('Current options for app $name: $options');
print('Current options for app ${app.name}: $options');
}

Future<void> delete() async {
final FirebaseApp app = Firebase.app(name);
await app.delete();
log('App $name deleted');
print('App $name deleted');
}

Expand All @@ -76,14 +69,14 @@ class MyApp extends StatelessWidget {
onPressed: initializeSecondary,
child: const Text('Initialize secondary app'),
),
ElevatedButton(onPressed: apps, child: const Text('Get apps')),
ElevatedButton(onPressed: apps, child: const Text('List apps')),
ElevatedButton(
onPressed: options,
child: const Text('List options'),
child: const Text('List default options'),
),
ElevatedButton(
onPressed: delete,
child: const Text('Delete app'),
child: const Text('Delete secondary app'),
),
],
),
Expand Down
8 changes: 4 additions & 4 deletions packages/firebase_core/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ description: An example application demonstrating calls to Firebase Core.
publish_to: "none"

environment:
sdk: ">=3.1.0 <4.0.0"
flutter: ">=3.13.0"
sdk: ^3.6.0
flutter: ">=3.27.0"

dependencies:
firebase_core: ^2.4.0
firebase_core: ^4.14.0
firebase_core_tizen:
path: ../
flutter:
sdk: flutter

dev_dependencies:
firebase_core_platform_interface: ^4.5.2
firebase_core_platform_interface: ^8.1.1
flutter_driver:
sdk: flutter
flutter_test:
Expand Down
2 changes: 1 addition & 1 deletion packages/firebase_core/lib/firebase_app_tizen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class FirebaseApp extends FirebaseAppPlatform {
}

/// Sets whether automatic resource management is enabled or disabled.
/// This has no affect on Da.
/// This has no effect on Dart.
@override
Future<void> setAutomaticResourceManagementEnabled(bool enabled) {
return Future<void>.value();
Expand Down
11 changes: 7 additions & 4 deletions packages/firebase_core/lib/firebase_core_tizen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class FirebaseCore extends FirebasePlatform {
FirebasePlatform.instance = FirebaseCore();
}

FirebaseApp _mapDartToPlatfromApp(core_dart.FirebaseApp app) {
FirebaseApp _mapDartToPlatformApp(core_dart.FirebaseApp app) {
final core_dart.FirebaseOptions options = app.options;

return FirebaseApp._(
Expand All @@ -33,14 +33,17 @@ class FirebaseCore extends FirebasePlatform {
trackingId: options.trackingId,
appGroupId: options.appGroupId,
deepLinkURLScheme: options.deepLinkURLScheme,
androidClientId: options.androidClientId,
iosClientId: options.iosClientId,
iosBundleId: options.iosBundleId,
),
);
}

@override
List<FirebaseApp> get apps {
return core_dart.Firebase.apps
.map(_mapDartToPlatfromApp)
.map(_mapDartToPlatformApp)
.toList(growable: false);
}

Expand All @@ -66,7 +69,7 @@ class FirebaseCore extends FirebasePlatform {
await core_dart.Firebase.initializeApp(
name: name, options: dartOptions);

return _mapDartToPlatfromApp(dartApp);
return _mapDartToPlatformApp(dartApp);
} on core_dart.FirebaseException catch (e) {
switch (e.code) {
case 'no-app':
Expand All @@ -85,7 +88,7 @@ class FirebaseCore extends FirebasePlatform {
@override
FirebaseApp app([String name = defaultFirebaseAppName]) {
try {
return _mapDartToPlatfromApp(core_dart.Firebase.app(name));
return _mapDartToPlatformApp(core_dart.Firebase.app(name));
} catch (_) {
throw noAppExists(name);
}
Expand Down
8 changes: 4 additions & 4 deletions packages/firebase_core/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ name: firebase_core_tizen
description: Tizen implementation of the firebase_core plugin.
homepage: https://github.com/flutter-tizen/plugins
repository: https://github.com/flutter-tizen/plugins/tree/main/packages/firebase_core
version: 0.1.3
version: 0.2.0

environment:
sdk: ">=3.1.0 <4.0.0"
flutter: ">=3.13.0"
sdk: ^3.6.0
flutter: ">=3.27.0"

dependencies:
firebase_core_dart: ^1.0.1
firebase_core_platform_interface: ^4.5.2
firebase_core_platform_interface: ^8.1.1
flutter:
sdk: flutter

Expand Down
Loading