From 326b72a817fd5cda7cb8ded014920a276ea58843 Mon Sep 17 00:00:00 2001 From: Miller Adulu Date: Wed, 28 Aug 2024 01:41:49 +0300 Subject: [PATCH] Add logs --- android/settings.gradle | 2 +- ios/Runner.xcodeproj/project.pbxproj | 38 +++++++++++----------- lib/common/repository/auth_repository.dart | 11 +++++++ 3 files changed, 31 insertions(+), 20 deletions(-) diff --git a/android/settings.gradle b/android/settings.gradle index 45466d4..2063c48 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -21,7 +21,7 @@ plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" id "com.android.application" version "7.3.0" apply false // START: FlutterFire Configuration - id "com.google.gms.google-services" version "4.3.15" apply false + id "com.google.gms.google-services" version "4.4.2" apply false id "com.google.firebase.crashlytics" version "2.8.1" apply false // END: FlutterFire Configuration id "org.jetbrains.kotlin.android" version "2.0.10" apply false diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 086034d..253c3b5 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -226,7 +226,7 @@ 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 14E3FE9DEF97E062EC966A08 /* [CP] Embed Pods Frameworks */, E33879E44333D33EE3240A50 /* [CP] Copy Pods Resources */, - 9095D3DE9DE0B68E60F8EFF4 /* FlutterFire: "flutterfire upload-crashlytics-symbols" */, + EB31C9D284995D4ABA707977 /* FlutterFire: "flutterfire upload-crashlytics-symbols" */, ); buildRules = ( ); @@ -354,24 +354,6 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; }; - 9095D3DE9DE0B68E60F8EFF4 /* 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"; - }; 918393D15F920ACF475A28B1 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -426,6 +408,24 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; showEnvVarsInLog = 0; }; + EB31C9D284995D4ABA707977 /* 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"; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ diff --git a/lib/common/repository/auth_repository.dart b/lib/common/repository/auth_repository.dart index d8c2b38..e8d1732 100644 --- a/lib/common/repository/auth_repository.dart +++ b/lib/common/repository/auth_repository.dart @@ -1,6 +1,9 @@ +import 'dart:io'; + import 'package:firebase_auth/firebase_auth.dart'; import 'package:fluttercon/common/data/models/models.dart'; import 'package:fluttercon/common/utils/network.dart'; +import 'package:fluttercon/firebase_options.dart'; import 'package:google_sign_in/google_sign_in.dart'; import 'package:injectable/injectable.dart'; import 'package:logger/logger.dart'; @@ -16,6 +19,9 @@ class AuthRepository { 'profile', 'email', ], + clientId: Platform.isAndroid + ? DefaultFirebaseOptions.android.iosClientId + : DefaultFirebaseOptions.ios.iosClientId, ); Future signInWithGoogle() async { @@ -35,11 +41,16 @@ class AuthRepository { if (user != null) { assert(!user.isAnonymous, 'User must not be anonymous'); + if (user.isAnonymous) { + throw Failure(message: 'User must not be anonymous'); + } return Future.value(authResult.credential?.accessToken); } else { throw Failure(message: 'An unexpected error occured'); } } catch (e) { + Logger().d(DefaultFirebaseOptions.ios.androidClientId); + Logger().e(e); rethrow; } }