diff --git a/GoogleService-Info.plist b/GoogleService-Info.plist new file mode 100644 index 0000000..ea61788 --- /dev/null +++ b/GoogleService-Info.plist @@ -0,0 +1,36 @@ + + + + + CLIENT_ID + 448880075189-tcgggmh2ua9tsmdr97c1ttcgrmf5kg5m.apps.googleusercontent.com + REVERSED_CLIENT_ID + com.googleusercontent.apps.448880075189-tcgggmh2ua9tsmdr97c1ttcgrmf5kg5m + API_KEY + AIzaSyB--KUTUYVpcdxpETCEsdhKs5cV3QawW7Q + GCM_SENDER_ID + 448880075189 + PLIST_VERSION + 1 + BUNDLE_ID + com.cloudsolutions.alhabibmohemm + PROJECT_ID + al-habib-mohemm + STORAGE_BUCKET + al-habib-mohemm.appspot.com + IS_ADS_ENABLED + + IS_ANALYTICS_ENABLED + + IS_APPINVITE_ENABLED + + IS_GCM_ENABLED + + IS_SIGNIN_ENABLED + + GOOGLE_APP_ID + 1:448880075189:ios:c6fd2b86fe7b388088b9fc + DATABASE_URL + https://al-habib-mohemm.firebaseio.com + + \ No newline at end of file diff --git a/HMG FOLDER/key.jks b/HMG FOLDER/key.jks new file mode 100644 index 0000000..f63c61a Binary files /dev/null and b/HMG FOLDER/key.jks differ diff --git a/HMG FOLDER/resources/README.md b/HMG FOLDER/resources/README.md new file mode 100644 index 0000000..90b8318 --- /dev/null +++ b/HMG FOLDER/resources/README.md @@ -0,0 +1,8 @@ +These are Cordova resources. You can replace icon.png and splash.png and run +`ionic cordova resources` to generate custom icons and splash screens for your +app. See `ionic cordova resources --help` for details. + +Cordova reference documentation: + +- Icons: https://cordova.apache.org/docs/en/latest/config_ref/images.html +- Splash Screens: https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-splashscreen/ diff --git a/HMG FOLDER/resources/icon.png b/HMG FOLDER/resources/icon.png new file mode 100644 index 0000000..4b8870e Binary files /dev/null and b/HMG FOLDER/resources/icon.png differ diff --git a/HMG FOLDER/resources/splash.png b/HMG FOLDER/resources/splash.png new file mode 100644 index 0000000..0f51e71 Binary files /dev/null and b/HMG FOLDER/resources/splash.png differ diff --git a/agconnect-services.json b/agconnect-services.json new file mode 100644 index 0000000..d3d3224 --- /dev/null +++ b/agconnect-services.json @@ -0,0 +1,57 @@ +{ + "agcgw_all":{ + "CN":"connect-drcn.dbankcloud.cn", + "CN_back":"connect-drcn.hispace.hicloud.com", + "DE":"connect-dre.dbankcloud.cn", + "DE_back":"connect-dre.hispace.hicloud.com", + "RU":"connect-drru.hispace.dbankcloud.ru", + "RU_back":"connect-drru.hispace.dbankcloud.cn", + "SG":"connect-dra.dbankcloud.cn", + "SG_back":"connect-dra.hispace.hicloud.com" + }, + "websocketgw_all":{ + "CN":"connect-ws-drcn.hispace.dbankcloud.cn", + "CN_back":"connect-ws-drcn.hispace.dbankcloud.com", + "DE":"connect-ws-dre.hispace.dbankcloud.cn", + "DE_back":"connect-ws-dre.hispace.dbankcloud.com", + "RU":"connect-ws-drru.hispace.dbankcloud.ru", + "RU_back":"connect-ws-drru.hispace.dbankcloud.cn", + "SG":"connect-ws-dra.hispace.dbankcloud.cn", + "SG_back":"connect-ws-dra.hispace.dbankcloud.com" + }, + "client":{ + "cp_id":"2640966000002322881", + "product_id":"737518067793556928", + "client_id":"715220003200189504", + "client_secret":"E856B50CB99E8ECCE8CEF05B5D09DC8F9905B8E194563EC2EA7BABC03C522DBB", + "project_id":"737518067793556928", + "app_id":"104732599", + "api_key":"DAEDABdE+co8zJWzDdPZKxRNpRW0bkERH0lfu32jI7xJ1A/phqLDyDN0cwvZgmL7CwTe1vWryhetKjHSJ8UkPR3Iym+TGTBW6JCa8A==", + "package_name":"com.cloudsolutions.alhabibmohemm" + }, + "oauth_client":{ + "client_id":"104732599", + "client_type":1 + }, + "app_info":{ + "app_id":"104732599", + "package_name":"com.cloudsolutions.alhabibmohemm" + }, + "configuration_version":"3.0", + "appInfos":[ + { + "package_name":"com.cloudsolutions.alhabibmohemm", + "client":{ + "app_id":"104732599" + }, + "app_info":{ + "package_name":"com.cloudsolutions.alhabibmohemm", + "app_id":"104732599" + }, + "oauth_client":{ + "client_type":1, + "client_id":"104732599" + } + } + ] +} \ No newline at end of file diff --git a/android/app/agconnect-services.json b/android/app/agconnect-services.json index 20a7546..86d1c79 100644 --- a/android/app/agconnect-services.json +++ b/android/app/agconnect-services.json @@ -27,7 +27,7 @@ "project_id":"737518067793559971", "app_id":"104737117", "api_key":"DAEDACKDrYgyco9mjPV9ZUjCSh1kCr/GBV0nseHH0z2mnxlZ41RksOKmyTi+PUTwmGEPK+VxCup4F9oUf4VbDnCsjB7aNBShYcjR+g==", - "package_name":"hmg.cloudSolutions.mohem" + "package_name":"com.cloudsolutions.alhabibmohemm" }, "oauth_client":{ "client_id":"104737117", @@ -35,17 +35,17 @@ }, "app_info":{ "app_id":"104737117", - "package_name":"hmg.cloudSolutions.mohem" + "package_name":"com.cloudsolutions.alhabibmohemm" }, "configuration_version":"3.0", "appInfos":[ { - "package_name":"hmg.cloudSolutions.mohem", + "package_name":"com.cloudsolutions.alhabibmohemm", "client":{ "app_id":"104737117" }, "app_info":{ - "package_name":"hmg.cloudSolutions.mohem", + "package_name":"com.cloudsolutions.alhabibmohemm", "app_id":"104737117" }, "oauth_client":{ diff --git a/android/app/build.gradle b/android/app/build.gradle index fa085a0..6e29f89 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -51,7 +51,7 @@ android { defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId "hmg.cloudSolutions.mohem" + applicationId "com.cloudsolutions.alhabibmohemm" minSdkVersion 21 targetSdkVersion 33 versionCode flutterVersionCode.toInteger() diff --git a/android/app/google-services.json b/android/app/google-services.json index 62fbaea..e689a64 100644 --- a/android/app/google-services.json +++ b/android/app/google-services.json @@ -1,40 +1,40 @@ -{ - "project_info": { - "project_number": "679409052782", - "firebase_url": "https://mohemm-dce93.firebaseio.com", - "project_id": "mohemm-dce93", - "storage_bucket": "mohemm-dce93.appspot.com" - }, - "client": [ - { - "client_info": { - "mobilesdk_app_id": "1:679409052782:android:dba155ac0859d7fea78a7f", - "android_client_info": { - "package_name": "hmg.cloudSolutions.mohem" - } - }, - "oauth_client": [ - { - "client_id": "679409052782-mtd6d8rjltucnm9uatn6g7et08sm6lbv.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyDgWjuSBIKGghWxYg_KGBRIZTi-O_UA8mU" - } - ], - "services": { - "appinvite_service": { - "other_platform_oauth_client": [ - { - "client_id": "679409052782-mtd6d8rjltucnm9uatn6g7et08sm6lbv.apps.googleusercontent.com", - "client_type": 3 - } - ] - } - } - } - ], - "configuration_version": "1" +{ + "project_info": { + "project_number": "448880075189", + "firebase_url": "https://al-habib-mohemm.firebaseio.com", + "project_id": "al-habib-mohemm", + "storage_bucket": "al-habib-mohemm.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:448880075189:android:5bb4821d515a826d88b9fc", + "android_client_info": { + "package_name": "com.cloudsolutions.alhabibmohemm" + } + }, + "oauth_client": [ + { + "client_id": "448880075189-49hc2l78pr9hsmr9p3k7j411r40diej8.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyC8nrli7eyuRNow8nF-QHvDMOxqUkj6fEw" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "448880075189-49hc2l78pr9hsmr9p3k7j411r40diej8.apps.googleusercontent.com", + "client_type": 3 + } + ] + } + } + } + ], + "configuration_version": "1" } \ No newline at end of file diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 5b3b2ba..d6ff8f6 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -20,9 +20,8 @@ + android:label="Al Habib Mohemm" + android:networkSecurityConfig="@xml/network_security_config"> - - - - CLIENT_ID - 679409052782-3teqf8vdh9e1suvnhddj3pgmna7vg5rt.apps.googleusercontent.com - REVERSED_CLIENT_ID - com.googleusercontent.apps.679409052782-3teqf8vdh9e1suvnhddj3pgmna7vg5rt - API_KEY - AIzaSyCjMjhbeS7qilBoP4SH0t3SgkkHryf34JA - GCM_SENDER_ID - 679409052782 - PLIST_VERSION - 1 - BUNDLE_ID - com.cloudsolutions.mohemm - PROJECT_ID - mohemm-dce93 - STORAGE_BUCKET - mohemm-dce93.appspot.com - IS_ADS_ENABLED - - IS_ANALYTICS_ENABLED - - IS_APPINVITE_ENABLED - - IS_GCM_ENABLED - - IS_SIGNIN_ENABLED - - GOOGLE_APP_ID - 1:679409052782:ios:ace07cf8ba043b48a78a7f - DATABASE_URL - https://mohemm-dce93.firebaseio.com - + + + + + CLIENT_ID + 448880075189-tcgggmh2ua9tsmdr97c1ttcgrmf5kg5m.apps.googleusercontent.com + REVERSED_CLIENT_ID + com.googleusercontent.apps.448880075189-tcgggmh2ua9tsmdr97c1ttcgrmf5kg5m + API_KEY + AIzaSyB--KUTUYVpcdxpETCEsdhKs5cV3QawW7Q + GCM_SENDER_ID + 448880075189 + PLIST_VERSION + 1 + BUNDLE_ID + com.cloudsolutions.alhabibmohemm + PROJECT_ID + al-habib-mohemm + STORAGE_BUCKET + al-habib-mohemm.appspot.com + IS_ADS_ENABLED + + IS_ANALYTICS_ENABLED + + IS_APPINVITE_ENABLED + + IS_GCM_ENABLED + + IS_SIGNIN_ENABLED + + GOOGLE_APP_ID + 1:448880075189:ios:c6fd2b86fe7b388088b9fc + DATABASE_URL + https://al-habib-mohemm.firebaseio.com + \ No newline at end of file diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index 75c680b..a5aa2f0 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -2,15 +2,15 @@ - NSAppTransportSecurity - - NSAllowsArbitraryLoads - - NSAllowsArbitraryLoadsForMedia - - NSAllowsArbitraryLoadsInWebContent - - + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + NSAllowsArbitraryLoadsForMedia + + NSAllowsArbitraryLoadsInWebContent + + CADisableMinimumFrameDurationOnPhone CFBundleDevelopmentRegion @@ -22,7 +22,7 @@ CFBundleInfoDictionaryVersion 6.0 CFBundleName - MOHEMM + Al Habib Mohemm CFBundlePackageType APPL CFBundleShortVersionString diff --git a/ios/Runner/Runner.entitlements b/ios/Runner/Runner.entitlements index 304aa00..2270408 100644 --- a/ios/Runner/Runner.entitlements +++ b/ios/Runner/Runner.entitlements @@ -6,7 +6,7 @@ development com.apple.developer.icloud-container-identifiers - iCloud.com.cloudsolutions.mohemm + iCloud.com.cloudsolutions.alhabibmohemm com.apple.developer.icloud-services @@ -24,7 +24,7 @@ com.apple.developer.ubiquity-container-identifiers - iCloud.com.cloudsolutions.mohemm + iCloud.com.cloudsolutions.alhabibmohemm diff --git a/lib/api/login_api_client.dart b/lib/api/login_api_client.dart index 7da7754..e7e160f 100644 --- a/lib/api/login_api_client.dart +++ b/lib/api/login_api_client.dart @@ -60,7 +60,7 @@ class LoginApiClient { Future memberLogin(String username, String password) async { String url = "${ApiConsts.erpRest}MemberLogin"; - Map postParams = {"P_APP_VERSION": "CS", "P_LANGUAGE": "US", "P_PASSWORD": password, "P_USER_NAME": username}; + Map postParams = {"P_APP_VERSION": "HMG", "P_LANGUAGE": "US", "P_PASSWORD": password, "P_USER_NAME": username}; postParams.addAll(AppState().postParamsJson); return await ApiClient().postJsonForObject((json) { GenericResponseModel responseData = GenericResponseModel.fromJson(json); diff --git a/lib/api/profile_api_client.dart b/lib/api/profile_api_client.dart index 6a8cfb0..1f6108b 100644 --- a/lib/api/profile_api_client.dart +++ b/lib/api/profile_api_client.dart @@ -166,7 +166,7 @@ class ProfileApiClient { ], "P_CONTACT_RELATIONSHIP_ID": contactRelationId, "P_ACTION": actionType, - "PayrollCodeStr": "CS", + "PayrollCodeStr": AppState().postParamsObject?.payrollCodeStr, "LegislationCodeStr": "SA", }; postParams.addAll(AppState().postParamsJson); diff --git a/lib/app_state/app_state.dart b/lib/app_state/app_state.dart index 32d713c..b2606f4 100644 --- a/lib/app_state/app_state.dart +++ b/lib/app_state/app_state.dart @@ -88,7 +88,7 @@ class AppState { String get getHuaweiPushToken => _huaweiPushToken; - final PostParamsModel _postParamsInitConfig = PostParamsModel(channel: 31, versionID: 4.1, mobileType: Platform.isAndroid ? "android" : "ios"); + final PostParamsModel _postParamsInitConfig = PostParamsModel(channel: 33, versionID: 4.1, mobileType: Platform.isAndroid ? "android" : "ios"); void setPostParamsInitConfig() { isAuthenticated = false; diff --git a/lib/classes/notifications.dart b/lib/classes/notifications.dart index 2d46642..0e98357 100644 --- a/lib/classes/notifications.dart +++ b/lib/classes/notifications.dart @@ -97,7 +97,9 @@ class AppNotifications { debugPrint("HUAWEI PUSH TOKEN: $_huaweiToken"); } - void _onTokenError(Object error) {} + void _onTokenError(Object error) { + print("TOKEN ERROOORRRRR!!!!:"); + } Future initTokenStream(Function loginCallback) async { huawei_push.Push.getTokenStream.listen(_onTokenEvent, onError: _onTokenError).onData((data) { diff --git a/lib/ui/app_update_screen.dart b/lib/ui/app_update_screen.dart index 4a769c3..b35b233 100644 --- a/lib/ui/app_update_screen.dart +++ b/lib/ui/app_update_screen.dart @@ -38,7 +38,7 @@ class _UnsafeDeviceScreenState extends State { 21.height, DefaultButton(LocaleKeys.ok.tr(), () async { if (Platform.isAndroid || Platform.isIOS) { - var appId = Platform.isAndroid ? 'hmg.cloudSolutions.mohem' : '1468856602'; + var appId = Platform.isAndroid ? 'com.cloudsolutions.alhabibmohemm' : '1480157255'; var url = Uri.parse( Platform.isAndroid ? "market://details?id=$appId" : "https://apps.apple.com/app/id$appId", ); diff --git a/lib/ui/dialogs/id/business_card_dialog.dart b/lib/ui/dialogs/id/business_card_dialog.dart index 141abbd..1d76471 100644 --- a/lib/ui/dialogs/id/business_card_dialog.dart +++ b/lib/ui/dialogs/id/business_card_dialog.dart @@ -14,7 +14,7 @@ class BusinessCardDialog extends StatelessWidget { child: Container( // width: MediaQuery.of(context).size.height / 2, color: Colors.white, - margin: EdgeInsets.all(21), + margin: EdgeInsets.all(12), child: Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, @@ -30,11 +30,11 @@ class BusinessCardDialog extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.start, children: [ Image.asset( - "assets/images/logos/bn_cloud_soloution.jpg", - width: 80, - height: 80, + "assets/images/logos/bn_hmg_logo.png", + width: 120, + height: 120, ), - 12.height, + // 12.height, (AppState().memberInformationList!.eMPLOYEENAME ?? "").toText20(isBold: true), ], ), diff --git a/lib/ui/landing/dashboard_screen.dart b/lib/ui/landing/dashboard_screen.dart index 7a8f857..b02bbd7 100644 --- a/lib/ui/landing/dashboard_screen.dart +++ b/lib/ui/landing/dashboard_screen.dart @@ -18,6 +18,7 @@ import 'package:mohem_flutter_app/extensions/widget_extensions.dart'; import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; import 'package:mohem_flutter_app/main.dart'; import 'package:mohem_flutter_app/models/offers_and_discounts/get_offers_list.dart'; +import 'package:mohem_flutter_app/models/privilege_list_model.dart'; import 'package:mohem_flutter_app/provider/chat_provider_model.dart'; import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart'; import 'package:mohem_flutter_app/ui/landing/widget/app_drawer.dart'; @@ -62,7 +63,9 @@ class _DashboardScreenState extends State with WidgetsBindingOb data = Provider.of(context, listen: false); marathonProvider = Provider.of(context, listen: false); cProvider = Provider.of(context, listen: false); - _bHubCon(); + if (checkIfPrivilegedForChat()) { + _bHubCon(); + } _onRefresh(true); }); } @@ -130,11 +133,6 @@ class _DashboardScreenState extends State with WidgetsBindingOb void _onRefresh(bool isFromInit) async { data.initProvider(); - // data.getITGNotification().then((value) { - // print("--------------------detail_1-----------------"); - // print(value!.result!.data!.notificationMasterId); - // print(value.result!.data!.notificationTitle); - // }); data.fetchListMenu(); data.fetchAttendanceTracking(context); data.fetchWorkListCounter(context); @@ -143,7 +141,7 @@ class _DashboardScreenState extends State with WidgetsBindingOb data.fetchMenuEntries(); data.getCategoryOffersListAPI(context); marathonProvider.getMarathonDetailsFromApi(); - if (!cProvider.disbaleChatForThisUser && !isFromInit) checkHubCon(); + if (!cProvider.disbaleChatForThisUser && !isFromInit && checkIfPrivilegedForChat()) checkHubCon(); _refreshController.refreshCompleted(); } @@ -559,7 +557,7 @@ class _DashboardScreenState extends State with WidgetsBindingOb children: [ SvgPicture.asset( "assets/icons/chat/chat.svg", - color: currentIndex == 4 + color: !checkIfPrivilegedForChat() ? MyColors.lightGreyE3Color : currentIndex == 4 ? MyColors.grey3AColor : cProvider.disbaleChatForThisUser ? MyColors.lightGreyE3Color @@ -567,7 +565,7 @@ class _DashboardScreenState extends State with WidgetsBindingOb ).paddingAll(4), Consumer( builder: (BuildContext cxt, ChatProviderModel data, Widget? child) { - return Positioned( + return !checkIfPrivilegedForChat() ? const SizedBox() : Positioned( right: 0, top: 0, child: Container( @@ -600,7 +598,7 @@ class _DashboardScreenState extends State with WidgetsBindingOb } else if (index == 3) { Navigator.pushNamed(context, AppRoutes.itemsForSale); } else if (index == 4) { - if (!cProvider.disbaleChatForThisUser) { + if (!cProvider.disbaleChatForThisUser && checkIfPrivilegedForChat()) { Navigator.pushNamed(context, AppRoutes.chat); } } @@ -610,6 +608,17 @@ class _DashboardScreenState extends State with WidgetsBindingOb ); } + bool checkIfPrivilegedForChat() { + for (PrivilegeListModel element in AppState().privilegeListModel!) { + if (element.serviceName?.toLowerCase() == "chat") { + if (element.previlege != null) { + return element.previlege!; + } + } + } + return false; + } + void navigateToDetails(OffersListModel offersListModelObj) { List getOffersDetailList = []; getOffersDetailList.clear(); diff --git a/lib/ui/login/forgot_password_screen.dart b/lib/ui/login/forgot_password_screen.dart index b2d5c92..97c1d88 100644 --- a/lib/ui/login/forgot_password_screen.dart +++ b/lib/ui/login/forgot_password_screen.dart @@ -43,7 +43,7 @@ class _ForgotPasswordScreenState extends State { } Utils.showLoading(context); try { - _basicMemberInformation = await LoginApiClient().getBasicUserInformation("CS", employeeId.text); + _basicMemberInformation = await LoginApiClient().getBasicUserInformation("HMG", employeeId.text); genericResponseModel = await LoginApiClient().sendPublicActivationCode(_basicMemberInformation?.pMOBILENUMBER, employeeId.text); Utils.hideLoading(context); OtpDialog( diff --git a/lib/ui/login/login_screen.dart b/lib/ui/login/login_screen.dart index 471ebf5..15061ad 100644 --- a/lib/ui/login/login_screen.dart +++ b/lib/ui/login/login_screen.dart @@ -110,7 +110,10 @@ class _LoginScreenState extends State { checkLoginInfo(); } }); - } catch (ex) {} + } catch (ex) { + Utils.hideLoading(context); + checkLoginInfo(); + } } else { await Firebase.initializeApp(); _firebaseMessaging = FirebaseMessaging.instance; diff --git a/pubspec.yaml b/pubspec.yaml index 536a4d3..2adf1f0 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 3.6.4+2 +version: 4.2.0+4000002 environment: sdk: ">=2.16.0 <3.0.0"