diff --git a/.github/workflows/android_build.yml b/.github/workflows/android_build.yml index 2c258aa6..bc43ce91 100644 --- a/.github/workflows/android_build.yml +++ b/.github/workflows/android_build.yml @@ -1,10 +1,12 @@ name: Android Build APK -on: - workflow_dispatch: - push: - branches: - - main +#on: +# workflow_dispatch: +# push: +# branches: +# - main + +on: push jobs: diff --git a/.github/workflows/android_deploy.yml b/.github/workflows/android_deploy.yml index 89feb390..d04693cc 100644 --- a/.github/workflows/android_deploy.yml +++ b/.github/workflows/android_deploy.yml @@ -1,10 +1,12 @@ name: Publish to Google Play Store -on: - push: - branches: - - main - workflow_dispatch: +#on: +# push: +# branches: +# - main +# workflow_dispatch: + +on: push jobs: diff --git a/.github/workflows/ios_deploy.yml b/.github/workflows/ios_deploy.yml index 83436038..7e9aa953 100644 --- a/.github/workflows/ios_deploy.yml +++ b/.github/workflows/ios_deploy.yml @@ -83,9 +83,8 @@ jobs: buildName="${versionValue[0]}.${versionValue[1]}.${{ github.run_number }}" echo "Generating iOS build $buildName $buildNumber" flutter build ipa --release --build-number=$buildNumber --build-name=$buildName --export-options-plist=$HOME/export_options.plist -# echo "Uploading dSYM to Crashlytics" -# ios/Pods/FirebaseCrashlytics/upload-symbols -gsp ios/Runner/GoogleService-Info.plist -p ios /ios/archive/kelo.xcarchive/dSYMs - + echo "Uploading dSYM to Crashlytics" + ios/Pods/FirebaseCrashlytics/upload-symbols -gsp ios/Runner/GoogleService-Info.plist -p ios build/ios/archive/Runner.xcarchive/dSYMs - name: Publish the app to App Store Connect run: | diff --git a/khelo/android/app/build.gradle b/khelo/android/app/build.gradle index bf23c694..a8f22337 100644 --- a/khelo/android/app/build.gradle +++ b/khelo/android/app/build.gradle @@ -46,7 +46,7 @@ android { applicationId "com.canopas.khelo" // You can update the following values to match your application needs. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. - minSdkVersion 21 + minSdkVersion 23 targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() versionName flutterVersionName diff --git a/khelo/ios/Podfile.lock b/khelo/ios/Podfile.lock index c0a1f007..b701f0ff 100644 --- a/khelo/ios/Podfile.lock +++ b/khelo/ios/Podfile.lock @@ -963,6 +963,9 @@ PODS: - FirebaseAuth (~> 10.27.0) - Firebase/CoreOnly (10.27.0): - FirebaseCore (= 10.27.0) + - Firebase/Crashlytics (10.27.0): + - Firebase/CoreOnly + - FirebaseCrashlytics (~> 10.27.0) - Firebase/Firestore (10.27.0): - Firebase/CoreOnly - FirebaseFirestore (~> 10.27.0) @@ -976,6 +979,10 @@ PODS: - firebase_core (3.0.0): - Firebase/CoreOnly (= 10.27.0) - Flutter + - firebase_crashlytics (4.0.0): + - Firebase/Crashlytics (= 10.27.0) + - firebase_core + - Flutter - firebase_storage (12.0.0): - Firebase/Storage (= 10.27.0) - firebase_core @@ -997,6 +1004,15 @@ PODS: - FirebaseCore (~> 10.0) - FirebaseCoreInternal (10.27.0): - "GoogleUtilities/NSData+zlib (~> 7.8)" + - FirebaseCrashlytics (10.27.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) - FirebaseFirestore (10.27.0): - FirebaseCore (~> 10.0) - FirebaseCoreExtension (~> 10.0) @@ -1017,6 +1033,21 @@ PODS: - gRPC-Core (~> 1.62.0) - leveldb-library (~> 1.22) - nanopb (< 2.30911.0, >= 2.30908.0) + - FirebaseInstallations (10.27.0): + - FirebaseCore (~> 10.0) + - GoogleUtilities/Environment (~> 7.8) + - GoogleUtilities/UserDefaults (~> 7.8) + - PromisesObjC (~> 2.1) + - FirebaseRemoteConfigInterop (10.27.0) + - FirebaseSessions (10.27.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) - FirebaseSharedSwift (10.27.0) - FirebaseStorage (10.27.0): - FirebaseAppCheckInterop (~> 10.0) @@ -1031,6 +1062,10 @@ PODS: - fluttertoast (0.0.2): - Flutter - Toast + - GoogleDataTransport (9.4.1): + - GoogleUtilities/Environment (~> 7.7) + - nanopb (< 2.30911.0, >= 2.30908.0) + - PromisesObjC (< 3.0, >= 1.2) - GoogleUtilities/AppDelegateSwizzler (7.13.3): - GoogleUtilities/Environment - GoogleUtilities/Logger @@ -1053,6 +1088,9 @@ PODS: - GoogleUtilities/Reachability (7.13.3): - GoogleUtilities/Logger - GoogleUtilities/Privacy + - GoogleUtilities/UserDefaults (7.13.3): + - GoogleUtilities/Logger + - GoogleUtilities/Privacy - "gRPC-C++ (1.62.5)": - "gRPC-C++/Implementation (= 1.62.5)" - "gRPC-C++/Interface (= 1.62.5)" @@ -1149,6 +1187,8 @@ PODS: - Flutter - FlutterMacOS - PromisesObjC (2.4.0) + - PromisesSwift (2.4.0): + - PromisesObjC (= 2.4.0) - RecaptchaInterop (100.0.0) - shared_preferences_foundation (0.0.1): - Flutter @@ -1164,6 +1204,7 @@ DEPENDENCIES: - device_info_plus (from `.symlinks/plugins/device_info_plus/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`) - firebase_storage (from `.symlinks/plugins/firebase_storage/ios`) - Flutter (from `Flutter`) - flutter_timezone (from `.symlinks/plugins/flutter_timezone/ios`) @@ -1186,10 +1227,15 @@ SPEC REPOS: - FirebaseCore - FirebaseCoreExtension - FirebaseCoreInternal + - FirebaseCrashlytics - FirebaseFirestore - FirebaseFirestoreInternal + - FirebaseInstallations + - FirebaseRemoteConfigInterop + - FirebaseSessions - FirebaseSharedSwift - FirebaseStorage + - GoogleDataTransport - GoogleUtilities - "gRPC-C++" - gRPC-Core @@ -1197,6 +1243,7 @@ SPEC REPOS: - leveldb-library - nanopb - PromisesObjC + - PromisesSwift - RecaptchaInterop - Toast - TOCropViewController @@ -1210,6 +1257,8 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/firebase_auth/ios" firebase_core: :path: ".symlinks/plugins/firebase_core/ios" + firebase_crashlytics: + :path: ".symlinks/plugins/firebase_crashlytics/ios" firebase_storage: :path: ".symlinks/plugins/firebase_storage/ios" Flutter: @@ -1239,6 +1288,7 @@ SPEC CHECKSUMS: Firebase: 26b040b20866a55f55eb3611b9fcf3ae64816b86 firebase_auth: 17ce83d25a062b2a594e5dfce91a4ad36e3739d5 firebase_core: 5926464bbb028fef87d2443369b73ada2a8a3608 + firebase_crashlytics: fd7d916778823b47ca742a7cbd552c9520da1f1c firebase_storage: ff66671828d524fc9e36f30cd7ed1909036324c7 FirebaseAppCheckInterop: 0dd062c9926a76332ca5711dbed6f1a9ac540b54 FirebaseAuth: 77a012b7e08042bf44d0db835ca2e86e6ca7bbd3 @@ -1246,13 +1296,18 @@ SPEC CHECKSUMS: FirebaseCore: a2b95ae4ce7c83ceecfbbbe3b6f1cddc7415a808 FirebaseCoreExtension: 4ec89dd0c6de93d6becde32122d68b7c35f6bf5d FirebaseCoreInternal: 4b297a2d56063dbea2c1d0d04222d44a8d058862 + FirebaseCrashlytics: 81ea6ec96519388687f6061beb838a8eec482293 FirebaseFirestore: 7169b75e7db8f9796d4130e3c2157ed444f100d4 FirebaseFirestoreInternal: 7ba63f170a554ae49392da44f9430e5b7915a7ff + FirebaseInstallations: 766dabca09fd94aef922538aaf144cc4a6fb6869 + FirebaseRemoteConfigInterop: c55a739f5ab121792776e191d9fd437dc624a541 + FirebaseSessions: 2fdf949f9e58295a57703ae8f2efc44f9fa3aa16 FirebaseSharedSwift: a03fe7a59ee646fef71099a887f774fe25d745b8 FirebaseStorage: 255526c3d04c49874d7a5e3886964a79f77d6f33 Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 flutter_timezone: ffb07bdad3c6276af8dada0f11978d8a1f8a20bb fluttertoast: e9a18c7be5413da53898f660530c56f35edfba9c + GoogleDataTransport: 6c09b596d841063d76d4288cc2d2f42cc36e1e2a GoogleUtilities: ea963c370a38a8069cc5f7ba4ca849a60b6d7d15 "gRPC-C++": e725ef63c4475d7cdb7e2cf16eb0fde84bd9ee51 gRPC-Core: eee4be35df218649fe66d721a05a7f27a28f069b @@ -1264,6 +1319,7 @@ SPEC CHECKSUMS: package_info_plus: 58f0028419748fad15bf008b270aaa8e54380b1c path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46 PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47 + PromisesSwift: 9d77319bbe72ebf6d872900551f7eeba9bce2851 RecaptchaInterop: 7d1a4a01a6b2cb1610a47ef3f85f0c411434cb21 shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78 sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec diff --git a/khelo/ios/Runner.xcodeproj/project.pbxproj b/khelo/ios/Runner.xcodeproj/project.pbxproj index 644c1fe0..02cbcd14 100644 --- a/khelo/ios/Runner.xcodeproj/project.pbxproj +++ b/khelo/ios/Runner.xcodeproj/project.pbxproj @@ -718,7 +718,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.canopas.khelo; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; - "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "provision-khelo-distribution-2024-05-16"; + "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "provision-khelo-distribution-2024-06-12"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; diff --git a/khelo/ios/Runner/AppDelegate.swift b/khelo/ios/Runner/AppDelegate.swift index 70693e4a..e087d038 100644 --- a/khelo/ios/Runner/AppDelegate.swift +++ b/khelo/ios/Runner/AppDelegate.swift @@ -1,5 +1,7 @@ import UIKit import Flutter +import Firebase +import FirebaseAuth @UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { @@ -7,7 +9,21 @@ import Flutter _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? ) -> Bool { + FirebaseApp.configure() GeneratedPluginRegistrant.register(with: self) return super.application(application, didFinishLaunchingWithOptions: launchOptions) } + + override func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) { + let firebaseAuth = Auth.auth() + firebaseAuth.setAPNSToken(deviceToken, type: AuthAPNSTokenType.unknown) + } + + override func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) { + let firebaseAuth = Auth.auth() + if (firebaseAuth.canHandleNotification(userInfo)){ + print(userInfo) + return + } + } } diff --git a/khelo/ios/Runner/ExportOptions.plist b/khelo/ios/Runner/ExportOptions.plist index d046a1ea..e4b2e035 100644 --- a/khelo/ios/Runner/ExportOptions.plist +++ b/khelo/ios/Runner/ExportOptions.plist @@ -10,7 +10,7 @@ 74a6f92b-75d4-4c72-b610-435ae643721f signingCertificate - 1EDB213DC565912BC6BC866ADEBF192575C633DC + Apple Distribution signingStyle manual stripSwiftSymbols diff --git a/khelo/ios/Runner/Info.plist b/khelo/ios/Runner/Info.plist index ee12496c..22703378 100644 --- a/khelo/ios/Runner/Info.plist +++ b/khelo/ios/Runner/Info.plist @@ -30,6 +30,7 @@ CFBundleURLSchemes app-1-753506519474-ios-8cd38557e090c0b51e7cab + com.googleusercontent.apps.753506519474-6qolf71653023s197ur4ag97q2lvaf9r diff --git a/khelo/ios/Runner/RunnerRelease.entitlements b/khelo/ios/Runner/RunnerRelease.entitlements index 903def2a..98ff2408 100644 --- a/khelo/ios/Runner/RunnerRelease.entitlements +++ b/khelo/ios/Runner/RunnerRelease.entitlements @@ -3,6 +3,6 @@ aps-environment - development + unknown diff --git a/khelo/lib/main.dart b/khelo/lib/main.dart index 425a9fe0..37b8449e 100644 --- a/khelo/lib/main.dart +++ b/khelo/lib/main.dart @@ -1,4 +1,5 @@ import 'package:data/storage/provider/preferences_provider.dart'; +import 'package:firebase_crashlytics/firebase_crashlytics.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:firebase_core/firebase_core.dart'; @@ -20,7 +21,7 @@ Future _initContainer() async { ); if (!kDebugMode) { - // await FirebaseCrashlytics.instance.setCrashlyticsCollectionEnabled(true); + await FirebaseCrashlytics.instance.setCrashlyticsCollectionEnabled(true); } final prefs = await SharedPreferences.getInstance(); diff --git a/khelo/lib/ui/flow/my_game/my_game_tab_screen.dart b/khelo/lib/ui/flow/my_game/my_game_tab_screen.dart index d3ffc048..73d9de48 100644 --- a/khelo/lib/ui/flow/my_game/my_game_tab_screen.dart +++ b/khelo/lib/ui/flow/my_game/my_game_tab_screen.dart @@ -146,8 +146,7 @@ class _MyGameTabScreenState extends ConsumerState return LargeIconButton( backgroundColor: context.colorScheme.primary, onTap: () async { - // AppRoute.addMatch().push(context); - // FirebaseCrashlytics.instance.crash(); + AppRoute.addMatch().push(context); }, icon: Icon( Icons.add_rounded, diff --git a/khelo/lib/ui/flow/sign_in/sign_in_with_phone/sign_in_with_phone_view_model.dart b/khelo/lib/ui/flow/sign_in/sign_in_with_phone/sign_in_with_phone_view_model.dart index 5963f428..b908819e 100644 --- a/khelo/lib/ui/flow/sign_in/sign_in_with_phone/sign_in_with_phone_view_model.dart +++ b/khelo/lib/ui/flow/sign_in/sign_in_with_phone/sign_in_with_phone_view_model.dart @@ -1,6 +1,7 @@ import 'package:canopas_country_picker/canopas_country_picker.dart'; import 'package:data/service/auth/auth_service.dart'; import 'package:data/service/device/device_service.dart'; +import 'package:firebase_crashlytics/firebase_crashlytics.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; @@ -67,9 +68,9 @@ class SignInWithPhoneViewNotifier extends StateNotifier { state = state.copyWith(verifying: false, signInSuccess: true); }, onVerificationFailed: (error) { - // FirebaseCrashlytics.instance.recordError(error, error.stackTrace, - // reason: "Verify Phone-Number Error", - // information: [error.statusCode ?? "", error.message ?? ""]); + FirebaseCrashlytics.instance.recordError(error, error.stackTrace, + reason: "Verify Phone-Number Error", + information: [error.statusCode ?? "", error.message ?? ""]); state = state.copyWith(verifying: false, actionError: error); debugPrint( "SignInWithPhoneViewNotifier: error in verifyPhoneNumber -> $error"); @@ -78,10 +79,12 @@ class SignInWithPhoneViewNotifier extends StateNotifier { state = state.copyWith( verificationId: verificationId, verifying: false); }); - } catch (e) { - state = state.copyWith(verifying: false, actionError: e); + } catch (error, stack) { + FirebaseCrashlytics.instance + .recordError(error, stack, reason: "Verify Phone-Number Error"); + state = state.copyWith(verifying: false, actionError: error); debugPrint( - "SignInWithPhoneViewNotifier: error in verifyPhoneNumber -> $e"); + "SignInWithPhoneViewNotifier: error in verifyPhoneNumber -> $error"); } } } diff --git a/khelo/macos/Flutter/GeneratedPluginRegistrant.swift b/khelo/macos/Flutter/GeneratedPluginRegistrant.swift index 481fc0b5..ae3d9887 100644 --- a/khelo/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/khelo/macos/Flutter/GeneratedPluginRegistrant.swift @@ -10,6 +10,7 @@ import device_info_plus import file_selector_macos import firebase_auth import firebase_core +import firebase_crashlytics import firebase_storage import flutter_timezone import package_info_plus @@ -23,6 +24,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin")) 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")) FlutterTimezonePlugin.register(with: registry.registrar(forPlugin: "FlutterTimezonePlugin")) FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin")) diff --git a/khelo/macos/Runner.xcodeproj/project.pbxproj b/khelo/macos/Runner.xcodeproj/project.pbxproj index a3cbfbdc..12667444 100644 --- a/khelo/macos/Runner.xcodeproj/project.pbxproj +++ b/khelo/macos/Runner.xcodeproj/project.pbxproj @@ -212,7 +212,6 @@ 33CC10EB2044A3C60003C045 /* Resources */, 33CC110E2044A8840003C045 /* Bundle Framework */, 3399D490228B24CF009A79C7 /* ShellScript */, - 419246AC32827AD35B79802B /* FlutterFire: "flutterfire upload-crashlytics-symbols" */, ); buildRules = ( ); @@ -333,24 +332,6 @@ shellPath = /bin/sh; shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; }; - 419246AC32827AD35B79802B /* 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=macos --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/khelo/macos/firebase_app_id_file.json b/khelo/macos/firebase_app_id_file.json deleted file mode 100644 index 9162fef5..00000000 --- a/khelo/macos/firebase_app_id_file.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "file_generated_by": "FlutterFire CLI", - "purpose": "FirebaseAppID & ProjectID for this Firebase app in this directory", - "GOOGLE_APP_ID": "1:92999931839:ios:984233dbd06405beac330a", - "FIREBASE_PROJECT_ID": "khelo-dev-8040e", - "GCM_SENDER_ID": "92999931839" -} \ No newline at end of file diff --git a/khelo/pubspec.lock b/khelo/pubspec.lock index 915aaa1e..587abcfc 100644 --- a/khelo/pubspec.lock +++ b/khelo/pubspec.lock @@ -464,6 +464,22 @@ packages: url: "https://pub.dev" source: hosted version: "2.17.1" + firebase_crashlytics: + dependency: "direct main" + description: + name: firebase_crashlytics + sha256: bc95715ae12f885a77a7f8d13eeee2e8cb3ea26c2b466c590f8cf4f5645a23b7 + url: "https://pub.dev" + source: hosted + version: "4.0.0" + firebase_crashlytics_platform_interface: + dependency: transitive + description: + name: firebase_crashlytics_platform_interface + sha256: fdee44039a994250577179d792060ac9a0a211ee186e2ec59ef2007a138ba30f + url: "https://pub.dev" + source: hosted + version: "3.6.36" firebase_storage: dependency: "direct main" description: diff --git a/khelo/pubspec.yaml b/khelo/pubspec.yaml index 67d5a340..2138ec67 100644 --- a/khelo/pubspec.yaml +++ b/khelo/pubspec.yaml @@ -62,6 +62,7 @@ dependencies: firebase_auth: ^5.0.0 firebase_storage: ^12.0.0 cloud_firestore: ^5.0.0 + firebase_crashlytics: ^4.0.0 # state management flutter_riverpod: ^2.5.1