diff --git a/lib/app_state/app_state.dart b/lib/app_state/app_state.dart index 2b05306..ea7b85e 100644 --- a/lib/app_state/app_state.dart +++ b/lib/app_state/app_state.dart @@ -77,7 +77,7 @@ class AppState { bool get getIsDemoMarathon => _isDemoMarathon; - final PostParamsModel _postParamsInitConfig = PostParamsModel(channel: 31, versionID: 3.9, mobileType: Platform.isAndroid ? "android" : "ios"); + final PostParamsModel _postParamsInitConfig = PostParamsModel(channel: 31, versionID: 4.0, mobileType: Platform.isAndroid ? "android" : "ios"); void setPostParamsInitConfig() { isAuthenticated = false; diff --git a/lib/ui/login/login_screen.dart b/lib/ui/login/login_screen.dart index 470a57d..69750fa 100644 --- a/lib/ui/login/login_screen.dart +++ b/lib/ui/login/login_screen.dart @@ -95,6 +95,12 @@ class _LoginScreenState extends State { try { Utils.showLoading(context); await Firebase.initializeApp(); + // await FirebaseMessaging.instance.setForegroundNotificationPresentationOptions( + // alert: true, + // badge: true, + // sound: true, + // ); + // await FirebaseMessaging.instance.requestPermission(); _firebaseMessaging = FirebaseMessaging.instance; firebaseToken = await _firebaseMessaging.getToken(); AppNotifications().init(firebaseToken); @@ -166,8 +172,8 @@ class _LoginScreenState extends State { isAppOpenBySystem = (ModalRoute.of(context)!.settings.arguments ?? true) as bool; if (!kReleaseMode) { // username.text = "15444"; // Maha User - username.text = "15153"; // Tamer User - password.text = "Abcd@12345"; + // username.text = "15153"; // Tamer User + // password.text = "Abcd@12345"; // username.text = "206535"; // Hashim User // password.text = "Namira786"; diff --git a/lib/ui/login/verify_last_login_screen.dart b/lib/ui/login/verify_last_login_screen.dart index cfa808a..30feb71 100644 --- a/lib/ui/login/verify_last_login_screen.dart +++ b/lib/ui/login/verify_last_login_screen.dart @@ -324,20 +324,22 @@ class _VerifyLastLoginScreenState extends State { Future performApiCall(String _title, String _icon, int _flag, int sendVerificationFlat, {bool isDirectLogin = false}) async { try { - if (isDirectLogin) + if (isDirectLogin) { setState(() { Utils.showLoading(context); }); - else + } else { Utils.showLoading(context); + } await LoginApiClient().checkMobileAppVersion(); await LoginApiClient().memberLogin(AppState().getUserName!, AppState().password!); - if (!isDirectLogin) + if (!isDirectLogin) { BasicMemberInformationModel? memberInformationModel = await LoginApiClient().mohemmSendActivationCodeByOTPNotificationType(0, AppState().memberLoginList?.pMOBILENUMBER, sendVerificationFlat, AppState().getUserName); + } if (isDirectLogin) performDirectApiCall(_title, _icon, _flag, "", null); if (!isDirectLogin) Utils.hideLoading(context); - if (!isDirectLogin) + if (!isDirectLogin) { OtpDialog( context, sendVerificationFlat, @@ -353,6 +355,7 @@ class _VerifyLastLoginScreenState extends State { performApiCall(_title, _icon, _flag, sendVerificationFlat, isDirectLogin: isDirectLogin); }, ).displayDialog(context); + } } catch (ex) { Utils.hideLoading(context); Utils.handleException(ex, context, null); @@ -372,6 +375,7 @@ class _VerifyLastLoginScreenState extends State { mobileLoginInfoListModel!.deviceToken!, Platform.isAndroid ? "android" : "ios"); AppState().setMemberInformationListModel = genericResponseModel!.memberInformationList?.first; + AppState().setPrivilegeListModel = genericResponseModel!.privilegeList ?? []; if (genericResponseModel.errorMessage != null) { Utils.showToast(genericResponseModel.errorMessage ?? ""); // Navigator.pop(context);