Skip to content

Commit 2ce713d

Browse files
authored
Update Firebase dependencies (#199)
1 parent a7a79e7 commit 2ce713d

15 files changed

+216
-200
lines changed

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@
44
/android/fastlane/service-account.json filter=git-crypt diff=git-crypt
55
/android/release.jks filter=git-crypt diff=git-crypt
66
/ios/Runner/GoogleService-Info.plist filter=git-crypt diff=git-crypt
7+
/ios/firebase_app_id_file.json filter=git-crypt diff=git-crypt
78
/ios/gc_keys.json filter=git-crypt diff=git-crypt
9+
/lib/firebase_options.dart filter=git-crypt diff=git-crypt
810
/macos/Runner/GoogleService-Info.plist filter=git-crypt diff=git-crypt
911
/macos/fastlane/4TV2PTBPVG.json filter=git-crypt diff=git-crypt
12+
/macos/firebase_app_id_file.json filter=git-crypt diff=git-crypt
1013
/macos/gc_keys.json filter=git-crypt diff=git-crypt
1114
/windows/ca.crt filter=git-crypt diff=git-crypt
1215
/windows/certificate.pfx filter=git-crypt diff=git-crypt

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ Pick a unique package name across Play Store and App Store then update these fil
9090
- `macos/fastlane/Matchfile`
9191
- `windows/runner/Runner.rc`
9292
- `pubspec.yaml` msix_config>identity_name
93+
- Re-run `flutterfire configure` to update Firebase apps
9394

9495
You will also need to move the files within `android/app/src/main/java/com/daohoangson/flutter_ttdemo` to another directory to match the new Android package.
9596

android/app/google-services.json

-47 Bytes
Binary file not shown.

ios/Podfile.lock

Lines changed: 63 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -15,58 +15,63 @@ PODS:
1515
- FBSDKCoreKit_Basics (16.1.3)
1616
- FBSDKLoginKit (16.1.3):
1717
- FBSDKCoreKit (= 16.1.3)
18-
- Firebase/CoreOnly (9.6.0):
19-
- FirebaseCore (= 9.6.0)
20-
- Firebase/Crashlytics (9.6.0):
18+
- Firebase/CoreOnly (10.12.0):
19+
- FirebaseCore (= 10.12.0)
20+
- Firebase/Crashlytics (10.12.0):
2121
- Firebase/CoreOnly
22-
- FirebaseCrashlytics (~> 9.6.0)
23-
- Firebase/Messaging (9.6.0):
22+
- FirebaseCrashlytics (~> 10.12.0)
23+
- Firebase/Messaging (10.12.0):
2424
- Firebase/CoreOnly
25-
- FirebaseMessaging (~> 9.6.0)
26-
- firebase_core (1.24.0):
27-
- Firebase/CoreOnly (= 9.6.0)
25+
- FirebaseMessaging (~> 10.12.0)
26+
- firebase_core (2.15.0):
27+
- Firebase/CoreOnly (= 10.12.0)
2828
- Flutter
29-
- firebase_crashlytics (2.9.0):
30-
- Firebase/Crashlytics (= 9.6.0)
29+
- firebase_crashlytics (3.3.4):
30+
- Firebase/Crashlytics (= 10.12.0)
3131
- firebase_core
3232
- Flutter
33-
- firebase_messaging (13.1.0):
34-
- Firebase/Messaging (= 9.6.0)
33+
- firebase_messaging (14.6.5):
34+
- Firebase/Messaging (= 10.12.0)
3535
- firebase_core
3636
- Flutter
37-
- FirebaseCore (9.6.0):
38-
- FirebaseCoreDiagnostics (~> 9.0)
39-
- FirebaseCoreInternal (~> 9.0)
40-
- GoogleUtilities/Environment (~> 7.7)
41-
- GoogleUtilities/Logger (~> 7.7)
42-
- FirebaseCoreDiagnostics (9.6.0):
43-
- GoogleDataTransport (< 10.0.0, >= 9.1.4)
44-
- GoogleUtilities/Environment (~> 7.7)
45-
- GoogleUtilities/Logger (~> 7.7)
46-
- nanopb (< 2.30910.0, >= 2.30908.0)
47-
- FirebaseCoreInternal (9.6.0):
48-
- "GoogleUtilities/NSData+zlib (~> 7.7)"
49-
- FirebaseCrashlytics (9.6.0):
50-
- FirebaseCore (~> 9.0)
51-
- FirebaseInstallations (~> 9.0)
52-
- GoogleDataTransport (< 10.0.0, >= 9.1.4)
53-
- GoogleUtilities/Environment (~> 7.7)
37+
- FirebaseCore (10.12.0):
38+
- FirebaseCoreInternal (~> 10.0)
39+
- GoogleUtilities/Environment (~> 7.8)
40+
- GoogleUtilities/Logger (~> 7.8)
41+
- FirebaseCoreExtension (10.13.0):
42+
- FirebaseCore (~> 10.0)
43+
- FirebaseCoreInternal (10.13.0):
44+
- "GoogleUtilities/NSData+zlib (~> 7.8)"
45+
- FirebaseCrashlytics (10.12.0):
46+
- FirebaseCore (~> 10.5)
47+
- FirebaseInstallations (~> 10.0)
48+
- FirebaseSessions (~> 10.5)
49+
- GoogleDataTransport (~> 9.2)
50+
- GoogleUtilities/Environment (~> 7.8)
5451
- nanopb (< 2.30910.0, >= 2.30908.0)
5552
- PromisesObjC (~> 2.1)
56-
- FirebaseInstallations (9.6.0):
57-
- FirebaseCore (~> 9.0)
58-
- GoogleUtilities/Environment (~> 7.7)
59-
- GoogleUtilities/UserDefaults (~> 7.7)
53+
- FirebaseInstallations (10.13.0):
54+
- FirebaseCore (~> 10.0)
55+
- GoogleUtilities/Environment (~> 7.8)
56+
- GoogleUtilities/UserDefaults (~> 7.8)
6057
- PromisesObjC (~> 2.1)
61-
- FirebaseMessaging (9.6.0):
62-
- FirebaseCore (~> 9.0)
63-
- FirebaseInstallations (~> 9.0)
64-
- GoogleDataTransport (< 10.0.0, >= 9.1.4)
65-
- GoogleUtilities/AppDelegateSwizzler (~> 7.7)
66-
- GoogleUtilities/Environment (~> 7.7)
67-
- GoogleUtilities/Reachability (~> 7.7)
68-
- GoogleUtilities/UserDefaults (~> 7.7)
58+
- FirebaseMessaging (10.12.0):
59+
- FirebaseCore (~> 10.0)
60+
- FirebaseInstallations (~> 10.0)
61+
- GoogleDataTransport (~> 9.2)
62+
- GoogleUtilities/AppDelegateSwizzler (~> 7.8)
63+
- GoogleUtilities/Environment (~> 7.8)
64+
- GoogleUtilities/Reachability (~> 7.8)
65+
- GoogleUtilities/UserDefaults (~> 7.8)
66+
- nanopb (< 2.30910.0, >= 2.30908.0)
67+
- FirebaseSessions (10.13.0):
68+
- FirebaseCore (~> 10.5)
69+
- FirebaseCoreExtension (~> 10.0)
70+
- FirebaseInstallations (~> 10.0)
71+
- GoogleDataTransport (~> 9.2)
72+
- GoogleUtilities/Environment (~> 7.10)
6973
- nanopb (< 2.30910.0, >= 2.30908.0)
74+
- PromisesSwift (~> 2.1)
7075
- Flutter (1.0.0)
7176
- flutter_facebook_auth (6.0.1):
7277
- FBSDKLoginKit (~> 16.1.3)
@@ -123,6 +128,8 @@ PODS:
123128
- Flutter
124129
- FlutterMacOS
125130
- PromisesObjC (2.3.1)
131+
- PromisesSwift (2.3.1):
132+
- PromisesObjC (= 2.3.1)
126133
- share_plus (0.0.1):
127134
- Flutter
128135
- shared_preferences_foundation (0.0.1):
@@ -176,11 +183,12 @@ SPEC REPOS:
176183
- FBSDKLoginKit
177184
- Firebase
178185
- FirebaseCore
179-
- FirebaseCoreDiagnostics
186+
- FirebaseCoreExtension
180187
- FirebaseCoreInternal
181188
- FirebaseCrashlytics
182189
- FirebaseInstallations
183190
- FirebaseMessaging
191+
- FirebaseSessions
184192
- FMDB
185193
- GoogleDataTransport
186194
- GoogleSignIn
@@ -189,6 +197,7 @@ SPEC REPOS:
189197
- GTMSessionFetcher
190198
- nanopb
191199
- PromisesObjC
200+
- PromisesSwift
192201

193202
EXTERNAL SOURCES:
194203
audio_session:
@@ -241,16 +250,17 @@ SPEC CHECKSUMS:
241250
FBSDKCoreKit: 19e2e18b3be578d7a51fed8fdd8c152bef0b9511
242251
FBSDKCoreKit_Basics: dd9826ce3c9fd9f8cdf8dbbd0ef0a53e6c0c9e7e
243252
FBSDKLoginKit: c395c63a1a6cf4a8a1e6103fd94b8c46329ee81c
244-
Firebase: 5ae8b7cf8efce559a653aef0ad95bab3f427c351
245-
firebase_core: 7c28ecc1e5dd74e03829ac3e9ff5ba3314e737a9
246-
firebase_crashlytics: 520a59314eaaadb34f9be4c2a285d99cfa88ebdb
247-
firebase_messaging: a2a8c6db6d799c7f59b1c0d7c68a2f0027bfa2c4
248-
FirebaseCore: 2082fffcd855f95f883c0a1641133eb9bbe76d40
249-
FirebaseCoreDiagnostics: 99a495094b10a57eeb3ae8efa1665700ad0bdaa6
250-
FirebaseCoreInternal: bca76517fe1ed381e989f5e7d8abb0da8d85bed3
251-
FirebaseCrashlytics: 3210572ddb77801e5a0bd9d7bc890769f2066a0c
252-
FirebaseInstallations: 0a115432c4e223c5ab20b0dbbe4cbefa793a0e8e
253-
FirebaseMessaging: a4d7910e4af663c9cbfc1071c5bef34651690949
253+
Firebase: 07150e75d142fb9399f6777fa56a187b17f833a0
254+
firebase_core: e477125798fc37cd4ab43ca6a8536bf7e0929c00
255+
firebase_crashlytics: 6043ce85800f96e53f15ee5051f9cfad10cce73d
256+
firebase_messaging: 334d68c3a36b6d4d5cd91e4f42509e0d4ae49828
257+
FirebaseCore: f86a1394906b97ac445ae49c92552a9425831bed
258+
FirebaseCoreExtension: ce60f9db46d83944cf444664d6d587474128eeca
259+
FirebaseCoreInternal: b342e37cd4f5b4454ec34308f073420e7920858e
260+
FirebaseCrashlytics: c4d111b7430c49744c74bcc6346ea00868661ac8
261+
FirebaseInstallations: b28af1b9f997f1a799efe818c94695a3728c352f
262+
FirebaseMessaging: bb2c4f6422a753038fe137d90ae7c1af57251316
263+
FirebaseSessions: 991fb4c20b3505eef125f7cbfa20a5b5b189c2a4
254264
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
255265
flutter_facebook_auth: 47c7a8594f2d6864618e30b5a6d59dff0d2e59fe
256266
flutter_secure_storage: 23fc622d89d073675f2eaa109381aefbcf5a49be
@@ -267,6 +277,7 @@ SPEC CHECKSUMS:
267277
package_info_plus: fd030dabf36271f146f1f3beacd48f564b0f17f7
268278
path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943
269279
PromisesObjC: c50d2056b5253dadbd6c2bea79b0674bd5a52fa4
280+
PromisesSwift: 28dca69a9c40779916ac2d6985a0192a5cb4a265
270281
share_plus: 599aa54e4ea31d4b4c0e9c911bcc26c55e791028
271282
shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126
272283
sqflite: 31f7eba61e3074736dff8807a9b41581e4f7f15a
-196 Bytes
Binary file not shown.

ios/firebase_app_id_file.json

283 Bytes
Binary file not shown.

lib/firebase_options.dart

3.08 KB
Binary file not shown.

lib/main.dart

Lines changed: 37 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -23,41 +23,47 @@ void main() async {
2323

2424
WidgetsFlutterBinding.ensureInitialized();
2525
await firebase.initializeApp();
26+
error_reporting.configureErrorReporting();
2627
push_notification.configurePushNotification();
2728

28-
error_reporting.runZoned<Future<void>>(() async {
29-
final values = await Future.wait([
30-
DarkTheme.create(),
31-
FontScale.create(),
32-
push_notification.getInitialPath(),
33-
uni_links.getInitialLink(),
34-
DevTools.create(),
35-
]);
29+
DarkTheme? darkTheme;
30+
DevTools? devTools;
31+
FontScale? fontScale;
32+
String? initialLink;
33+
String? initialPath;
34+
await Future.wait([
35+
DarkTheme.create().then((value) => darkTheme = value),
36+
FontScale.create().then((value) => fontScale = value),
37+
DevTools.create().then((value) => devTools = value),
38+
uni_links.getInitialLink().then((value) => initialLink = value),
39+
firebase.initializeApp().then((value) async {
40+
error_reporting.configureErrorReporting();
41+
push_notification.configurePushNotification();
42+
initialPath = await push_notification.getInitialPath();
43+
}),
44+
]);
3645

37-
String? initialPath;
38-
Widget? defaultWidget;
39-
String? fallbackLink;
40-
if (values[2] != null) {
41-
initialPath = values[2] as String?;
42-
defaultWidget = const NotificationListScreen();
43-
} else if (values[3] != null) {
44-
initialPath = buildToolsParseLinkPath(values[3] as String);
45-
fallbackLink = values[3] as String?;
46-
}
46+
Widget? defaultWidget;
47+
String? fallbackLink;
48+
if (initialPath != null) {
49+
defaultWidget = const NotificationListScreen();
50+
} else if (initialLink != null) {
51+
initialPath = buildToolsParseLinkPath(initialLink!);
52+
fallbackLink = initialLink;
53+
}
4754

48-
runApp(MyApp(
49-
darkTheme: values[0] as DarkTheme,
50-
devTools: values[4] as DevTools,
51-
fontScale: values[1] as FontScale,
52-
home: initialPath != null
53-
? InitialPathScreen(
54-
initialPath,
55-
defaultWidget: defaultWidget,
56-
fallbackLink: fallbackLink,
57-
)
58-
: HomeScreen(),
59-
));
60-
});
55+
runApp(MyApp(
56+
darkTheme: darkTheme!,
57+
devTools: devTools!,
58+
fontScale: fontScale!,
59+
home: initialPath != null
60+
? InitialPathScreen(
61+
initialPath!,
62+
defaultWidget: defaultWidget,
63+
fallbackLink: fallbackLink,
64+
)
65+
: HomeScreen(),
66+
));
6167
}
6268

6369
class MyApp extends StatelessWidget {

lib/src/abstracts/error_reporting.dart

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import 'dart:async';
2-
31
import 'package:firebase_crashlytics/firebase_crashlytics.dart';
42
import 'package:flutter/foundation.dart';
53

@@ -8,19 +6,18 @@ import 'firebase.dart' as firebase;
86
final backend =
97
firebase.isSupported ? Backend.firebaseCrashlytics : Backend.none;
108

11-
void crash() => FirebaseCrashlytics.instance.crash();
9+
void configureErrorReporting() {
10+
if (backend == Backend.none) return;
1211

13-
// ignore: missing_return
14-
R? runZoned<R>(R Function() body) {
15-
switch (backend) {
16-
case Backend.firebaseCrashlytics:
17-
FlutterError.onError = FirebaseCrashlytics.instance.recordFlutterError;
18-
return runZonedGuarded(body, FirebaseCrashlytics.instance.recordError);
19-
case Backend.none:
20-
return body();
21-
}
12+
FlutterError.onError = FirebaseCrashlytics.instance.recordFlutterFatalError;
13+
PlatformDispatcher.instance.onError = (error, stack) {
14+
FirebaseCrashlytics.instance.recordError(error, stack, fatal: true);
15+
return true;
16+
};
2217
}
2318

19+
void crash() => FirebaseCrashlytics.instance.crash();
20+
2421
enum Backend {
2522
firebaseCrashlytics,
2623
none,

lib/src/abstracts/firebase.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
import 'dart:io';
22

33
import 'package:firebase_core/firebase_core.dart';
4+
import 'package:the_app/firebase_options.dart';
45

56
final isSupported = Platform.isAndroid || Platform.isIOS || Platform.isMacOS;
67

78
Future<void> initializeApp() async {
89
if (!isSupported) return;
910

10-
await Firebase.initializeApp();
11+
await Firebase.initializeApp(
12+
options: DefaultFirebaseOptions.currentPlatform,
13+
);
1114
}

0 commit comments

Comments
 (0)