From e27e8ccc744e45e7190a745f101092d8b30688e3 Mon Sep 17 00:00:00 2001 From: Aidaiym Date: Mon, 1 Jul 2024 20:34:03 +0600 Subject: [PATCH 1/8] add firebase crashlytics --- app/android/app/build.gradle | 1 + app/android/app/google-services.json | 4 +- app/android/build.gradle | 1 + app/firebase.json | 2 +- app/ios/Podfile.lock | 191 +++++++++++++++--- app/ios/Runner.xcodeproj/project.pbxproj | 19 ++ .../xcshareddata/xcschemes/Runner.xcscheme | 6 + app/lib/firebase_options.dart | 2 + app/lib/main.dart | 11 + app/pubspec.lock | 88 +++++--- app/pubspec.yaml | 2 + 11 files changed, 267 insertions(+), 60 deletions(-) diff --git a/app/android/app/build.gradle b/app/android/app/build.gradle index ff7d3ff3..cd92a415 100644 --- a/app/android/app/build.gradle +++ b/app/android/app/build.gradle @@ -30,6 +30,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" diff --git a/app/android/app/google-services.json b/app/android/app/google-services.json index 2caf8de3..dce12975 100644 --- a/app/android/app/google-services.json +++ b/app/android/app/google-services.json @@ -55,10 +55,10 @@ "client_type": 3 }, { - "client_id": "417182149715-jknocdcmfmmahvr2fup4slmkltqdq9l4.apps.googleusercontent.com", + "client_id": "417182149715-icusnhceqetnqlinprnn9o8tamct4g7q.apps.googleusercontent.com", "client_type": 2, "ios_info": { - "bundle_id": "com.example" + "bundle_id": "com.alee.hatimapp" } } ] diff --git a/app/android/build.gradle b/app/android/build.gradle index c0faa314..fe12df0b 100644 --- a/app/android/build.gradle +++ b/app/android/build.gradle @@ -8,6 +8,7 @@ buildscript { dependencies { // START: FlutterFire Configuration classpath 'com.google.gms:google-services:4.3.15' + classpath 'com.google.firebase:firebase-crashlytics-gradle:2.8.1' // END: FlutterFire Configuration classpath 'com.android.tools.build:gradle:7.1.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" diff --git a/app/firebase.json b/app/firebase.json index 189e2309..68f36259 100644 --- a/app/firebase.json +++ b/app/firebase.json @@ -12,7 +12,7 @@ "default": { "projectId": "my-quran-01", "appId": "1:417182149715:ios:f6d207c487b6110e76eaa6", - "uploadDebugSymbols": false, + "uploadDebugSymbols": true, "fileOutput": "ios/Runner/GoogleService-Info.plist" } }, diff --git a/app/ios/Podfile.lock b/app/ios/Podfile.lock index a21d0a19..e4adcf62 100644 --- a/app/ios/Podfile.lock +++ b/app/ios/Podfile.lock @@ -15,32 +15,92 @@ PODS: - ReachabilitySwift - device_info_plus (0.0.1): - Flutter - - Firebase/Auth (10.24.0): + - Firebase/Analytics (10.25.0): + - Firebase/Core + - Firebase/Auth (10.25.0): - Firebase/CoreOnly - - FirebaseAuth (~> 10.24.0) - - Firebase/CoreOnly (10.24.0): - - FirebaseCore (= 10.24.0) + - FirebaseAuth (~> 10.25.0) + - Firebase/Core (10.25.0): + - Firebase/CoreOnly + - FirebaseAnalytics (~> 10.25.0) + - Firebase/CoreOnly (10.25.0): + - FirebaseCore (= 10.25.0) + - Firebase/Crashlytics (10.25.0): + - Firebase/CoreOnly + - FirebaseCrashlytics (~> 10.25.0) + - firebase_analytics (10.10.7): + - Firebase/Analytics (= 10.25.0) + - firebase_core + - Flutter - firebase_auth (4.19.4): - - Firebase/Auth (= 10.24.0) + - Firebase/Auth (= 10.25.0) - firebase_core - Flutter - - firebase_core (2.30.1): - - Firebase/CoreOnly (= 10.24.0) + - firebase_core (2.32.0): + - Firebase/CoreOnly (= 10.25.0) - Flutter - - FirebaseAppCheckInterop (10.25.0) - - FirebaseAuth (10.24.0): + - firebase_crashlytics (3.5.7): + - Firebase/Crashlytics (= 10.25.0) + - firebase_core + - Flutter + - FirebaseAnalytics (10.25.0): + - FirebaseAnalytics/AdIdSupport (= 10.25.0) + - FirebaseCore (~> 10.0) + - FirebaseInstallations (~> 10.0) + - GoogleUtilities/AppDelegateSwizzler (~> 7.11) + - GoogleUtilities/MethodSwizzler (~> 7.11) + - GoogleUtilities/Network (~> 7.11) + - "GoogleUtilities/NSData+zlib (~> 7.11)" + - nanopb (< 2.30911.0, >= 2.30908.0) + - FirebaseAnalytics/AdIdSupport (10.25.0): + - FirebaseCore (~> 10.0) + - FirebaseInstallations (~> 10.0) + - GoogleAppMeasurement (= 10.25.0) + - GoogleUtilities/AppDelegateSwizzler (~> 7.11) + - GoogleUtilities/MethodSwizzler (~> 7.11) + - GoogleUtilities/Network (~> 7.11) + - "GoogleUtilities/NSData+zlib (~> 7.11)" + - nanopb (< 2.30911.0, >= 2.30908.0) + - FirebaseAppCheckInterop (10.28.0) + - FirebaseAuth (10.25.0): - FirebaseAppCheckInterop (~> 10.17) - FirebaseCore (~> 10.0) - GoogleUtilities/AppDelegateSwizzler (~> 7.8) - GoogleUtilities/Environment (~> 7.8) - GTMSessionFetcher/Core (< 4.0, >= 2.1) - RecaptchaInterop (~> 100.0) - - FirebaseCore (10.24.0): + - FirebaseCore (10.25.0): - FirebaseCoreInternal (~> 10.0) - GoogleUtilities/Environment (~> 7.12) - GoogleUtilities/Logger (~> 7.12) - - FirebaseCoreInternal (10.25.0): + - FirebaseCoreExtension (10.28.0): + - FirebaseCore (~> 10.0) + - FirebaseCoreInternal (10.28.0): - "GoogleUtilities/NSData+zlib (~> 7.8)" + - FirebaseCrashlytics (10.25.0): + - FirebaseCore (~> 10.5) + - FirebaseInstallations (~> 10.0) + - FirebaseRemoteConfigInterop (~> 10.23) + - FirebaseSessions (~> 10.5) + - GoogleDataTransport (~> 9.2) + - GoogleUtilities/Environment (~> 7.8) + - nanopb (< 2.30911.0, >= 2.30908.0) + - PromisesObjC (~> 2.1) + - FirebaseInstallations (10.28.0): + - FirebaseCore (~> 10.0) + - GoogleUtilities/Environment (~> 7.8) + - GoogleUtilities/UserDefaults (~> 7.8) + - PromisesObjC (~> 2.1) + - FirebaseRemoteConfigInterop (10.28.0) + - FirebaseSessions (10.28.0): + - FirebaseCore (~> 10.5) + - FirebaseCoreExtension (~> 10.0) + - FirebaseInstallations (~> 10.0) + - GoogleDataTransport (~> 9.2) + - GoogleUtilities/Environment (~> 7.13) + - GoogleUtilities/UserDefaults (~> 7.13) + - nanopb (< 2.30911.0, >= 2.30908.0) + - PromisesSwift (~> 2.1) - Flutter (1.0.0) - google_sign_in_ios (0.0.1): - AppAuth (>= 1.7.4) @@ -48,49 +108,86 @@ PODS: - FlutterMacOS - GoogleSignIn (~> 7.1) - GTMSessionFetcher (>= 3.4.0) + - GoogleAppMeasurement (10.25.0): + - GoogleAppMeasurement/AdIdSupport (= 10.25.0) + - GoogleUtilities/AppDelegateSwizzler (~> 7.11) + - GoogleUtilities/MethodSwizzler (~> 7.11) + - GoogleUtilities/Network (~> 7.11) + - "GoogleUtilities/NSData+zlib (~> 7.11)" + - nanopb (< 2.30911.0, >= 2.30908.0) + - GoogleAppMeasurement/AdIdSupport (10.25.0): + - GoogleAppMeasurement/WithoutAdIdSupport (= 10.25.0) + - GoogleUtilities/AppDelegateSwizzler (~> 7.11) + - GoogleUtilities/MethodSwizzler (~> 7.11) + - GoogleUtilities/Network (~> 7.11) + - "GoogleUtilities/NSData+zlib (~> 7.11)" + - nanopb (< 2.30911.0, >= 2.30908.0) + - GoogleAppMeasurement/WithoutAdIdSupport (10.25.0): + - GoogleUtilities/AppDelegateSwizzler (~> 7.11) + - GoogleUtilities/MethodSwizzler (~> 7.11) + - GoogleUtilities/Network (~> 7.11) + - "GoogleUtilities/NSData+zlib (~> 7.11)" + - nanopb (< 2.30911.0, >= 2.30908.0) + - GoogleDataTransport (9.4.1): + - GoogleUtilities/Environment (~> 7.7) + - nanopb (< 2.30911.0, >= 2.30908.0) + - PromisesObjC (< 3.0, >= 1.2) - GoogleSignIn (7.1.0): - AppAuth (< 2.0, >= 1.7.3) - GTMAppAuth (< 5.0, >= 4.1.1) - GTMSessionFetcher/Core (~> 3.3) - - GoogleUtilities/AppDelegateSwizzler (7.13.2): + - GoogleUtilities/AppDelegateSwizzler (7.13.3): - GoogleUtilities/Environment - GoogleUtilities/Logger - GoogleUtilities/Network - GoogleUtilities/Privacy - - GoogleUtilities/Environment (7.13.2): + - GoogleUtilities/Environment (7.13.3): - GoogleUtilities/Privacy - PromisesObjC (< 3.0, >= 1.2) - - GoogleUtilities/Logger (7.13.2): + - GoogleUtilities/Logger (7.13.3): - GoogleUtilities/Environment - GoogleUtilities/Privacy - - GoogleUtilities/Network (7.13.2): + - GoogleUtilities/MethodSwizzler (7.13.3): + - GoogleUtilities/Logger + - GoogleUtilities/Privacy + - GoogleUtilities/Network (7.13.3): - GoogleUtilities/Logger - "GoogleUtilities/NSData+zlib" - GoogleUtilities/Privacy - GoogleUtilities/Reachability - - "GoogleUtilities/NSData+zlib (7.13.2)": + - "GoogleUtilities/NSData+zlib (7.13.3)": + - GoogleUtilities/Privacy + - GoogleUtilities/Privacy (7.13.3) + - GoogleUtilities/Reachability (7.13.3): + - GoogleUtilities/Logger - GoogleUtilities/Privacy - - GoogleUtilities/Privacy (7.13.2) - - GoogleUtilities/Reachability (7.13.2): + - GoogleUtilities/UserDefaults (7.13.3): - GoogleUtilities/Logger - GoogleUtilities/Privacy - GTMAppAuth (4.1.1): - AppAuth/Core (~> 1.7) - GTMSessionFetcher/Core (< 4.0, >= 3.3) - - GTMSessionFetcher (3.4.1): - - GTMSessionFetcher/Full (= 3.4.1) - - GTMSessionFetcher/Core (3.4.1) - - GTMSessionFetcher/Full (3.4.1): + - GTMSessionFetcher (3.5.0): + - GTMSessionFetcher/Full (= 3.5.0) + - GTMSessionFetcher/Core (3.5.0) + - GTMSessionFetcher/Full (3.5.0): - GTMSessionFetcher/Core - just_audio (0.0.1): - Flutter + - nanopb (2.30910.0): + - nanopb/decode (= 2.30910.0) + - nanopb/encode (= 2.30910.0) + - nanopb/decode (2.30910.0) + - nanopb/encode (2.30910.0) - package_info_plus (0.4.5): - Flutter - path_provider_foundation (0.0.1): - Flutter - FlutterMacOS - PromisesObjC (2.4.0) - - ReachabilitySwift (5.2.2) + - PromisesSwift (2.4.0): + - PromisesObjC (= 2.4.0) + - ReachabilitySwift (5.2.3) - RecaptchaInterop (100.0.0) - shared_preferences_foundation (0.0.1): - Flutter @@ -108,8 +205,10 @@ DEPENDENCIES: - audio_session (from `.symlinks/plugins/audio_session/ios`) - connectivity_plus (from `.symlinks/plugins/connectivity_plus/darwin`) - device_info_plus (from `.symlinks/plugins/device_info_plus/ios`) + - firebase_analytics (from `.symlinks/plugins/firebase_analytics/ios`) - firebase_auth (from `.symlinks/plugins/firebase_auth/ios`) - firebase_core (from `.symlinks/plugins/firebase_core/ios`) + - firebase_crashlytics (from `.symlinks/plugins/firebase_crashlytics/ios`) - Flutter (from `Flutter`) - google_sign_in_ios (from `.symlinks/plugins/google_sign_in_ios/darwin`) - just_audio (from `.symlinks/plugins/just_audio/ios`) @@ -124,15 +223,25 @@ SPEC REPOS: trunk: - AppAuth - Firebase + - FirebaseAnalytics - FirebaseAppCheckInterop - FirebaseAuth - FirebaseCore + - FirebaseCoreExtension - FirebaseCoreInternal + - FirebaseCrashlytics + - FirebaseInstallations + - FirebaseRemoteConfigInterop + - FirebaseSessions + - GoogleAppMeasurement + - GoogleDataTransport - GoogleSignIn - GoogleUtilities - GTMAppAuth - GTMSessionFetcher + - nanopb - PromisesObjC + - PromisesSwift - ReachabilitySwift - RecaptchaInterop @@ -145,10 +254,14 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/connectivity_plus/darwin" device_info_plus: :path: ".symlinks/plugins/device_info_plus/ios" + firebase_analytics: + :path: ".symlinks/plugins/firebase_analytics/ios" firebase_auth: :path: ".symlinks/plugins/firebase_auth/ios" firebase_core: :path: ".symlinks/plugins/firebase_core/ios" + firebase_crashlytics: + :path: ".symlinks/plugins/firebase_crashlytics/ios" Flutter: :path: Flutter google_sign_in_ios: @@ -174,24 +287,36 @@ SPEC CHECKSUMS: audio_session: 4f3e461722055d21515cf3261b64c973c062f345 connectivity_plus: e2dad488011aeb593e219360e804c43cc1af5770 device_info_plus: 97af1d7e84681a90d0693e63169a5d50e0839a0d - Firebase: 91fefd38712feb9186ea8996af6cbdef41473442 - firebase_auth: b782567cafd5cfd64debf54638a9f29b63abd7bf - firebase_core: 7f1e1156934d0da3be260174812842df9420e4ab - FirebaseAppCheckInterop: 5da5ce93e8797a215e3f677fb0654b74e736c8b8 - FirebaseAuth: 711d01cccefaf10035b3090a92956d0dd4f99088 - FirebaseCore: 11dc8a16dfb7c5e3c3f45ba0e191a33ac4f50894 - FirebaseCoreInternal: 910a81992c33715fec9263ca7381d59ab3a750b7 + Firebase: 0312a2352584f782ea56f66d91606891d4607f06 + firebase_analytics: cc06e24d6a2343c44f845b3112143db72d10ef78 + firebase_auth: 59b73550b86d6213a4e9509a9c21b59ea524c647 + firebase_core: a626d00494efa398e7c54f25f1454a64c8abf197 + firebase_crashlytics: 17e856fabec68d993662abaf2f6fe2413f0abece + FirebaseAnalytics: ec00fe8b93b41dc6fe4a28784b8e51da0647a248 + FirebaseAppCheckInterop: 5315f40293191bfec04b2cfab0215760e441540a + FirebaseAuth: c0f93dcc570c9da2bffb576969d793e95c344fbb + FirebaseCore: 7ec4d0484817f12c3373955bc87762d96842d483 + FirebaseCoreExtension: f63147b723e2a700fe0f34ec6fb7f358d6fe83e0 + FirebaseCoreInternal: 58d07f1362fddeb0feb6a857d1d1d1c5e558e698 + FirebaseCrashlytics: 4b96efb0ce73b38b2a85e8b8bd1bd8f63f09d015 + FirebaseInstallations: 60c1d3bc1beef809fd1ad1189a8057a040c59f2e + FirebaseRemoteConfigInterop: 70d200c6956ef3b5c3592a95e824c1210682d785 + FirebaseSessions: 20da8500ad66bb12622743e170459bf62a0768e8 Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 google_sign_in_ios: 07375bfbf2620bc93a602c0e27160d6afc6ead38 + GoogleAppMeasurement: 9abf64b682732fed36da827aa2a68f0221fd2356 + GoogleDataTransport: 6c09b596d841063d76d4288cc2d2f42cc36e1e2a GoogleSignIn: d4281ab6cf21542b1cfaff85c191f230b399d2db - GoogleUtilities: c56430aef51a1aa57b25da78c3f8397e522c67b7 + GoogleUtilities: ea963c370a38a8069cc5f7ba4ca849a60b6d7d15 GTMAppAuth: f69bd07d68cd3b766125f7e072c45d7340dea0de - GTMSessionFetcher: 8000756fc1c19d2e5697b90311f7832d2e33f6cd + GTMSessionFetcher: 5aea5ba6bd522a239e236100971f10cb71b96ab6 just_audio: baa7252489dbcf47a4c7cc9ca663e9661c99aafa + nanopb: 438bc412db1928dac798aa6fd75726007be04262 package_info_plus: 58f0028419748fad15bf008b270aaa8e54380b1c path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47 - ReachabilitySwift: 2128f3a8c9107e1ad33574c6e58e8285d460b149 + PromisesSwift: 9d77319bbe72ebf6d872900551f7eeba9bce2851 + ReachabilitySwift: 7f151ff156cea1481a8411701195ac6a984f4979 RecaptchaInterop: 7d1a4a01a6b2cb1610a47ef3f85f0c411434cb21 shared_preferences_foundation: b4c3b4cddf1c21f02770737f147a3f5da9d39695 sign_in_with_apple: f3bf75217ea4c2c8b91823f225d70230119b8440 diff --git a/app/ios/Runner.xcodeproj/project.pbxproj b/app/ios/Runner.xcodeproj/project.pbxproj index 139ea533..7a7b1e3a 100644 --- a/app/ios/Runner.xcodeproj/project.pbxproj +++ b/app/ios/Runner.xcodeproj/project.pbxproj @@ -145,6 +145,7 @@ 3B06AD1E1E4923F5004D2608 /* Thin Binary */, CAB66AAAF81BCB70B14C06C7 /* [CP] Embed Pods Frameworks */, 98518691A176A604658BC07F /* [CP] Copy Pods Resources */, + 504BFD955DA96F87A417BBB8 /* FlutterFire: "flutterfire upload-crashlytics-symbols" */, ); buildRules = ( ); @@ -220,6 +221,24 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; }; + 504BFD955DA96F87A417BBB8 /* FlutterFire: "flutterfire upload-crashlytics-symbols" */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + name = "FlutterFire: \"flutterfire upload-crashlytics-symbols\""; + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\n#!/bin/bash\nPATH=${PATH}:$FLUTTER_ROOT/bin:$HOME/.pub-cache/bin\nflutterfire upload-crashlytics-symbols --upload-symbols-script-path=$PODS_ROOT/FirebaseCrashlytics/upload-symbols --platform=ios --apple-project-path=${SRCROOT} --env-platform-name=${PLATFORM_NAME} --env-configuration=${CONFIGURATION} --env-project-dir=${PROJECT_DIR} --env-built-products-dir=${BUILT_PRODUCTS_DIR} --env-dwarf-dsym-folder-path=${DWARF_DSYM_FOLDER_PATH} --env-dwarf-dsym-file-name=${DWARF_DSYM_FILE_NAME} --env-infoplist-path=${INFOPLIST_PATH} --default-config=default\n"; + }; 5E60CE51EA0DB0A403868B4B /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; diff --git a/app/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/app/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 68923119..d2f81abc 100644 --- a/app/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/app/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -59,6 +59,12 @@ ReferencedContainer = "container:Runner.xcodeproj"> + + + + main({AppConfig? appConfig}) async { options: DefaultFirebaseOptions.currentPlatform, ); + FlutterError.onError = (errorDetails) { + FirebaseCrashlytics.instance.recordFlutterFatalError(errorDetails); + }; + + PlatformDispatcher.instance.onError = (error, stack) { + FirebaseCrashlytics.instance.recordError(error, stack, fatal: true); + return true; + }; + FlutterError.onError = (details) { log(details.exceptionAsString(), stackTrace: details.stack); }; diff --git a/app/pubspec.lock b/app/pubspec.lock index 1f80ac5c..afc838f5 100644 --- a/app/pubspec.lock +++ b/app/pubspec.lock @@ -13,10 +13,10 @@ packages: dependency: transitive description: name: _flutterfire_internals - sha256: "3dee3db3468c5f4640a4e8aa9c1e22561c298976d8c39ed2fdd456a9a3db26e1" + sha256: "37a42d06068e2fe3deddb2da079a8c4d105f241225ba27b7122b37e9865fd8f7" url: "https://pub.dev" source: hosted - version: "1.3.32" + version: "1.3.35" analyzer: dependency: transitive description: @@ -337,6 +337,30 @@ packages: url: "https://pub.dev" source: hosted version: "7.0.0" + firebase_analytics: + dependency: "direct main" + description: + name: firebase_analytics + sha256: dbf1e7ab22cfb1f4a4adb103b46a26276b4edc593d4a78ef6fb942bafc92e035 + url: "https://pub.dev" + source: hosted + version: "10.10.7" + firebase_analytics_platform_interface: + dependency: transitive + description: + name: firebase_analytics_platform_interface + sha256: "3729b74f8cf1d974a27ba70332ecb55ff5ff560edc8164a6469f4a055b429c37" + url: "https://pub.dev" + source: hosted + version: "3.10.8" + firebase_analytics_web: + dependency: transitive + description: + name: firebase_analytics_web + sha256: "019cd7eee74254d33fbd2e29229367ce33063516bf6b3258a341d89e3b0f1655" + url: "https://pub.dev" + source: hosted + version: "0.5.7+7" firebase_auth: dependency: "direct main" description: @@ -365,10 +389,10 @@ packages: dependency: "direct main" description: name: firebase_core - sha256: "4aef2a23d0f3265545807d68fbc2f76a6b994ca3c778d88453b99325abd63284" + sha256: "26de145bb9688a90962faec6f838247377b0b0d32cc0abecd9a4e43525fc856c" url: "https://pub.dev" source: hosted - version: "2.30.1" + version: "2.32.0" firebase_core_platform_interface: dependency: transitive description: @@ -381,10 +405,26 @@ packages: dependency: transitive description: name: firebase_core_web - sha256: "67f2fcc600fc78c2f731c370a3a5e6c87ee862e3a2fba6f951eca6d5dafe5c29" + sha256: "22fcb352744908224fc7be3caae254836099786acfe5df6e9fe901e9c2575a41" url: "https://pub.dev" source: hosted - version: "2.16.0" + version: "2.17.1" + firebase_crashlytics: + dependency: "direct main" + description: + name: firebase_crashlytics + sha256: "9897c01efaa950d2f6da8317d12452749a74dc45f33b46390a14cfe28067f271" + url: "https://pub.dev" + source: hosted + version: "3.5.7" + firebase_crashlytics_platform_interface: + dependency: transitive + description: + name: firebase_crashlytics_platform_interface + sha256: "16a71e08fbf6e00382816e1b13397898c29a54fa0ad969c2c2a3b82a704877f0" + url: "https://pub.dev" + source: hosted + version: "3.6.35" fixnum: dependency: transitive description: @@ -603,10 +643,10 @@ packages: dependency: "direct main" description: name: intl - sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d" + sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf url: "https://pub.dev" source: hosted - version: "0.18.1" + version: "0.19.0" io: dependency: transitive description: @@ -675,26 +715,26 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa" + sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a" url: "https://pub.dev" source: hosted - version: "10.0.0" + version: "10.0.4" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0 + sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8" url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "3.0.3" leak_tracker_testing: dependency: transitive description: name: leak_tracker_testing - sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47 + sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "3.0.1" loader_overlay: dependency: "direct main" description: @@ -731,10 +771,10 @@ packages: dependency: "direct main" description: name: meta - sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 + sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.12.0" mime: dependency: transitive description: @@ -1206,26 +1246,26 @@ packages: dependency: "direct dev" description: name: test - sha256: a1f7595805820fcc05e5c52e3a231aedd0b72972cb333e8c738a8b1239448b6f + sha256: "7ee446762c2c50b3bd4ea96fe13ffac69919352bd3b4b17bac3f3465edc58073" url: "https://pub.dev" source: hosted - version: "1.24.9" + version: "1.25.2" test_api: dependency: transitive description: name: test_api - sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" + sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f" url: "https://pub.dev" source: hosted - version: "0.6.1" + version: "0.7.0" test_core: dependency: transitive description: name: test_core - sha256: a757b14fc47507060a162cc2530d9a4a2f92f5100a952c7443b5cad5ef5b106a + sha256: "2bc4b4ecddd75309300d8096f781c0e3280ca1ef85beda558d33fcbedc2eead4" url: "https://pub.dev" source: hosted - version: "0.5.9" + version: "0.6.0" time: dependency: transitive description: @@ -1382,10 +1422,10 @@ packages: dependency: transitive description: name: vm_service - sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957 + sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec" url: "https://pub.dev" source: hosted - version: "13.0.0" + version: "14.2.1" watcher: dependency: transitive description: diff --git a/app/pubspec.yaml b/app/pubspec.yaml index 6d4441a9..efcf1003 100644 --- a/app/pubspec.yaml +++ b/app/pubspec.yaml @@ -41,6 +41,8 @@ dependencies: path: ../packages/mq_storage/ mq_ci_keys: path: ../packages/mq_ci_keys/ + firebase_crashlytics: ^3.5.7 + firebase_analytics: ^10.10.7 # flutter_native_splash: ^2.4.0 dev_dependencies: From a117d5dcb9687d26b1e9879b5b08cd926b066fd7 Mon Sep 17 00:00:00 2001 From: Aidaiym Date: Mon, 1 Jul 2024 21:21:18 +0600 Subject: [PATCH 2/8] change yaml --- app/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/pubspec.yaml b/app/pubspec.yaml index efcf1003..02765a2f 100644 --- a/app/pubspec.yaml +++ b/app/pubspec.yaml @@ -21,7 +21,7 @@ dependencies: web_socket_channel: ^2.4.5 sign_in_with_apple: ^6.1.1 go_router: ^13.2.2 - intl: ^0.18.1 # 0.19.0 + intl: ^0.19.0 flutter_bloc: ^8.1.5 equatable: ^2.0.5 connectivity_plus: ^6.0.1 From a03739f252dd9fef02c3c8daae4e1716fb412462 Mon Sep 17 00:00:00 2001 From: Aidaiym Date: Mon, 1 Jul 2024 22:14:51 +0600 Subject: [PATCH 3/8] fix version error --- .fvmrc | 3 +++ .gitignore | 4 +++- .vscode/settings.json | 13 ++++++++++--- app/pubspec.lock | 36 ++++++++++++++++++------------------ app/pubspec.yaml | 2 +- 5 files changed, 35 insertions(+), 23 deletions(-) create mode 100644 .fvmrc diff --git a/.fvmrc b/.fvmrc new file mode 100644 index 00000000..80f56ee8 --- /dev/null +++ b/.fvmrc @@ -0,0 +1,3 @@ +{ + "flutter": "3.19.5" +} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 2bb2185a..39ffa382 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ - # Miscellaneous *.class *.log @@ -65,3 +64,6 @@ app/android/fastlane/metadata/android/en-US/images/phoneScreenshots/ **/build/ # keep the .lock file from the workspace and the app. packages/**/pubspec.lock + +# FVM Version Cache +.fvm/ \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index feebe59e..ca0f013e 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,12 @@ { - "dart.lineLength": 120, - "git.ignoreLimitWarning": true, - "explorer.autoReveal": false, + "dart.lineLength": 120, + "git.ignoreLimitWarning": true, + "explorer.autoReveal": false, + "dart.flutterSdkPath": ".fvm/versions/3.19.5", + "search.exclude": { + "**/.fvm": true + }, + "files.watcherExclude": { + "**/.fvm": true + } } \ No newline at end of file diff --git a/app/pubspec.lock b/app/pubspec.lock index afc838f5..221e11aa 100644 --- a/app/pubspec.lock +++ b/app/pubspec.lock @@ -643,10 +643,10 @@ packages: dependency: "direct main" description: name: intl - sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf + sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d" url: "https://pub.dev" source: hosted - version: "0.19.0" + version: "0.18.1" io: dependency: transitive description: @@ -715,26 +715,26 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a" + sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa" url: "https://pub.dev" source: hosted - version: "10.0.4" + version: "10.0.0" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8" + sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0 url: "https://pub.dev" source: hosted - version: "3.0.3" + version: "2.0.1" leak_tracker_testing: dependency: transitive description: name: leak_tracker_testing - sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47 url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "2.0.1" loader_overlay: dependency: "direct main" description: @@ -771,10 +771,10 @@ packages: dependency: "direct main" description: name: meta - sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136" + sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 url: "https://pub.dev" source: hosted - version: "1.12.0" + version: "1.11.0" mime: dependency: transitive description: @@ -1246,26 +1246,26 @@ packages: dependency: "direct dev" description: name: test - sha256: "7ee446762c2c50b3bd4ea96fe13ffac69919352bd3b4b17bac3f3465edc58073" + sha256: a1f7595805820fcc05e5c52e3a231aedd0b72972cb333e8c738a8b1239448b6f url: "https://pub.dev" source: hosted - version: "1.25.2" + version: "1.24.9" test_api: dependency: transitive description: name: test_api - sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f" + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" url: "https://pub.dev" source: hosted - version: "0.7.0" + version: "0.6.1" test_core: dependency: transitive description: name: test_core - sha256: "2bc4b4ecddd75309300d8096f781c0e3280ca1ef85beda558d33fcbedc2eead4" + sha256: a757b14fc47507060a162cc2530d9a4a2f92f5100a952c7443b5cad5ef5b106a url: "https://pub.dev" source: hosted - version: "0.6.0" + version: "0.5.9" time: dependency: transitive description: @@ -1422,10 +1422,10 @@ packages: dependency: transitive description: name: vm_service - sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec" + sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957 url: "https://pub.dev" source: hosted - version: "14.2.1" + version: "13.0.0" watcher: dependency: transitive description: diff --git a/app/pubspec.yaml b/app/pubspec.yaml index 02765a2f..efcf1003 100644 --- a/app/pubspec.yaml +++ b/app/pubspec.yaml @@ -21,7 +21,7 @@ dependencies: web_socket_channel: ^2.4.5 sign_in_with_apple: ^6.1.1 go_router: ^13.2.2 - intl: ^0.19.0 + intl: ^0.18.1 # 0.19.0 flutter_bloc: ^8.1.5 equatable: ^2.0.5 connectivity_plus: ^6.0.1 From 82d20845523276a6f102754d35493c41e88115ce Mon Sep 17 00:00:00 2001 From: Aidaiym Date: Mon, 1 Jul 2024 22:58:08 +0600 Subject: [PATCH 4/8] fix version error --- .../Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme | 6 ------ 1 file changed, 6 deletions(-) diff --git a/app/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/app/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index d2f81abc..68923119 100644 --- a/app/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/app/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -59,12 +59,6 @@ ReferencedContainer = "container:Runner.xcodeproj"> - - - - Date: Tue, 2 Jul 2024 15:49:10 +0600 Subject: [PATCH 5/8] change version --- .gitignore | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 39ffa382..d5da716e 100644 --- a/.gitignore +++ b/.gitignore @@ -64,6 +64,5 @@ app/android/fastlane/metadata/android/en-US/images/phoneScreenshots/ **/build/ # keep the .lock file from the workspace and the app. packages/**/pubspec.lock - # FVM Version Cache -.fvm/ \ No newline at end of file +.fvm/ From 3ace59d12b592a271886853110e4495ea2932411 Mon Sep 17 00:00:00 2001 From: Aidaiym Date: Tue, 2 Jul 2024 16:16:32 +0600 Subject: [PATCH 6/8] change pod file --- app/ios/Podfile | 5 ++++- app/ios/Podfile.lock | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/ios/Podfile b/app/ios/Podfile index 10f3c9b4..eea7da85 100644 --- a/app/ios/Podfile +++ b/app/ios/Podfile @@ -1,5 +1,5 @@ # Uncomment this line to define a global platform for your project -platform :ios, '13.0' +platform :ios, '12.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' @@ -32,6 +32,9 @@ target 'Runner' do use_modular_headers! flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) + # target 'RunnerTests' do + # inherit! :search_paths + # end end post_install do |installer| diff --git a/app/ios/Podfile.lock b/app/ios/Podfile.lock index e4adcf62..cae470b1 100644 --- a/app/ios/Podfile.lock +++ b/app/ios/Podfile.lock @@ -323,6 +323,6 @@ SPEC CHECKSUMS: sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec url_launcher_ios: 6116280ddcfe98ab8820085d8d76ae7449447586 -PODFILE CHECKSUM: cc1f88378b4bfcf93a6ce00d2c587857c6008d3b +PODFILE CHECKSUM: 0805b11bfb13bd44fc55fe52946ce14f22a2998e COCOAPODS: 1.15.2 From 794d9810a0acb7df37a9ac1f2bc7ee0551d0ef4e Mon Sep 17 00:00:00 2001 From: Eldar2021 Date: Tue, 2 Jul 2024 20:48:48 +0600 Subject: [PATCH 7/8] Try fix CI Tests --- .github/workflows/analyze_test.yml | 2 ++ .github/workflows/build_android.yml | 2 ++ .github/workflows/build_ios.yml | 4 +++- .github/workflows/ci_android.yml | 2 ++ .github/workflows/ci_ios.yml | 2 ++ 5 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/analyze_test.yml b/.github/workflows/analyze_test.yml index c938508c..602c07cc 100644 --- a/.github/workflows/analyze_test.yml +++ b/.github/workflows/analyze_test.yml @@ -18,6 +18,8 @@ jobs: channel: "stable" - run: flutter doctor + - run: dart pub global activate flutterfire_cli + - name: "Melos Install" run: dart pub global activate melos diff --git a/.github/workflows/build_android.yml b/.github/workflows/build_android.yml index 4e383278..17e480cf 100644 --- a/.github/workflows/build_android.yml +++ b/.github/workflows/build_android.yml @@ -22,6 +22,8 @@ jobs: channel: "stable" - run: flutter doctor + - run: dart pub global activate flutterfire_cli + - name: "Melos Install" run: dart pub global activate melos diff --git a/.github/workflows/build_ios.yml b/.github/workflows/build_ios.yml index b4432848..eba91a9c 100644 --- a/.github/workflows/build_ios.yml +++ b/.github/workflows/build_ios.yml @@ -8,7 +8,7 @@ on: jobs: build_ios: - runs-on: macos-12 + runs-on: macos-latest steps: - uses: actions/checkout@v3 - uses: subosito/flutter-action@v2 @@ -18,6 +18,8 @@ jobs: architecture: x64 - run: flutter doctor + - run: dart pub global activate flutterfire_cli + - name: "Melos Install" run: dart pub global activate melos diff --git a/.github/workflows/ci_android.yml b/.github/workflows/ci_android.yml index 2223cf73..b980886b 100644 --- a/.github/workflows/ci_android.yml +++ b/.github/workflows/ci_android.yml @@ -30,6 +30,8 @@ jobs: cache: gradle - run: flutter doctor -v + - run: dart pub global activate flutterfire_cli + - name: "Melos Install" run: dart pub global activate melos diff --git a/.github/workflows/ci_ios.yml b/.github/workflows/ci_ios.yml index 4d542d45..61117852 100644 --- a/.github/workflows/ci_ios.yml +++ b/.github/workflows/ci_ios.yml @@ -26,6 +26,8 @@ jobs: channel: stable - run: flutter doctor -v + - run: dart pub global activate flutterfire_cli + - name: "Melos Install" run: dart pub global activate melos From 823dfd8baac521a26a568ff4f3f151a5ba0e09b8 Mon Sep 17 00:00:00 2001 From: Eldar2021 Date: Tue, 2 Jul 2024 21:30:30 +0600 Subject: [PATCH 8/8] Refactored some changes --- README.md | 44 ++++++++++++++----- app/ios/Podfile | 5 +-- app/ios/Podfile.lock | 12 ++--- .../data/repository/auth_repositoty_impl.dart | 4 ++ app/lib/config/router/parse_parameters.dart | 4 +- app/lib/core/auth/soccial_auth.dart | 10 +++-- app/lib/core/client/remote_client.dart | 9 ++-- app/lib/core/core.dart | 1 + app/lib/core/crashlytics/mq_crashlytics.dart | 42 ++++++++++++++++++ app/lib/core/launch/app_launch.dart | 5 +++ app/lib/main.dart | 9 ++-- .../data/source/hatim_remote_data_source.dart | 3 +- .../hatim/presentation/bloc/hatim_bloc.dart | 2 + .../data/repository/home_repository_impl.dart | 4 +- .../home/presentation/cubit/home_cubit.dart | 3 +- .../home/presentation/view/home_view.dart | 3 ++ .../quran_audio/logic/quran_audio_cubit.dart | 3 +- .../presentation/view/pagination_view.dart | 6 ++- scripts/pod_install.sh | 10 +++++ 19 files changed, 140 insertions(+), 39 deletions(-) create mode 100644 app/lib/core/crashlytics/mq_crashlytics.dart create mode 100755 scripts/pod_install.sh diff --git a/README.md b/README.md index 7aaee5fc..88fd9e2d 100644 --- a/README.md +++ b/README.md @@ -26,56 +26,78 @@ My Quran Hatim Aplication. ### Getting Started ## Requirements + - Dart sdk: ">=3.3.0 <4.0.0" - Flutter: "3.19.5" - Android: minSdkVersion 19 - iOS: --ios-language swift, Xcode version >= 15.0.0 ## Melos + [Melos](https://melos.invertase.dev/) splitting up large code bases into separate independently versioned packages is extremely useful for code sharing. However, making changes across many repositories is messy and difficult to track, and testing across repositories gets complicated really fast. To solve these (and many other) problems, some projects will organize their code bases into multi-package repositories (sometimes called [monorepos](https://en.wikipedia.org/wiki/Monorepo)). -* Install melos +- Install melos + ```shell dart pub global activate melos ``` + Setup + ```shell melos bootstrap ``` ## Run App -* If you have an AVD or real device attached, you can do + +- If you have an AVD or real device attached, you can do + ```shell melos run-app ``` ## Run tests -* run all tests from the command line: + +- run all tests from the command line: + ```shell melos test ``` ## Integration tests -* run integration tests in `test_driver` directory: + +- run integration tests in `test_driver` directory: + ```shell melos integration-test ``` ## Fmt -`dartfmt` lacks config file support, which implies that customizations need to be done by users individually. The default -limit of 80 characters line length conflicts with the deeply nested structure of flutter's declarative code for designing + +`dartfmt` lacks config file support, which implies that customizations need to be done by users individually. The default +limit of 80 characters line length conflicts with the deeply nested structure of flutter's declarative code for designing widgets. This causes many unwanted linebreaks that reduce the readability of flutter code. Hence, we increase the line length of the code to 120. -* Settings > Dart > Line length 120. -* Autoformat on save: Settings > Languages and Frameworks > then tick: `Format code on save`, `Organize imports on save`. -* Format the whole codebase with: +- Settings > Dart > Line length 120. +- Autoformat on save: Settings > Languages and Frameworks > then tick: `Format code on save`, `Organize imports on save`. +- Format the whole codebase with: + ```shell melos format-all ``` + ## Generate -* Re generate .g files run: + +- Re generate .g files run: + ```shell melos run-build-runner-all -``` \ No newline at end of file +``` + +### Installing iOS Dependencies + +```sh +./scripts/pod_install.sh +``` diff --git a/app/ios/Podfile b/app/ios/Podfile index eea7da85..10f3c9b4 100644 --- a/app/ios/Podfile +++ b/app/ios/Podfile @@ -1,5 +1,5 @@ # Uncomment this line to define a global platform for your project -platform :ios, '12.0' +platform :ios, '13.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' @@ -32,9 +32,6 @@ target 'Runner' do use_modular_headers! flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) - # target 'RunnerTests' do - # inherit! :search_paths - # end end post_install do |installer| diff --git a/app/ios/Podfile.lock b/app/ios/Podfile.lock index cae470b1..7d16f74f 100644 --- a/app/ios/Podfile.lock +++ b/app/ios/Podfile.lock @@ -167,10 +167,10 @@ PODS: - GTMAppAuth (4.1.1): - AppAuth/Core (~> 1.7) - GTMSessionFetcher/Core (< 4.0, >= 3.3) - - GTMSessionFetcher (3.5.0): - - GTMSessionFetcher/Full (= 3.5.0) - - GTMSessionFetcher/Core (3.5.0) - - GTMSessionFetcher/Full (3.5.0): + - GTMSessionFetcher (3.4.1): + - GTMSessionFetcher/Full (= 3.4.1) + - GTMSessionFetcher/Core (3.4.1) + - GTMSessionFetcher/Full (3.4.1): - GTMSessionFetcher/Core - just_audio (0.0.1): - Flutter @@ -309,7 +309,7 @@ SPEC CHECKSUMS: GoogleSignIn: d4281ab6cf21542b1cfaff85c191f230b399d2db GoogleUtilities: ea963c370a38a8069cc5f7ba4ca849a60b6d7d15 GTMAppAuth: f69bd07d68cd3b766125f7e072c45d7340dea0de - GTMSessionFetcher: 5aea5ba6bd522a239e236100971f10cb71b96ab6 + GTMSessionFetcher: 8000756fc1c19d2e5697b90311f7832d2e33f6cd just_audio: baa7252489dbcf47a4c7cc9ca663e9661c99aafa nanopb: 438bc412db1928dac798aa6fd75726007be04262 package_info_plus: 58f0028419748fad15bf008b270aaa8e54380b1c @@ -323,6 +323,6 @@ SPEC CHECKSUMS: sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec url_launcher_ios: 6116280ddcfe98ab8820085d8d76ae7449447586 -PODFILE CHECKSUM: 0805b11bfb13bd44fc55fe52946ce14f22a2998e +PODFILE CHECKSUM: cc1f88378b4bfcf93a6ce00d2c587857c6008d3b COCOAPODS: 1.15.2 diff --git a/app/lib/app/data/repository/auth_repositoty_impl.dart b/app/lib/app/data/repository/auth_repositoty_impl.dart index 1d86c0dd..fab4875c 100644 --- a/app/lib/app/data/repository/auth_repositoty_impl.dart +++ b/app/lib/app/data/repository/auth_repositoty_impl.dart @@ -25,6 +25,7 @@ final class AuthRepositoryImpl implements AuthRepository { await remoteDataSource.saveUserData(userEntity); await localDataSource.saveUserData(userEntity); } catch (e, s) { + MqCrashlytics.report(e, s); log('setUserData error $e,\n$s'); } } @@ -49,6 +50,7 @@ final class AuthRepositoryImpl implements AuthRepository { ); } catch (e, s) { log('signWithGoogle: error: $e\n$s'); + MqCrashlytics.report(e, s); return Left(AuthenticationExc(message: e.toString())); } } @@ -72,6 +74,7 @@ final class AuthRepositoryImpl implements AuthRepository { ), ); } catch (e, s) { + MqCrashlytics.report(e, s); log('signWithGoogle: error: $e\n$s'); return Left(AuthenticationExc(message: e.toString())); } @@ -109,6 +112,7 @@ final class AuthRepositoryImpl implements AuthRepository { await remoteDataSource.logoutRemote(); await localDataSource.logoutLocal(); } catch (e, s) { + MqCrashlytics.report(e, s); log('logout error: $e\n$s'); } } diff --git a/app/lib/config/router/parse_parameters.dart b/app/lib/config/router/parse_parameters.dart index 86edcdb0..002d9dad 100644 --- a/app/lib/config/router/parse_parameters.dart +++ b/app/lib/config/router/parse_parameters.dart @@ -1,6 +1,7 @@ import 'dart:developer'; import 'package:meta/meta.dart'; +import 'package:my_quran/core/core.dart'; @immutable final class ParseParams { @@ -12,7 +13,8 @@ final class ParseParams { final p1 = args['pages'] ?? '[1]'; final pages = p1.substring(1, p1.length - 1).split(',').map(int.parse).toList(); return (pages, isHatim); - } catch (e) { + } catch (e, s) { + MqCrashlytics.report(e, s); log(e.toString()); return ([1], false); } diff --git a/app/lib/core/auth/soccial_auth.dart b/app/lib/core/auth/soccial_auth.dart index 08605e2e..cc91ed8b 100644 --- a/app/lib/core/auth/soccial_auth.dart +++ b/app/lib/core/auth/soccial_auth.dart @@ -1,6 +1,7 @@ import 'package:firebase_auth/firebase_auth.dart'; import 'package:flutter/foundation.dart'; import 'package:google_sign_in/google_sign_in.dart'; +import 'package:my_quran/core/core.dart'; import 'package:sign_in_with_apple/sign_in_with_apple.dart'; @immutable @@ -20,7 +21,8 @@ class SoccialAuth { final userCredential = await FirebaseAuth.instance.signInWithCredential(credential); return userCredential; - } catch (error) { + } catch (e, s) { + MqCrashlytics.report(e, s); rethrow; } } @@ -39,7 +41,8 @@ class SoccialAuth { ); final userCredential = await FirebaseAuth.instance.signInWithCredential(oauthCredential); return userCredential; - } catch (e) { + } catch (e, s) { + MqCrashlytics.report(e, s); rethrow; } } @@ -48,7 +51,8 @@ class SoccialAuth { try { await FirebaseAuth.instance.signOut(); await _googleSignIn.signOut(); - } catch (error) { + } catch (e, s) { + MqCrashlytics.report(e, s); rethrow; } } diff --git a/app/lib/core/client/remote_client.dart b/app/lib/core/client/remote_client.dart index 6a9662fd..6c38b3ff 100644 --- a/app/lib/core/client/remote_client.dart +++ b/app/lib/core/client/remote_client.dart @@ -35,7 +35,8 @@ class RemoteClient { try { final model = fromJson(jsonDecode(response.body) as Map); return Right(model); - } catch (e) { + } catch (e, s) { + MqCrashlytics.report(e, s); return Left(ConvertExc(message: '$e')); } @@ -65,7 +66,8 @@ class RemoteClient { } else { return const Left(NetworkExc()); } - } catch (e) { + } catch (e, s) { + MqCrashlytics.report(e, s); log(e.toString()); return const Left(ServerExc(null)); } @@ -90,7 +92,8 @@ class RemoteClient { } else { return const Left(NetworkExc()); } - } catch (e) { + } catch (e, s) { + MqCrashlytics.report(e, s); log(e.toString()); return const Left(ServerExc(null)); } diff --git a/app/lib/core/core.dart b/app/lib/core/core.dart index 80838283..a6447555 100644 --- a/app/lib/core/core.dart +++ b/app/lib/core/core.dart @@ -1,6 +1,7 @@ export 'auth/soccial_auth.dart'; export 'client/network_client.dart'; export 'client/remote_client.dart'; +export 'crashlytics/mq_crashlytics.dart'; export 'either/either.dart'; export 'exceptions/network_exception.dart'; export 'exceptions/server_exception.dart'; diff --git a/app/lib/core/crashlytics/mq_crashlytics.dart b/app/lib/core/crashlytics/mq_crashlytics.dart new file mode 100644 index 00000000..64339fd5 --- /dev/null +++ b/app/lib/core/crashlytics/mq_crashlytics.dart @@ -0,0 +1,42 @@ +import 'package:firebase_crashlytics/firebase_crashlytics.dart'; +import 'package:flutter/material.dart'; + +@immutable +final class MqCrashlytics { + const MqCrashlytics._(); + + static void report( + dynamic exception, + StackTrace? stack, { + dynamic reason, + Iterable information = const [], + bool? printDetails, + bool fatal = false, + }) { + crashlytics.recordError( + exception, + stack, + reason: reason, + information: information, + printDetails: printDetails, + fatal: fatal, + ); + } + + static void recordFlutterError( + FlutterErrorDetails flutterErrorDetails, { + bool fatal = false, + }) { + crashlytics.recordFlutterError(flutterErrorDetails, fatal: fatal); + } + + static Future setUserIdentifier(String identifier) { + return crashlytics.setUserIdentifier(identifier); + } + + static Future setCrashlyticsCollectionEnabled({required bool enabled}) { + return crashlytics.setCrashlyticsCollectionEnabled(enabled); + } + + static FirebaseCrashlytics get crashlytics => FirebaseCrashlytics.instance; +} diff --git a/app/lib/core/launch/app_launch.dart b/app/lib/core/launch/app_launch.dart index 43e99609..c5d067fb 100644 --- a/app/lib/core/launch/app_launch.dart +++ b/app/lib/core/launch/app_launch.dart @@ -1,6 +1,7 @@ import 'dart:developer'; import 'package:flutter/material.dart'; +import 'package:my_quran/core/core.dart'; import 'package:url_launcher/url_launcher.dart'; @immutable @@ -18,6 +19,7 @@ final class AppLaunch { ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text(snackBarText))); } } catch (e, s) { + MqCrashlytics.report(e, s); log('launch Error: $e, \n launch StackTrace: $s'); } } @@ -36,6 +38,7 @@ final class AppLaunch { ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text(snackBarText))); } } catch (e, s) { + MqCrashlytics.report(e, s); log('launch Error: $e, \n launch StackTrace: $s'); } } @@ -54,6 +57,7 @@ final class AppLaunch { ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text(snackBarText))); } } catch (e, s) { + MqCrashlytics.report(e, s); log('launch Error: $e, \n launch StackTrace: $s'); } } @@ -69,6 +73,7 @@ final class AppLaunch { ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text(snackBarText))); } } catch (e, s) { + MqCrashlytics.report(e, s); log('launch Error: $e, \n launch StackTrace: $s'); } } diff --git a/app/lib/main.dart b/app/lib/main.dart index 701fd106..e348d689 100644 --- a/app/lib/main.dart +++ b/app/lib/main.dart @@ -2,7 +2,6 @@ import 'dart:developer'; import 'package:connectivity_plus/connectivity_plus.dart'; import 'package:firebase_core/firebase_core.dart'; -import 'package:firebase_crashlytics/firebase_crashlytics.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; @@ -25,12 +24,12 @@ Future main({AppConfig? appConfig}) async { options: DefaultFirebaseOptions.currentPlatform, ); - FlutterError.onError = (errorDetails) { - FirebaseCrashlytics.instance.recordFlutterFatalError(errorDetails); - }; + await MqCrashlytics.setCrashlyticsCollectionEnabled(enabled: kDebugMode); + + FlutterError.onError = MqCrashlytics.recordFlutterError; PlatformDispatcher.instance.onError = (error, stack) { - FirebaseCrashlytics.instance.recordError(error, stack, fatal: true); + MqCrashlytics.report(error, stack, fatal: true); return true; }; diff --git a/app/lib/modules/hatim/data/source/hatim_remote_data_source.dart b/app/lib/modules/hatim/data/source/hatim_remote_data_source.dart index 7441083d..46540fb4 100644 --- a/app/lib/modules/hatim/data/source/hatim_remote_data_source.dart +++ b/app/lib/modules/hatim/data/source/hatim_remote_data_source.dart @@ -25,7 +25,8 @@ class HatimRemoteDataSource { ); return res.fold((l) => throw l, (r) => r); - } catch (e) { + } catch (e, s) { + MqCrashlytics.report(e, s); throw Exception(e); } } diff --git a/app/lib/modules/hatim/presentation/bloc/hatim_bloc.dart b/app/lib/modules/hatim/presentation/bloc/hatim_bloc.dart index 2473d329..097f20ca 100644 --- a/app/lib/modules/hatim/presentation/bloc/hatim_bloc.dart +++ b/app/lib/modules/hatim/presentation/bloc/hatim_bloc.dart @@ -4,6 +4,7 @@ import 'dart:developer'; import 'package:equatable/equatable.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:meta/meta.dart'; +import 'package:my_quran/core/core.dart'; import 'package:my_quran/modules/hatim/hatim.dart'; part 'hatim_event.dart'; @@ -57,6 +58,7 @@ class HatimBloc extends Bloc { emit(state.copyWith(userPagesState: const HatimUserPagesLoading())); repo.sinkHatimUserPages(); } catch (e, s) { + MqCrashlytics.report(e, s); log('_onGetHatimDashBoardEvent: $e\n$s'); emit(state.copyWith(dashBoardState: HatimDashBoardFailed(Exception(e)))); } diff --git a/app/lib/modules/home/data/repository/home_repository_impl.dart b/app/lib/modules/home/data/repository/home_repository_impl.dart index 89c76800..21b0a7f2 100644 --- a/app/lib/modules/home/data/repository/home_repository_impl.dart +++ b/app/lib/modules/home/data/repository/home_repository_impl.dart @@ -1,6 +1,7 @@ import 'dart:developer'; import 'package:flutter/material.dart'; +import 'package:my_quran/core/core.dart'; import 'package:my_quran/modules/modules.dart'; @immutable @@ -19,7 +20,8 @@ final class HomeRepositoryImpl implements HomeRepository { final remoteData = await remoteDataSource.getRemoteData(token); await localDataSource.saveLocalData(remoteData); return _convertData(remoteData); - } catch (e) { + } catch (e, s) { + MqCrashlytics.report(e, s); log('HomeRepositoryImpl, getData error: $e'); return _convertData(localDataSource.getLocalData()); } diff --git a/app/lib/modules/home/presentation/cubit/home_cubit.dart b/app/lib/modules/home/presentation/cubit/home_cubit.dart index 63e45802..6bc205d7 100644 --- a/app/lib/modules/home/presentation/cubit/home_cubit.dart +++ b/app/lib/modules/home/presentation/cubit/home_cubit.dart @@ -15,7 +15,8 @@ class HomeCubit extends Cubit { try { final homeModel = await getHomeDataUseCase.execute(token); emit(HomeState(status: FetchStatus.success, homeModel: homeModel)); - } catch (_) { + } catch (e, s) { + MqCrashlytics.report(e, s); emit(const HomeState(status: FetchStatus.error)); } } diff --git a/app/lib/modules/home/presentation/view/home_view.dart b/app/lib/modules/home/presentation/view/home_view.dart index 4dbdeba5..9a5c2023 100644 --- a/app/lib/modules/home/presentation/view/home_view.dart +++ b/app/lib/modules/home/presentation/view/home_view.dart @@ -28,6 +28,9 @@ class _HomeViewState extends State { final homeCubit = context.read(); final authCubit = context.read(); if (homeCubit.state.status != FetchStatus.success && authCubit.state.user != null) { + MqCrashlytics.setUserIdentifier( + authCubit.state.user?.username ?? authCubit.state.user!.accessToken, + ); homeCubit.getData(authCubit.state.user!.accessToken); } super.initState(); diff --git a/app/lib/modules/quran_audio/logic/quran_audio_cubit.dart b/app/lib/modules/quran_audio/logic/quran_audio_cubit.dart index 3b9e8817..90c0012c 100644 --- a/app/lib/modules/quran_audio/logic/quran_audio_cubit.dart +++ b/app/lib/modules/quran_audio/logic/quran_audio_cubit.dart @@ -49,7 +49,8 @@ class QuranAudioCubit extends Cubit { .toList(), ); await player.setAudioSource(playList, initialIndex: 0, preload: false); - } catch (e) { + } catch (e, s) { + MqCrashlytics.report(e, s); emit(QuranAudioState(exception: e.toString())); } } diff --git a/app/lib/modules/read/presentation/view/pagination_view.dart b/app/lib/modules/read/presentation/view/pagination_view.dart index 75e01f48..9c35e744 100644 --- a/app/lib/modules/read/presentation/view/pagination_view.dart +++ b/app/lib/modules/read/presentation/view/pagination_view.dart @@ -4,6 +4,7 @@ import 'package:go_router/go_router.dart'; import 'package:infinite_scroll_pagination/infinite_scroll_pagination.dart'; import 'package:mq_ci_keys/mq_ci_keys.dart'; import 'package:my_quran/constants/contants.dart'; +import 'package:my_quran/core/core.dart'; import 'package:my_quran/utils/urils.dart'; import 'package:my_quran/app/app.dart'; import 'package:my_quran/l10n/l10.dart'; @@ -42,8 +43,9 @@ class _PaginationViewState extends State { final nextPageKey = page; _pagingController.appendPage([newItems!], nextPageKey); } - } catch (error) { - _pagingController.error = error; + } catch (e, s) { + MqCrashlytics.report(e, s); + _pagingController.error = e; } } diff --git a/scripts/pod_install.sh b/scripts/pod_install.sh new file mode 100755 index 00000000..23d6d526 --- /dev/null +++ b/scripts/pod_install.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +# Go to ios directory +cd app/ios + +# Install pods +pod install + +# Back to main directory +cd ../../ \ No newline at end of file