Skip to content

Commit

Permalink
Merge PR #14 from AdarshRawat1/Dev-Refactor-Configurations [Major] Co…
Browse files Browse the repository at this point in the history
…nfigure Firebase Crashlytics

[Major] Configure Firebase Crashlytics
  • Loading branch information
AdarshRawat1 authored Apr 24, 2024
2 parents c7c192e + bb93e26 commit 0719aec
Show file tree
Hide file tree
Showing 10 changed files with 139 additions and 3 deletions.
34 changes: 34 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,37 @@ node_modules/

# Ignoring API keys used in Development
aid_employ/android/app/src/main/AndroidManifest.xml

# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
migrate_working_dir/

# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
/build/

# Symbolication related
app.*.symbols

# Obfuscation related
app.*.map.json

# Android Studio will place build artifacts here
/android/app/debug
/android/app/profile
/android/app/release
3 changes: 3 additions & 0 deletions aid_employ/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## NOTE : Kept here in case anyone wants to keep just the flutter
## App directory without keeping all the other files

# Miscellaneous
*.class
*.log
Expand Down
1 change: 1 addition & 0 deletions aid_employ/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ if (flutterVersionName == null) {
apply plugin: 'com.android.application'
// START: FlutterFire Configuration
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
// END: FlutterFire Configuration
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
Expand Down
30 changes: 28 additions & 2 deletions aid_employ/android/app/google-services.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"project_info": {
"project_number": "674741129487",
"firebase_url": "https://soln-no-poverty-default-rtdb.firebaseio.com",
"project_id": "soln-no-poverty",
"storage_bucket": "soln-no-poverty.appspot.com"
},
Expand All @@ -12,15 +13,40 @@
"package_name": "com.example.aid_employ"
}
},
"oauth_client": [],
"oauth_client": [
{
"client_id": "674741129487-6eme2787fsqrhjclqs7d8nr1legn605e.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.example.aid_employ",
"certificate_hash": "44c08d8c3d262ccba519a90bf3555cf4713be50c"
}
},
{
"client_id": "674741129487-hg2k0d7lsjtkfhp5jpbubk7v6rg9he56.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyBBlTJYrAlcoxcwCw8YvkpPRLsXma2wRW4"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": []
"other_platform_oauth_client": [
{
"client_id": "674741129487-hg2k0d7lsjtkfhp5jpbubk7v6rg9he56.apps.googleusercontent.com",
"client_type": 3
},
{
"client_id": "674741129487-8o5bifin0e820i4lfgeof6u49s4r38te.apps.googleusercontent.com",
"client_type": 2,
"ios_info": {
"bundle_id": "com.example.redditTutorial"
}
}
]
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions aid_employ/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ buildscript {
classpath 'com.android.tools.build:gradle:7.1.2'
// START: FlutterFire Configuration
classpath 'com.google.gms:google-services:4.3.10'

classpath 'com.google.firebase:firebase-crashlytics-gradle:2.8.1'
// END: FlutterFire Configuration
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
Expand Down
8 changes: 8 additions & 0 deletions aid_employ/lib/firebase_options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class DefaultFirebaseOptions {
messagingSenderId: '674741129487',
projectId: 'soln-no-poverty',
authDomain: 'soln-no-poverty.firebaseapp.com',
databaseURL: 'https://soln-no-poverty-default-rtdb.firebaseio.com',
storageBucket: 'soln-no-poverty.appspot.com',
measurementId: 'G-D0WME24WNC',
);
Expand All @@ -58,6 +59,7 @@ class DefaultFirebaseOptions {
appId: '1:674741129487:android:422141e9320e14d4336e7a',
messagingSenderId: '674741129487',
projectId: 'soln-no-poverty',
databaseURL: 'https://soln-no-poverty-default-rtdb.firebaseio.com',
storageBucket: 'soln-no-poverty.appspot.com',
);

Expand All @@ -66,7 +68,10 @@ class DefaultFirebaseOptions {
appId: '1:674741129487:ios:2ba3d61dd3200aef336e7a',
messagingSenderId: '674741129487',
projectId: 'soln-no-poverty',
databaseURL: 'https://soln-no-poverty-default-rtdb.firebaseio.com',
storageBucket: 'soln-no-poverty.appspot.com',
androidClientId: '674741129487-6eme2787fsqrhjclqs7d8nr1legn605e.apps.googleusercontent.com',
iosClientId: '674741129487-8o5bifin0e820i4lfgeof6u49s4r38te.apps.googleusercontent.com',
iosBundleId: 'com.example.redditTutorial',
);

Expand All @@ -75,7 +80,10 @@ class DefaultFirebaseOptions {
appId: '1:674741129487:ios:2ba3d61dd3200aef336e7a',
messagingSenderId: '674741129487',
projectId: 'soln-no-poverty',
databaseURL: 'https://soln-no-poverty-default-rtdb.firebaseio.com',
storageBucket: 'soln-no-poverty.appspot.com',
androidClientId: '674741129487-6eme2787fsqrhjclqs7d8nr1legn605e.apps.googleusercontent.com',
iosClientId: '674741129487-8o5bifin0e820i4lfgeof6u49s4r38te.apps.googleusercontent.com',
iosBundleId: 'com.example.redditTutorial',
);
}
16 changes: 16 additions & 0 deletions aid_employ/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'dart:ui';

import 'package:firebase_auth/firebase_auth.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
Expand All @@ -10,12 +12,26 @@ import 'package:aid_employ/models/user_model.dart';
import 'package:aid_employ/router.dart';
import 'package:aid_employ/theme/pallete.dart';
import 'package:routemaster/routemaster.dart';
import 'package:firebase_crashlytics/firebase_crashlytics.dart';

void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
);
// Pass all uncaught "fatal" errors from the framework to Crashlytics
FlutterError.onError = FirebaseCrashlytics.instance.recordFlutterFatalError;

// Pass all uncaught errors from the framework to Crashlytics
FlutterError.onError = (errorDetails) {
FirebaseCrashlytics.instance.recordFlutterFatalError(errorDetails);
};
// Pass all uncaught asynchronous errors that aren't handled by the Flutter framework to Crashlytics
PlatformDispatcher.instance.onError = (error, stack) {
FirebaseCrashlytics.instance.recordError(error, stack, fatal: true);
return true;
};

runApp(
const ProviderScope(
child: MyApp(),
Expand Down
4 changes: 4 additions & 0 deletions aid_employ/macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ import FlutterMacOS
import Foundation

import cloud_firestore
import firebase_analytics
import firebase_auth
import firebase_core
import firebase_crashlytics
import firebase_storage
import google_sign_in_ios
import location
Expand All @@ -16,8 +18,10 @@ import url_launcher_macos

func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
FLTFirebaseFirestorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseFirestorePlugin"))
FLTFirebaseAnalyticsPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAnalyticsPlugin"))
FLTFirebaseAuthPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAuthPlugin"))
FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin"))
FLTFirebaseCrashlyticsPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCrashlyticsPlugin"))
FLTFirebaseStoragePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseStoragePlugin"))
FLTGoogleSignInPlugin.register(with: registry.registrar(forPlugin: "FLTGoogleSignInPlugin"))
LocationPlugin.register(with: registry.registrar(forPlugin: "LocationPlugin"))
Expand Down
42 changes: 41 additions & 1 deletion aid_employ/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,31 @@ packages:
sha256: "1bbf65dd997458a08b531042ec3794112a6c39c07c37ff22113d2e7e4f81d4e4"
url: "https://pub.dev"
source: hosted
version: "6.2.1"
version: "6.1.1"
firebase_analytics:
dependency: "direct main"
description:
name: firebase_analytics
sha256: b13cbf1ee78744ca5e6b762e9218db3bd3967a0edfed75f58339907892a2ccb9
url: "https://pub.dev"
source: hosted
version: "10.8.9"
firebase_analytics_platform_interface:
dependency: transitive
description:
name: firebase_analytics_platform_interface
sha256: "416b33d62033db5ecd2df719fcb657ad04e9995fa0fc392ffdab4ca0e76cb679"
url: "https://pub.dev"
source: hosted
version: "3.9.9"
firebase_analytics_web:
dependency: transitive
description:
name: firebase_analytics_web
sha256: "9dca9d8d468172444ef18cabb73fe99f7aae24733bfad67115bd36bffd2d65c1"
url: "https://pub.dev"
source: hosted
version: "0.5.5+21"
firebase_auth:
dependency: "direct main"
description:
Expand Down Expand Up @@ -217,6 +241,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.11.5"
firebase_crashlytics:
dependency: "direct main"
description:
name: firebase_crashlytics
sha256: c4f1b723d417bc9c4774810e774ff91df8fb0032d33fb2888b2c887e865581b8
url: "https://pub.dev"
source: hosted
version: "3.4.18"
firebase_crashlytics_platform_interface:
dependency: transitive
description:
name: firebase_crashlytics_platform_interface
sha256: c5a11fca3df76a98e3fa68fde8b10a08aacb9a7639f619fbfd4dad6c67a08643
url: "https://pub.dev"
source: hosted
version: "3.6.25"
firebase_storage:
dependency: "direct main"
description:
Expand Down
2 changes: 2 additions & 0 deletions aid_employ/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ dependencies:
location: ^5.0.3
flutter_polyline_points: ^2.0.0
custom_info_window: ^1.0.1
firebase_crashlytics: ^3.4.18
firebase_analytics: ^10.8.9
flutter_svg: ^2.0.10+1

dev_dependencies:
Expand Down

0 comments on commit 0719aec

Please sign in to comment.