diff --git a/filcnaplo/build-ipa.sh b/filcnaplo/build-ipa.sh index 4ed678f..53b8712 100755 --- a/filcnaplo/build-ipa.sh +++ b/filcnaplo/build-ipa.sh @@ -1,3 +1,7 @@ #!/bin/sh +flutter clean +dart pub get +flutter doctor -v + flutter build ipa --release --dart-define=APPVER=$(cat pubspec.yaml | grep version: | cut -d' ' -f2 | cut -d+ -f1) --no-tree-shake-icons diff --git a/filcnaplo/ios/Runner/Runner.entitlements b/filcnaplo/ios/Runner/Runner.entitlements index 123fc6c..36e7279 100644 --- a/filcnaplo/ios/Runner/Runner.entitlements +++ b/filcnaplo/ios/Runner/Runner.entitlements @@ -2,6 +2,8 @@ + aps-environment + development com.apple.security.application-groups group.refilcnaplo.livecard diff --git a/filcnaplo/lib/api/login.dart b/filcnaplo/lib/api/login.dart index 0e2df02..9f3b2fd 100644 --- a/filcnaplo/lib/api/login.dart +++ b/filcnaplo/lib/api/login.dart @@ -57,15 +57,13 @@ Future loginApi({ String nonceStr = await Provider.of(context, listen: false) .getAPI(KretaAPI.nonce, json: false); - Nonce nonce = - getNonce(nonceStr, '${username.replaceAll(' ', '')} ', instituteCode); - headers.addAll(nonce.header()); + Nonce nonce = getNonce(nonceStr, username, instituteCode); Map? res = await Provider.of(context, listen: false) .postAPI(KretaAPI.login, headers: headers, body: User.loginBody( - username: '${username.replaceAll(' ', '')} ', + username: username, password: password, instituteCode: instituteCode, )); @@ -84,7 +82,7 @@ Future loginApi({ .getAPI(KretaAPI.student(instituteCode)); Student student = Student.fromJson(studentJson!); var user = User( - username: '${username.replaceAll(' ', '')} ', + username: username, password: password, instituteCode: instituteCode, name: student.name, diff --git a/filcnaplo/lib/main.dart b/filcnaplo/lib/main.dart index 9f62e1e..9f5c788 100644 --- a/filcnaplo/lib/main.dart +++ b/filcnaplo/lib/main.dart @@ -1,3 +1,5 @@ +import 'dart:io'; + import 'package:background_fetch/background_fetch.dart'; import 'package:filcnaplo/api/providers/user_provider.dart'; import 'package:filcnaplo/api/providers/database_provider.dart'; @@ -53,26 +55,32 @@ class Startup { FlutterLocalNotificationsPlugin(); // Get permission to show notifications - flutterLocalNotificationsPlugin - .resolvePlatformSpecificImplementation< + if (Platform.isAndroid) { + await flutterLocalNotificationsPlugin + .resolvePlatformSpecificImplementation< AndroidFlutterLocalNotificationsPlugin>()! - .requestPermission(); - await flutterLocalNotificationsPlugin - .resolvePlatformSpecificImplementation< - IOSFlutterLocalNotificationsPlugin>() - ?.requestPermissions( - alert: false, - badge: true, - sound: true, - ); - await flutterLocalNotificationsPlugin - .resolvePlatformSpecificImplementation< - MacOSFlutterLocalNotificationsPlugin>() - ?.requestPermissions( - alert: false, - badge: true, - sound: true, - ); + .requestPermission(); + } + else if (Platform.isIOS) { + await flutterLocalNotificationsPlugin + .resolvePlatformSpecificImplementation< + IOSFlutterLocalNotificationsPlugin>() + ?.requestPermissions( + alert: false, + badge: true, + sound: true, + ); + } + else if (Platform.isMacOS) { + await flutterLocalNotificationsPlugin + .resolvePlatformSpecificImplementation< + MacOSFlutterLocalNotificationsPlugin>() + ?.requestPermissions( + alert: false, + badge: true, + sound: true, + ); + } // Platform specific settings final DarwinInitializationSettings initializationSettingsDarwin = diff --git a/filcnaplo/pubspec.yaml b/filcnaplo/pubspec.yaml index 5cf60ff..23ad74a 100644 --- a/filcnaplo/pubspec.yaml +++ b/filcnaplo/pubspec.yaml @@ -48,7 +48,7 @@ dependencies: crypto: ^3.0.2 elegant_notification: ^1.6.1 flutter_feather_icons: ^2.0.0+1 - live_activities: ^1.0.0 + live_activities: ^1.7.4 animated_flip_counter: ^0.2.5 lottie: ^1.4.3 rive: ^0.9.1 diff --git a/filcnaplo_kreta_api/lib/client/client.dart b/filcnaplo_kreta_api/lib/client/client.dart index a859479..9910d60 100644 --- a/filcnaplo_kreta_api/lib/client/client.dart +++ b/filcnaplo_kreta_api/lib/client/client.dart @@ -169,7 +169,7 @@ class KretaClient { Map? loginRes = await postAPI(KretaAPI.login, headers: headers, body: User.loginBody( - username: loginUser.username.replaceAll(' ', '') + ' ', + username: loginUser.username, password: loginUser.password, instituteCode: loginUser.instituteCode, )); diff --git a/filcnaplo_mobile_ui/lib/pages/grades/grade_subject_view.dart b/filcnaplo_mobile_ui/lib/pages/grades/grade_subject_view.dart index a260e28..a638637 100755 --- a/filcnaplo_mobile_ui/lib/pages/grades/grade_subject_view.dart +++ b/filcnaplo_mobile_ui/lib/pages/grades/grade_subject_view.dart @@ -280,7 +280,7 @@ class _GradeSubjectViewState extends State { void gradeCalc(BuildContext context) { // Scroll to the top of the page - _scrollController.animateTo(75, + _scrollController.animateTo(100, duration: const Duration(milliseconds: 500), curve: Curves.ease); calculatorProvider.clear();