fixed moe issues

MOE_MAIN
umasoodch 3 years ago
parent adf9a1cf04
commit c79f494d44

@ -50,9 +50,6 @@
<splash density="port-xhdpi" src="resources/android/splash/drawable-port-xhdpi-screen.png" />
<splash density="port-xxhdpi" src="resources/android/splash/drawable-port-xxhdpi-screen.png" />
<splash density="port-xxxhdpi" src="resources/android/splash/drawable-port-xxxhdpi-screen.png" />
<feature name="SocialSharing">
<param name="android-package" value="nl.xservices.plugins.SocialSharing" />
</feature>
</platform>
<platform name="ios">
<allow-intent href="itms:*" />
@ -112,29 +109,21 @@
<plugin name="cordova-plugin-whitelist" spec="1.3.3" />
<plugin name="cordova-plugin-statusbar" spec="2.4.2" />
<plugin name="cordova-plugin-splashscreen" spec="5.0.2" />
<plugin name="cordova-plugin-geolocation" spec="~4.0.1" />
<plugin name="cordova-plugin-datepicker" spec="~0.9.3" />
<plugin name="cordova-plugin-ionic-webview" spec="4.1.0">
<variable name="ANDROID_SUPPORT_ANNOTATIONS_VERSION" value="27.+" />
</plugin>
<plugin name="cordova-sqlite-storage" spec="^3.4.0" />
<plugin name="cordova-plugin-nativestorage" spec="^2.3.2" />
<plugin name="cordova-plugin-ble-central" spec="^1.2.4" />
<plugin name="uk.co.workingedge.phonegap.plugin.launchnavigator" spec="^3.2.2" />
<plugin name="cordova-plugin-themeablebrowser" spec="^0.2.18" />
<plugin name="cordova-plugin-inappbrowser" spec="^3.1.0" />
<plugin name="cordova-plugin-globalization" spec="^1.11.0" />
<plugin name="cordova-plugin-android-permissions" spec="^1.0.2" />
<plugin name="cordova-plugin-device" spec="^2.0.3" />
<plugin name="cordova-plugin-local-notification" spec="^0.9.0-beta.2" />
<plugin name="cordova-plugin-badge" spec="^0.8.8" />
<plugin name="cordova.plugins.diagnostic" spec="^5.0.1" />
<plugin name="phonegap-plugin-barcodescanner" spec="^8.1.0">
<variable name="ANDROID_SUPPORT_V4_VERSION" value="27.+" />
</plugin>
<plugin name="cordova-plugin-camera" spec="^4.1.0" />
<plugin name="cordova-plugin-ionic-keyboard" spec="^2.2.0" />
<plugin name="cordova-opentok-android-permissions" spec="^1.0.1" />
<plugin name="cordova-plugin-appavailability" spec="^0.4.2" />
<plugin name="cordova-plugin-apprate" spec="^1.4.0" />
<plugin name="cordova-plugin-file" spec="^6.0.2" />

@ -24,11 +24,8 @@
"@ionic-native/android-permissions": "^5.18.0",
"@ionic-native/app-availability": "^5.18.0",
"@ionic-native/app-rate": "^5.18.0",
"@ionic-native/background-geolocation": "^5.30.0",
"@ionic-native/badge": "^5.18.0",
"@ionic-native/barcode-scanner": "^5.18.0",
"@ionic-native/base64": "^5.18.0",
"@ionic-native/ble": "^5.18.0",
"@ionic-native/camera": "^5.18.0",
"@ionic-native/core": "^5.8.0",
"@ionic-native/date-picker": "^5.10.0",
@ -41,24 +38,17 @@
"@ionic-native/file-picker": "^5.36.0",
"@ionic-native/fingerprint-aio": "^5.18.0",
"@ionic-native/firebase-x": "^5.34.0",
"@ionic-native/geolocation": "^5.10.0",
"@ionic-native/globalization": "^5.18.0",
"@ionic-native/health": "^5.4.0",
"@ionic-native/in-app-browser": "^5.17.0",
"@ionic-native/keyboard": "^5.17.0",
"@ionic-native/launch-navigator": "^5.17.0",
"@ionic-native/local-notifications": "^5.17.0",
"@ionic-native/native-storage": "^5.17.0",
"@ionic-native/nfc": "^5.30.0",
"@ionic-native/open-native-settings": "^5.14.0",
"@ionic-native/sms-retriever": "^5.36.0",
"@ionic-native/social-sharing": "^5.34.0",
"@ionic-native/splash-screen": "^5.0.0",
"@ionic-native/sqlite": "^5.18.0",
"@ionic-native/status-bar": "^5.0.0",
"@ionic-native/themeable-browser": "^5.18.0",
"@ionic-native/wifi-wizard-2": "^5.31.1",
"@ionic-native/zbar": "^5.10.0",
"@ionic/angular": "^4.1.0",
"@ng-bootstrap/ng-bootstrap": "^4.2.2",
"@swimlane/ngx-charts": "^10.1.0",
@ -69,7 +59,6 @@
"cordova-android": "^8.1.0",
"cordova-android-support-gradle-release": "^3.0.1",
"cordova-open-native-settings": "^1.5.2",
"cordova-opentok-android-permissions": "^1.0.1",
"cordova-plugin-actionsheet": "^2.3.3",
"cordova-plugin-add-swift-support": "^2.0.2",
"cordova-plugin-android-permissions": "^1.0.2",
@ -78,7 +67,6 @@
"cordova-plugin-appavailability": "^0.4.2",
"cordova-plugin-apprate": "^1.4.0",
"cordova-plugin-badge": "^0.8.8",
"cordova-plugin-ble-central": "^1.2.4",
"cordova-plugin-camera": "^4.1.0",
"cordova-plugin-datepicker": "^0.9.3",
"cordova-plugin-device": "^2.0.3",
@ -90,9 +78,7 @@
"cordova-plugin-filepicker": "^1.1.6",
"cordova-plugin-fingerprint-aio": "^3.0.0",
"cordova-plugin-firebasex": "^13.0.0",
"cordova-plugin-geolocation": "^4.0.2",
"cordova-plugin-globalization": "^1.11.0",
"cordova-plugin-inappbrowser": "^3.1.0",
"cordova-plugin-ionic-keyboard": "^2.2.0",
"cordova-plugin-ionic-webview": "^4.1.0",
"cordova-plugin-local-notification": "^0.9.0-beta.2",
@ -100,16 +86,12 @@
"cordova-plugin-sms-retriever-manager": "^1.0.3",
"cordova-plugin-splashscreen": "^5.0.3",
"cordova-plugin-statusbar": "^2.4.3",
"cordova-plugin-themeablebrowser": "^0.2.18",
"cordova-plugin-whitelist": "^1.3.4",
"cordova-plugin-wifiwizard2": "^3.1.1",
"cordova-plugin-x-socialsharing": "^6.0.3",
"cordova-sqlite-storage": "^3.4.0",
"cordova-support-google-services": "^1.3.2",
"cordova.plugins.diagnostic": "^5.0.1",
"core-js": "^2.5.4",
"date-fns": "^1.30.1",
"es6-promise-plugin": "^4.1.0",
"ionic2-calendar": "^0.5.8",
"ionic4-rating": "^1.0.9",
"ng-circle-progress": "^1.5.1",
@ -117,8 +99,6 @@
"ng2-pdf-viewer": "^5.3.2",
"ngx-gauge": "^1.0.0-beta.10",
"npm": "^6.14.11",
"phonegap-nfc": "^1.2.0",
"phonegap-plugin-barcodescanner": "^8.1.0",
"phonegap-plugin-multidex": "^1.0.0",
"primeicons": "^1.0.0",
"primeng": "^7.1.3",
@ -145,8 +125,6 @@
"@types/node": "~10.12.0",
"codelyzer": "~4.5.0",
"cordova-ios": "^6.2.0",
"cordova-plugin-wifiwizard2": "^3.1.1",
"es6-promise-plugin": "^4.1.0",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "^4.0.1",
@ -173,10 +151,6 @@
"cordova-plugin-badge": {},
"cordova-plugin-ionic-keyboard": {},
"cordova-plugin-datepicker": {},
"cordova-plugin-geolocation": {},
"phonegap-plugin-barcodescanner": {
"ANDROID_SUPPORT_V4_VERSION": "27.+"
},
"cordova-plugin-ionic-webview": {
"ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
},
@ -191,12 +165,8 @@
"cordova-plugin-filepath": {},
"com-badrit-base64": {},
"cordova-sqlite-storage": {},
"cordova-plugin-ble-central": {},
"uk.co.workingedge.phonegap.plugin.launchnavigator": {},
"cordova-plugin-themeablebrowser": {},
"cordova-plugin-inappbrowser": {},
"cordova-plugin-local-notification": {},
"cordova-opentok-android-permissions": {},
"cordova-plugin-appavailability": {},
"cordova-plugin-apprate": {},
"cordova-plugin-fingerprint-aio": {
@ -204,12 +174,6 @@
},
"cordova-plugin-androidx": {},
"cordova-plugin-androidx-adapter": {},
"cordova-plugin-background-geolocation": {
"GOOGLE_PLAY_SERVICES_VERSION": "+"
},
"phonegap-nfc": {},
"wifiwizard2": {},
"cordova-plugin-x-socialsharing": {},
"cordova-plugin-firebasex": {
"FIREBASE_ANALYTICS_COLLECTION_ENABLED": "true",
"FIREBASE_PERFORMANCE_COLLECTION_ENABLED": "true",
@ -246,8 +210,8 @@
"cordova-plugin-filechooser": {}
},
"platforms": [
"android",
"ios"
"ios",
"android"
]
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 294 KiB

After

Width:  |  Height:  |  Size: 285 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 73 KiB

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 129 KiB

After

Width:  |  Height:  |  Size: 123 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 763 KiB

After

Width:  |  Height:  |  Size: 743 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 MiB

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 MiB

After

Width:  |  Height:  |  Size: 2.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 324 KiB

After

Width:  |  Height:  |  Size: 307 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 143 KiB

After

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 813 KiB

After

Width:  |  Height:  |  Size: 786 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 MiB

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 MiB

After

Width:  |  Height:  |  Size: 2.3 MiB

@ -8,16 +8,16 @@ import { StatusBar } from '@ionic-native/status-bar/ngx';
import { AppComponent } from './app.component';
import { AppRoutingModule } from './app-routing.module';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { ZBar } from '@ionic-native/zbar/ngx';
import { Geolocation } from '@ionic-native/geolocation/ngx';
// import { ZBar } from '@ionic-native/zbar/ngx';
// import { Geolocation } from '@ionic-native/geolocation/ngx';
import {Camera, CameraOptions, PictureSourceType} from '@ionic-native/Camera/ngx';
import { FilePath } from '@ionic-native/file-path/ngx';
import { File } from '@ionic-native/file/ngx';
import { Base64 } from '@ionic-native/base64/ngx';
import { FirebaseX } from '@ionic-native/firebase-x/ngx';
import { NgCalendarModule } from 'ionic2-calendar';
import { NFC, Ndef} from "@ionic-native/nfc/ngx"
import { WifiWizard2 } from "@ionic-native/wifi-wizard-2/ngx";
// import { NFC, Ndef} from "@ionic-native/nfc/ngx"
// import { WifiWizard2 } from "@ionic-native/wifi-wizard-2/ngx";
import { DigitalIdComponent } from './authentication/digital-id/digital-id.component';
import { BusinessCardComponent } from './authentication/business-card/business-card.component';
import { AppUpdateComponent } from './authentication/app-update/app-update.component';
@ -38,17 +38,17 @@ import { AppUpdateComponent } from './authentication/app-update/app-update.compo
providers: [
StatusBar,
SplashScreen,
ZBar,
Geolocation,
// ZBar,
// Geolocation,
Camera,
File,
FilePath,
Base64,
FirebaseX,
{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy },
NFC,
Ndef,
WifiWizard2
// NFC,
// Ndef,
// WifiWizard2
],
bootstrap: [AppComponent]
})

@ -1,6 +1,6 @@
import { Component, OnInit } from '@angular/core';
import { Geolocation } from '@ionic-native/geolocation/ngx';
import { ZBar, ZBarOptions } from '@ionic-native/zbar/ngx';
// import { Geolocation } from '@ionic-native/geolocation/ngx';
// import { ZBar, ZBarOptions } from '@ionic-native/zbar/ngx';
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
@ -11,28 +11,28 @@ import { TranslatorService } from 'src/app/hmg-common/services/translator/transl
})
export class HomeComponent implements OnInit {
zbarOptions: any;
// zbarOptions: any;
scannedResult: any;
lat: any;
longt: any;
constructor(public ts: TranslatorService, private zbar: ZBar, private geolocation: Geolocation) {
constructor(public ts: TranslatorService) {
this.zbarOptions = {
flash: 'off',
drawSight: false
};
// this.zbarOptions = {
// flash: 'off',
// drawSight: false
// };
console.log('your currnt location is');
this.geolocation.getCurrentPosition().then((resp) => {
// resp.coords.latitude
// resp.coords.longitude
// console.log("Loc 2");
console.log(resp.coords.latitude);
console.log(resp.coords.longitude);
this.lat = resp.coords.latitude;
this.longt = resp.coords.longitude;
}).catch((error) => {
console.log('Error getting location', error);
});
// this.geolocation.getCurrentPosition().then((resp) => {
// // resp.coords.latitude
// // resp.coords.longitude
// // console.log("Loc 2");
// console.log(resp.coords.latitude);
// console.log(resp.coords.longitude);
// this.lat = resp.coords.latitude;
// this.longt = resp.coords.longitude;
// }).catch((error) => {
// console.log('Error getting location', error);
// });
this.scanCode();
}
@ -43,13 +43,13 @@ export class HomeComponent implements OnInit {
}
scanCode() {
this.zbar.scan(this.zbarOptions)
.then(result => {
console.log(result); // Scanned code
this.scannedResult = result;
})
.catch(error => {
alert(error); // Error message
});
// this.zbar.scan(this.zbarOptions)
// .then(result => {
// console.log(result); // Scanned code
// this.scannedResult = result;
// })
// .catch(error => {
// alert(error); // Error message
// });
}
}

@ -2,9 +2,6 @@
height: 25vh;
}
ion-content {
--background: #f5f5f5;
}
.button-digital-id {
--background: white !important;

@ -17,7 +17,7 @@ import { CheckUserAuthenticationResponse } from 'src/app/hmg-common/services/aut
import { LoginModel } from '../models/LoginModel';
import * as moment from 'moment';
import { CheckAppVersionResponse } from 'src/app/hmg-common/services/authentication/models/check-app-version.response';
import { NFC } from "@ionic-native/nfc/ngx";
// import { NFC } from "@ionic-native/nfc/ngx";
import { DigitalIdComponent } from '../digital-id/digital-id.component';
import { AppUpdateComponent } from '../app-update/app-update.component';
import { Password } from '../models/password';
@ -69,7 +69,7 @@ export class ConfirmLoginComponent implements OnInit {
public platform: Platform,
public modalController: ModalController,
public alertController: AlertController,
private nfc: NFC,
// private nfc: NFC,
private smsRetriever: SmsRetriever
) {
this.loginData = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false);
@ -353,20 +353,20 @@ export class ConfirmLoginComponent implements OnInit {
}
async checkNFCStatus() {
try {
let nfcStatus = await this.nfc.enabled();
console.log("nfc status >>>>>>>>>>" + nfcStatus);
this.isNFCAvailable = true;
} catch (err) {
console.log("Error reading tag", err);
if (err === "NO_NFC") {
this.isNFCAvailable = false;
} else if (err === "NFC_DISABLED") {
this.isNFCAvailable = true;
} else {
this.isNFCAvailable = false;
}
}
// try {
// let nfcStatus = await this.nfc.enabled();
// console.log("nfc status >>>>>>>>>>" + nfcStatus);
// this.isNFCAvailable = true;
// } catch (err) {
// console.log("Error reading tag", err);
// if (err === "NO_NFC") {
// this.isNFCAvailable = false;
// } else if (err === "NFC_DISABLED") {
// this.isNFCAvailable = true;
// } else {
// this.isNFCAvailable = false;
// }
// }
}
public checkSMS() {

@ -24,7 +24,7 @@ import { GetLoginInfoRequest } from 'src/app/hmg-common/services/authentication/
import * as moment from 'moment';
import { NFC } from "@ionic-native/nfc/ngx";
// import { NFC } from "@ionic-native/nfc/ngx";
import { SmsRetriever } from '@ionic-native/sms-retriever/ngx';
@ -125,7 +125,7 @@ export class SmsPageComponent implements OnInit {
public platform: Platform,
private nfc: NFC,
// private nfc: NFC,
private smsRetriever: SmsRetriever
@ -367,33 +367,33 @@ export class SmsPageComponent implements OnInit {
async checkNFCStatus() {
try {
// try {
let nfcStatus = await this.nfc.enabled();
// let nfcStatus = await this.nfc.enabled();
console.log("nfc status >>>>>>>>>>" + nfcStatus);
// console.log("nfc status >>>>>>>>>>" + nfcStatus);
this.isNFCAvailable = true;
// this.isNFCAvailable = true;
} catch (err) {
// } catch (err) {
console.log("Error reading tag", err);
// console.log("Error reading tag", err);
if (err === "NO_NFC") {
// if (err === "NO_NFC") {
this.isNFCAvailable = false;
// this.isNFCAvailable = false;
} else if (err === "NFC_DISABLED") {
// } else if (err === "NFC_DISABLED") {
this.isNFCAvailable = true;
// this.isNFCAvailable = true;
} else {
// } else {
this.isNFCAvailable = false;
// this.isNFCAvailable = false;
}
// }
}
// }
}

@ -21,7 +21,7 @@ import { TranslatePipe } from './pipes/translate/translate.pipe';
import { DatePipeTransform } from './pipes/date/date.pipe';
import { AlertControllerService } from './ui/alert/alert-controller.service';
import { DateTimePipe } from './pipes/date-time/date-time.pipe';
import { ThemeableBrowser } from '@ionic-native/themeable-browser/ngx';
// import { ThemeableBrowser } from '@ionic-native/themeable-browser/ngx';
import { LaunchNavigator } from '@ionic-native/launch-navigator/ngx';
import { SafeHtmlPipe } from './pipes/safe-html/safe-html.pipe';
import { BackButtonComponent } from './ui/back-button/back-button.component';
@ -78,7 +78,7 @@ import { RouterModule } from '@angular/router';
import { HeaderButtonComponent } from './ui/header-button/header-button.component';
import { AppRate } from '@ionic-native/app-rate/ngx';
import { RatingService } from './services/rating/rating.service';
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
// import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
import { RateService } from './services/rate/rate.service';
import { MenuService } from './services/menu/menuservice.service';
import { ReplacementListComponent } from '../vacation-rule/replacement-list/replacement-list.component';
@ -99,7 +99,7 @@ import { ConfirmLoginComponent } from '../authentication/confirm-login/confirm-l
import { WelcomeComponent } from './ui/welcome-login/welcome.component'
import { FabButtonComponent } from './ui/fab-button/fab-button.component'
import { AttendScanService } from './services/attend-services/attend-scan.service';
import { BarcodeScanner } from '@ionic-native/barcode-scanner/ngx';
// import { BarcodeScanner } from '@ionic-native/barcode-scanner/ngx';
import { NgCircleProgressModule } from 'ng-circle-progress';
import { CardFilterComponent } from './ui/card-filter/card-filter.component';
import { EmployeeInformationComponent } from './ui/employee-information/employee-information.component';
@ -108,7 +108,7 @@ import { NgCalendarModule } from 'ionic2-calendar';
import { DateInfoModalComponent } from './ui/circle-calendar/date-info-modal/date-info-modal.component';
import { ChartModule } from 'primeng/chart';
import { GenericHeaderComponent } from './ui/generic-header/generic-header.component';
import { BackgroundGeolocation } from '@ionic-native/background-geolocation/ngx';
// import { BackgroundGeolocation } from '@ionic-native/background-geolocation/ngx';
import { AttendanceOptionsComponent } from '../home/attendance-options/attendance-options.component';
import { CardCalendarComponent } from './ui/card-calendar/card-calendar.component';
import { WorklistSettingComponent } from '../notification/worklist-setting/worklist-setting.component';
@ -287,7 +287,7 @@ import { SanitizeHtmlPipe } from '../itemforsale/services/domsafe';
Globalization,
SharedDataService,
AlertControllerService,
ThemeableBrowser,
// ThemeableBrowser,
LaunchNavigator,
ProjectsService,
NationalityService,
@ -309,14 +309,14 @@ import { SanitizeHtmlPipe } from '../itemforsale/services/domsafe';
Diagnostic,
AppRate,
RatingService,
InAppBrowser,
// InAppBrowser,
RateService,
Camera,
File,
MenuService,
OpenNativeSettings,
BarcodeScanner,
BackgroundGeolocation,
// BarcodeScanner,
// BackgroundGeolocation,
FileOpener,
FilePath,
FileChooser,

@ -1,9 +1,9 @@
import { Injectable } from "@angular/core";
import { BackgroundGeolocation } from '@ionic-native/background-geolocation/ngx';
// import { BackgroundGeolocation } from '@ionic-native/background-geolocation/ngx';
import { CommonService } from "src/app/hmg-common/services/common/common.service";
import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service";
import { DevicePermissionsService } from 'src/app/hmg-common/services/device-permissions/device-permissions.service';
import { Geolocation } from '@ionic-native/geolocation/ngx';
// import { Geolocation } from '@ionic-native/geolocation/ngx';
import { Platform } from "@ionic/angular";
declare const cordova: any;
@ -13,10 +13,10 @@ declare const cordova: any;
})
export class HMGUtils {
constructor(
public backgroundGeolocation: BackgroundGeolocation,
// public backgroundGeolocation: BackgroundGeolocation,
public common: CommonService,
public ts: TranslatorService,
private geolocation: Geolocation,
// private geolocation: Geolocation,
public platform: Platform,
public devicePermissionsService:DevicePermissionsService,
) { }
@ -98,32 +98,32 @@ export class HMGUtils {
}
private getGMSLocation(callBack: Function) {
this.backgroundGeolocation.getCurrentLocation({ timeout: 10000, enableHighAccuracy: true, maximumAge: 3000 }).then((resp) => {
if (resp && (resp.latitude && resp.longitude)) {
const isFakeLocation = resp.isFromMockProvider || resp.mockLocationsEnabled;
const lat = resp.latitude;
const long = resp.longitude;
callBack({"latitude":lat, "longitude":long, "isfake":isFakeLocation})
} else {
this.common.presentAlert(this.ts.trPK('home', 'position-error'));
}
}, (error) => {
this.common.presentAlert(this.ts.trPK('home', 'position-error'));
});
// this.backgroundGeolocation.getCurrentLocation({ timeout: 10000, enableHighAccuracy: true, maximumAge: 3000 }).then((resp) => {
// if (resp && (resp.latitude && resp.longitude)) {
// const isFakeLocation = resp.isFromMockProvider || resp.mockLocationsEnabled;
// const lat = resp.latitude;
// const long = resp.longitude;
// callBack({"latitude":lat, "longitude":long, "isfake":isFakeLocation})
// } else {
// this.common.presentAlert(this.ts.trPK('home', 'position-error'));
// }
// }, (error) => {
// this.common.presentAlert(this.ts.trPK('home', 'position-error'));
// });
}
private getIOSLocation(callBack: Function) {
this.geolocation.getCurrentPosition({ maximumAge: 3000, timeout: 10000, enableHighAccuracy: true }).then(resp => {
if (resp && resp.coords.latitude && resp.coords.longitude) {
const lat = resp.coords.latitude;
const long = resp.coords.longitude;
callBack({"latitude":lat, "longitude":long, "isfake":false})
} else {
this.common.presentAlert(this.ts.trPK('home', 'position-error'));
}
}).catch(error => {
this.common.presentAlert(this.ts.trPK('home', 'position-error'));
});
// this.geolocation.getCurrentPosition({ maximumAge: 3000, timeout: 10000, enableHighAccuracy: true }).then(resp => {
// if (resp && resp.coords.latitude && resp.coords.longitude) {
// const lat = resp.coords.latitude;
// const long = resp.coords.longitude;
// callBack({"latitude":lat, "longitude":long, "isfake":false})
// } else {
// this.common.presentAlert(this.ts.trPK('home', 'position-error'));
// }
// }).catch(error => {
// this.common.presentAlert(this.ts.trPK('home', 'position-error'));
// });
}

@ -2,10 +2,10 @@ import { Injectable } from '@angular/core';
// import { DevicePermissionsService } from '../device-permissions/device-permissions.service';
import { DomSanitizer } from '@angular/platform-browser';
import { SharedDataService } from '../shared-data-service/shared-data.service';
import { BarcodeScanner } from '@ionic-native/barcode-scanner/ngx';
// import { BarcodeScanner } from '@ionic-native/barcode-scanner/ngx';
import { AttendanceService } from 'src/app/home/services/attendance.services';
import { ZBar } from '@ionic-native/zbar/ngx';
import { Geolocation } from '@ionic-native/geolocation/ngx';
// import { ZBar } from '@ionic-native/zbar/ngx';
// import { Geolocation } from '@ionic-native/geolocation/ngx';
import { attendanceSwipeScannerRequest } from 'src/app/home/models/attendanceSwipe.Request';
import { AuthenticatedUser } from '../authentication/models/authenticated-user';
import { CommonService } from '../common/common.service';
@ -14,7 +14,7 @@ import { Response } from 'src/app/hmg-common/services/models/response';
import { Camera, CameraOptions, PictureSourceType} from '@ionic-native/Camera/ngx';
import { DevicePermissionsService } from '../../services/device-permissions/device-permissions.service';
import { Device } from '@ionic-native/device/ngx';
import { BackgroundGeolocation } from '@ionic-native/background-geolocation/ngx';
// import { BackgroundGeolocation } from '@ionic-native/background-geolocation/ngx';
import { Platform } from '@ionic/angular';
import { ModalController } from '@ionic/angular';
import { FirebaseX } from '@ionic-native/firebase-x/ngx';
@ -37,17 +37,17 @@ export class AttendScanService {
public collection = 'CS';
constructor(private device: Device,
private zbar: ZBar,
private geolocation: Geolocation,
// private zbar: ZBar,
// private geolocation: Geolocation,
private attendance_service: AttendanceService,
private barcodeScanner: BarcodeScanner,
// private barcodeScanner: BarcodeScanner,
private cameraController: Camera,
public sharedData: SharedDataService,
private sanitizer: DomSanitizer,
private permissions: DevicePermissionsService,
public common: CommonService,
public ts: TranslatorService,
public backgroundGeolocation: BackgroundGeolocation,
// public backgroundGeolocation: BackgroundGeolocation,
public platform: Platform,
public modalController: ModalController,
public firebasex: FirebaseX,
@ -135,22 +135,22 @@ export class AttendScanService {
}
scanCode() {
this.barcodeScanner
.scan()
.then(barcodeData => {
if (!barcodeData.cancelled) {
this.scannedResult = barcodeData;
this.deviceID = this.device.uuid;
if (this.isFakeLocationUsed) {
this.fakeSwipeAttendance();
} else {
this.swipeAttendance();
}
}
})
.catch(err => {
console.log('Error', err);
});
// this.barcodeScanner
// .scan()
// .then(barcodeData => {
// if (!barcodeData.cancelled) {
// this.scannedResult = barcodeData;
// this.deviceID = this.device.uuid;
// if (this.isFakeLocationUsed) {
// this.fakeSwipeAttendance();
// } else {
// this.swipeAttendance();
// }
// }
// })
// .catch(err => {
// console.log('Error', err);
// });
}
fakeSwipeAttendance() {

@ -13,7 +13,7 @@ import { AlertControllerService } from '../../ui/alert/alert-controller.service'
//import { Response } from "../models/response";
import { Response } from 'src/app/hmg-common/services/models/response';
import { Location, DatePipe } from '@angular/common';
import { ThemeableBrowser } from '@ionic-native/themeable-browser/ngx';
// import { ThemeableBrowser } from '@ionic-native/themeable-browser/ngx';
import { BrowserConfig } from './models/browser-config';
import {
LaunchNavigator,
@ -26,7 +26,7 @@ import { SharedDataService } from '../shared-data-service/shared-data.service';
import { Badge } from '@ionic-native/badge/ngx';
import { LifeCycleService } from '../life-cycle/life-cycle.service';
import { Diagnostic } from '@ionic-native/diagnostic/ngx';
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
// import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
@Injectable({
providedIn: 'root'
@ -105,7 +105,7 @@ export class CommonService {
public toastController: ToastController,
public alertController: AlertControllerService,
public alertControllerIonic: AlertController,
public themeableBrowser: ThemeableBrowser,
// public themeableBrowser: ThemeableBrowser,
public launchNavigation: LaunchNavigator,
public platform: Platform,
public device: Device,
@ -113,7 +113,7 @@ export class CommonService {
public badge: Badge,
public lifeCycle: LifeCycleService,
public diagnostic: Diagnostic,
public iab: InAppBrowser,
// public iab: InAppBrowser,
private menu: MenuController,
) { }
@ -683,52 +683,52 @@ export class CommonService {
onSuccess?,
successURLS?: string[]
) {
this.platform.ready().then(() => {
const browser = this.iab.create(
url,
'_blank',
'closebuttoncolor=#60686b,hidenavigationbuttons=yes,hideurlbar=yes,zoom=no'
);
// browser.executeScript(...);
// browser.insertCSS(...);
browser.on('loaderror').subscribe(event => {
if (onFaild) {
onFaild();
}
browser.close();
});
/*
browser.on('loadstop').subscribe(event => {
// browser.insertCSS({ code: 'body{color: white;}' });
if (onSuccess) {
onSuccess();
}
});
*/
browser.on('exit').subscribe(event => {
if (onExit) {
onExit();
}
});
browser.on('loadstart').subscribe(event => {
if (successURLS) {
successURLS.forEach((successURL, index) => {
if (event.url && event.url.indexOf(successURL) >= 0) {
// alert('load start found success url');
browser.close();
if (onSuccess) {
onSuccess();
}
}
});
}
});
});
// this.platform.ready().then(() => {
// const browser = this.iab.create(
// url,
// '_blank',
// 'closebuttoncolor=#60686b,hidenavigationbuttons=yes,hideurlbar=yes,zoom=no'
// );
// // browser.executeScript(...);
// // browser.insertCSS(...);
// browser.on('loaderror').subscribe(event => {
// if (onFaild) {
// onFaild();
// }
// browser.close();
// });
// /*
// browser.on('loadstop').subscribe(event => {
// // browser.insertCSS({ code: 'body{color: white;}' });
// if (onSuccess) {
// onSuccess();
// }
// });
// */
// browser.on('exit').subscribe(event => {
// if (onExit) {
// onExit();
// }
// });
// browser.on('loadstart').subscribe(event => {
// if (successURLS) {
// successURLS.forEach((successURL, index) => {
// if (event.url && event.url.indexOf(successURL) >= 0) {
// // alert('load start found success url');
// browser.close();
// if (onSuccess) {
// onSuccess();
// }
// }
// });
// }
// });
// });
}
public imageFromBase64(base64: string) {

@ -1,64 +1,64 @@
import { ThemeableBrowserOptions } from '@ionic-native/themeable-browser/ngx';
// import { ThemeableBrowserOptions } from '@ionic-native/themeable-browser/ngx';
export class BrowserConfig {
public static OPTIONS: ThemeableBrowserOptions = {
statusbar: {
color: '#ffffffff'
},
toolbar: {
height: 44,
color: '#f0f0f0ff'
},
title: {
color: '#003264ff',
showPageTitle: true
},
backButton: {
image: 'back',
imagePressed: 'back_pressed',
align: 'left',
event: 'backPressed'
},
forwardButton: {
image: 'forward',
imagePressed: 'forward_pressed',
align: 'left',
event: 'forwardPressed'
},
closeButton: {
image: 'close',
imagePressed: 'close_pressed',
align: 'left',
event: 'closePressed'
},
customButtons: [
{
image: 'share',
imagePressed: 'share_pressed',
align: 'right',
event: 'sharePressed'
}
],
menu: {
image: 'menu',
imagePressed: 'menu_pressed',
title: 'Test',
cancel: 'Cancel',
align: 'right',
items: [
{
event: 'helloPressed',
label: 'Hello World!'
},
{
event: 'testPressed',
label: 'Test!'
}
]
},
backButtonCanClose: true,
clearcache: true,
clearsessioncache: true,
disallowoverscroll: 'yes'
};
// public static OPTIONS: ThemeableBrowserOptions = {
// statusbar: {
// color: '#ffffffff'
// },
// toolbar: {
// height: 44,
// color: '#f0f0f0ff'
// },
// title: {
// color: '#003264ff',
// showPageTitle: true
// },
// backButton: {
// image: 'back',
// imagePressed: 'back_pressed',
// align: 'left',
// event: 'backPressed'
// },
// forwardButton: {
// image: 'forward',
// imagePressed: 'forward_pressed',
// align: 'left',
// event: 'forwardPressed'
// },
// closeButton: {
// image: 'close',
// imagePressed: 'close_pressed',
// align: 'left',
// event: 'closePressed'
// },
// customButtons: [
// {
// image: 'share',
// imagePressed: 'share_pressed',
// align: 'right',
// event: 'sharePressed'
// }
// ],
// menu: {
// image: 'menu',
// imagePressed: 'menu_pressed',
// title: 'Test',
// cancel: 'Cancel',
// align: 'right',
// items: [
// {
// event: 'helloPressed',
// label: 'Hello World!'
// },
// {
// event: 'testPressed',
// label: 'Test!'
// }
// ]
// },
// backButtonCanClose: true,
// clearcache: true,
// clearsessioncache: true,
// disallowoverscroll: 'yes'
// };
}

@ -27,7 +27,7 @@ export class ConnectorService {
public static retryTimes = 0;
public static timeOut = 180 * 1000;
//public static host = 'https://uat.hmgwebservices.com/';
// public static host = 'https://uat.hmgwebservices.com/';
// public static host = 'https://hmgwebservices.com/';
// public static host = 'http://10.0.50.241:1010/' // MOE vpn
public static host = 'https://hrmsys.moenergy.gov.sa/'

@ -1,74 +1,74 @@
import { Injectable } from '@angular/core';
import { ThemeableBrowser, ThemeableBrowserOptions, ThemeableBrowserObject } from '@ionic-native/themeable-browser/ngx';
// import { ThemeableBrowser, ThemeableBrowserOptions, ThemeableBrowserObject } from '@ionic-native/themeable-browser/ngx';
import { Platform } from '@ionic/angular';
@Injectable({
providedIn: 'root'
})
export class HmgBrowserService {
static options: ThemeableBrowserOptions = {
statusbar: {
color: '#ffffffff'
},
toolbar: {
height: 44,
color: '#f0f0f0ff'
},
title: {
color: '#60686b',
showPageTitle: true
},
backButton: {
image: 'back',
imagePressed: 'back_pressed',
align: 'left',
event: 'backPressed'
},
forwardButton: {
image: 'forward',
imagePressed: 'forward_pressed',
align: 'left',
event: 'forwardPressed'
},
closeButton: {
image: 'close',
imagePressed: 'close_pressed',
align: 'left',
event: 'closePressed'
},
/*
customButtons: [
{
image: 'share',
imagePressed: 'share_pressed',
align: 'right',
event: 'sharePressed'
}
],
menu: {
image: 'menu',
imagePressed: 'menu_pressed',
title: 'Test',
cancel: 'Cancel',
align: 'right',
items: [
{
event: 'helloPressed',
label: 'Hello World!'
},
{
event: 'testPressed',
label: 'Test!'
}
]
},
*/
backButtonCanClose: true
};
// static options: ThemeableBrowserOptions = {
// statusbar: {
// color: '#ffffffff'
// },
// toolbar: {
// height: 44,
// color: '#f0f0f0ff'
// },
// title: {
// color: '#60686b',
// showPageTitle: true
// },
// backButton: {
// image: 'back',
// imagePressed: 'back_pressed',
// align: 'left',
// event: 'backPressed'
// },
// forwardButton: {
// image: 'forward',
// imagePressed: 'forward_pressed',
// align: 'left',
// event: 'forwardPressed'
// },
// closeButton: {
// image: 'close',
// imagePressed: 'close_pressed',
// align: 'left',
// event: 'closePressed'
// },
// /*
// customButtons: [
// {
// image: 'share',
// imagePressed: 'share_pressed',
// align: 'right',
// event: 'sharePressed'
// }
// ],
// menu: {
// image: 'menu',
// imagePressed: 'menu_pressed',
// title: 'Test',
// cancel: 'Cancel',
// align: 'right',
// items: [
// {
// event: 'helloPressed',
// label: 'Hello World!'
// },
// {
// event: 'testPressed',
// label: 'Test!'
// }
// ]
// },
// */
// backButtonCanClose: true
// };
private browser: ThemeableBrowserObject;
// private browser: ThemeableBrowserObject;
constructor(
private themeableBrowser: ThemeableBrowser,
// private themeableBrowser: ThemeableBrowser,
private platform: Platform
) { }
@ -81,18 +81,18 @@ export class HmgBrowserService {
}
private registerEvent(eventName: string, event: any) {
if (this.browser) {
this.browser.on(eventName).subscribe((data: any) => {
if (event) {
event();
}
});
}
// if (this.browser) {
// this.browser.on(eventName).subscribe((data: any) => {
// if (event) {
// event();
// }
// });
// }
}
public openURLThemable(url: string) {
this.platform.ready().then(() => {
this.browser = this.themeableBrowser.create(url, '_blank', HmgBrowserService.options);
// this.browser = this.themeableBrowser.create(url, '_blank', HmgBrowserService.options);
});
}

@ -1,4 +1,4 @@
<ion-content has-bouncing="false" class="ion-no-padding" >
<ion-content has-bouncing="false" class="ion-no-padding" style="position: inherit !important;">
<ion-grid padding>
<!-- <ion-row>
<ion-col [size]="12">
@ -13,7 +13,7 @@
<ion-row>
<ion-row style="margin-top: 50px;">
<ion-col [size]="12">
<h1 class="heading1">{{welcome}} </h1>
<p *ngIf="!user" class="text1">{{welcome_txt}} </p>

@ -67,6 +67,10 @@
line-height: 1.5;
}
.heading1{
font-size: 26px !important;
}
.button-digital-id{
--background: white !important;
background: white !important;

@ -1,5 +1,5 @@
import { Component, OnInit, NgZone, VERSION } from "@angular/core";
import { NFC } from "@ionic-native/nfc/ngx";
// import { NFC } from "@ionic-native/nfc/ngx";
import { CommonService } from "src/app/hmg-common/services/common/common.service";
import { Platform } from "@ionic/angular";
import { AttendScanService } from "../../hmg-common/services/attend-services/attend-scan.service";
@ -13,11 +13,11 @@ import { attendanceSwipeScannerRequest } from "src/app/home/models/attendanceSwi
import { Device } from "@ionic-native/device/ngx";
import { AttendanceService } from "src/app/home/services/attendance.services";
import { Response } from "src/app/hmg-common/services/models/response";
import { WifiWizard2 } from "@ionic-native/wifi-wizard-2/ngx";
// import { WifiWizard2 } from "@ionic-native/wifi-wizard-2/ngx";
import { OpenNativeSettings } from '@ionic-native/open-native-settings/ngx';
import { DevicePermissionsService } from 'src/app/hmg-common/services/device-permissions/device-permissions.service';
import { Geolocation } from '@ionic-native/geolocation/ngx';
import { BackgroundGeolocation } from '@ionic-native/background-geolocation/ngx';
// import { Geolocation } from '@ionic-native/geolocation/ngx';
// import { BackgroundGeolocation } from '@ionic-native/background-geolocation/ngx';
import { FirebaseX } from '@ionic-native/firebase-x/ngx';
import { HMGUtils } from 'src/app/hmg-common/hmg_utils';
@ -53,7 +53,7 @@ export class AttendanceOptionsComponent implements OnInit {
constructor(
private nfc: NFC,
// private nfc: NFC,
public common: CommonService,
public platform: Platform,
public attendScanService: AttendScanService,
@ -62,11 +62,11 @@ export class AttendanceOptionsComponent implements OnInit {
private device: Device,
private attendance_service: AttendanceService,
public ngZone: NgZone,
private wifiWizard2: WifiWizard2,
// private wifiWizard2: WifiWizard2,
private openNativeSettings: OpenNativeSettings,
private devicePermissionsService:DevicePermissionsService,
private geolocation: Geolocation,
public backgroundGeolocation: BackgroundGeolocation,
// private geolocation: Geolocation,
// public backgroundGeolocation: BackgroundGeolocation,
public hmgUtils: HMGUtils
) {}
@ -88,31 +88,31 @@ export class AttendanceOptionsComponent implements OnInit {
}
async checkNFCStatus(checkValue: string) {
try {
let nfcStatus = await this.nfc.enabled();
console.log("nfc status >>>>>>>>>>" + nfcStatus);
if (nfcStatus === "NFC_OK") {
this.deviceNFC = true;
if (checkValue === "two") {
this.startNFC();
}
}
if (nfcStatus === null && checkValue === "two") {
this.startNFC();
}
} catch (err) {
console.log("Error reading tag", err);
if (err === "NO_NFC") {
this.deviceNFC = false;
} else if (err === "NFC_DISABLED") {
this.deviceNFC = true;
if (checkValue === "two") {
this.common.presentAlert(this.ts.trPK("general", "nfc-settings"));
}
} else if (checkValue === "two") {
this.common.presentAlert(this.ts.trPK("general", "nfc-error"));
}
}
// try {
// let nfcStatus = await this.nfc.enabled();
// console.log("nfc status >>>>>>>>>>" + nfcStatus);
// if (nfcStatus === "NFC_OK") {
// this.deviceNFC = true;
// if (checkValue === "two") {
// this.startNFC();
// }
// }
// if (nfcStatus === null && checkValue === "two") {
// this.startNFC();
// }
// } catch (err) {
// console.log("Error reading tag", err);
// if (err === "NO_NFC") {
// this.deviceNFC = false;
// } else if (err === "NFC_DISABLED") {
// this.deviceNFC = true;
// if (checkValue === "two") {
// this.common.presentAlert(this.ts.trPK("general", "nfc-settings"));
// }
// } else if (checkValue === "two") {
// this.common.presentAlert(this.ts.trPK("general", "nfc-error"));
// }
// }
}
public setServicesPrivilage() {
@ -154,15 +154,15 @@ export class AttendanceOptionsComponent implements OnInit {
}
async startIOSNfc() {
try {
let tag = await this.nfc.scanTag();
console.log(JSON.stringify(tag));
const serialNumber = this.nfc.bytesToHexString(tag.id);
this.swipeAttendanceNFC(serialNumber);
} catch (err) {
this.common.presentAlert(this.ts.trPK("general", "nfc-error"));
console.log("Error reading tag", err);
}
// try {
// let tag = await this.nfc.scanTag();
// console.log(JSON.stringify(tag));
// const serialNumber = this.nfc.bytesToHexString(tag.id);
// this.swipeAttendanceNFC(serialNumber);
// } catch (err) {
// this.common.presentAlert(this.ts.trPK("general", "nfc-error"));
// console.log("Error reading tag", err);
// }
}
public async nfcModal() {
@ -243,38 +243,38 @@ export class AttendanceOptionsComponent implements OnInit {
public async startWifi() {
const isAndroid = this.platform.is("android");
const isIOS = this.platform.is("ios");
const isWifiEnabled = await this.wifiWizard2.isWifiEnabled();
// const isWifiEnabled = await this.wifiWizard2.isWifiEnabled();
const versionType = this.device.version;
const versionTypeInt = parseInt(versionType);
console.log('version type: ' + versionType);
console.log('version Type: ' + versionTypeInt);
if(isAndroid && versionTypeInt > 10) {
if(!isWifiEnabled){
this.showWifiNotEnabled();
return;
}
// if(!isWifiEnabled){
// this.showWifiNotEnabled();
// return;
// }
}
if (isIOS) {
if(!isWifiEnabled){
this.showWifiNotEnabled();
return;
}
// if(!isWifiEnabled){
// this.showWifiNotEnabled();
// return;
// }
} else if(isAndroid) {
let locationPermission = await this.devicePermissionsService.requestLocationAutherization();
if (!locationPermission) {
return;
}
if(!isWifiEnabled){
this.wifiWizard2.setWifiEnabled(true).then(()=>{
this.startWifi();
}).catch((err) => {
console.debug(err);
});
return;
}
// if(!isWifiEnabled){
// this.wifiWizard2.setWifiEnabled(true).then(()=>{
// this.startWifi();
// }).catch((err) => {
// console.debug(err);
// });
// return;
// }
}
// opening wifi dailog if all above conditions are passed (isWifiEnabled == true)
let modal = await this.modalController.create({

@ -5,7 +5,7 @@ import { Routes, RouterModule } from '@angular/router';
import { HmgCommonModule } from '../hmg-common/hmg-common.module';
import { IonicModule } from '@ionic/angular';
import { HomePage } from './home.page';
import { BarcodeScanner } from '@ionic-native/barcode-scanner/ngx';
// import { BarcodeScanner } from '@ionic-native/barcode-scanner/ngx';
import { WorklistMainService } from '../notification/service/work-list.main.service';
import { AttendanceOptionsComponent } from './attendance-options/attendance-options.component';
import { NfcModalComponent } from './nfc-modal/nfc-modal.component';
@ -36,7 +36,7 @@ const routes: Routes = [
WifiModalComponent
],
providers: [
BarcodeScanner,
// BarcodeScanner,
WorklistMainService
],
entryComponents: [

@ -7,8 +7,8 @@ import { AuthenticatedUser } from 'src/app/hmg-common/services/authentication/mo
import { MenuService } from 'src/app/hmg-common/services/menu/menuservice.service';
import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response';
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
import { Geolocation } from '@ionic-native/geolocation/ngx';
import { BarcodeScanner } from '@ionic-native/barcode-scanner/ngx';
// import { Geolocation } from '@ionic-native/geolocation/ngx';
// import { BarcodeScanner } from '@ionic-native/barcode-scanner/ngx';
import { Device } from '@ionic-native/device/ngx';
import { attendanceSwipeScannerRequest } from './models/attendanceSwipe.Request';
import { COCRequest } from 'src/app/notification/models/COCRequest';
@ -37,8 +37,8 @@ import { TimeCardService } from '../time-card/service/time-card.service';
import { WorklistMainService } from '../notification/service/work-list.main.service';
import { isThisISOWeek } from 'date-fns';
import { Router } from '@angular/router';
import { BackgroundGeolocation } from '@ionic-native/background-geolocation/ngx';
import { NFC, Ndef } from "@ionic-native/nfc/ngx"
// import { BackgroundGeolocation } from '@ionic-native/background-geolocation/ngx';
// import { NFC, Ndef } from "@ionic-native/nfc/ngx"
import { DigitalIdComponent } from '../authentication/digital-id/digital-id.component';
import { FirebaseX } from '@ionic-native/firebase-x/ngx';
import { BusinessCardComponent } from "src/app/authentication/business-card/business-card.component";
@ -54,7 +54,7 @@ export class HomePage implements OnInit {
userData: any = {};
userImage: any = '../assets/imgs/profile.png';
menuList: any = [];
zbarOptions: any;
// zbarOptions: any;
scannedResult: any;
notBadge: any;
lat: any;
@ -144,10 +144,10 @@ export class HomePage implements OnInit {
public common: CommonService,
public events: Events,
private device: Device,
private geolocation: Geolocation,
// private geolocation: Geolocation,
private attendanceService: AttendanceService,
private eitService: EitService,
private barcodeScanner: BarcodeScanner,
// private barcodeScanner: BarcodeScanner,
public actionSheetCtrl: ActionSheetController,
public sharedData: SharedDataService,
private sanitizer: DomSanitizer,
@ -159,9 +159,9 @@ export class HomePage implements OnInit {
public workListService: WorklistMainService,
public router: Router,
private platform: Platform,
public backgroundGeolocation: BackgroundGeolocation,
// public backgroundGeolocation: BackgroundGeolocation,
public modalController: ModalController,
private nfc: NFC,
// private nfc: NFC,
public firebasex: FirebaseX
) {
this.events.subscribe('img-change', displayImg => {
@ -272,32 +272,32 @@ export class HomePage implements OnInit {
this.location = granted as boolean;
if (this.location) {
if (this.platform.is('android')) {
this.backgroundGeolocation.getCurrentLocation({ timeout: 10000, enableHighAccuracy: true, maximumAge: 3000 }).then((resp) => {
if (resp && (resp.latitude && resp.longitude)) {
if (resp.isFromMockProvider || resp.mockLocationsEnabled) {
this.isFakeLocationUsed = true;
}
this.lat = resp.latitude;
this.longt = resp.longitude;
this.attendance();
} else {
this.common.presentAlert(this.ts.trPK('home', 'position-error'));
}
}, (error) => {
this.common.presentAlert(this.ts.trPK('home', 'position-error'));
});
// this.backgroundGeolocation.getCurrentLocation({ timeout: 10000, enableHighAccuracy: true, maximumAge: 3000 }).then((resp) => {
// if (resp && (resp.latitude && resp.longitude)) {
// if (resp.isFromMockProvider || resp.mockLocationsEnabled) {
// this.isFakeLocationUsed = true;
// }
// this.lat = resp.latitude;
// this.longt = resp.longitude;
// this.attendance();
// } else {
// this.common.presentAlert(this.ts.trPK('home', 'position-error'));
// }
// }, (error) => {
// this.common.presentAlert(this.ts.trPK('home', 'position-error'));
// });
} else {
this.geolocation.getCurrentPosition({ maximumAge: 3000, timeout: 10000, enableHighAccuracy: true }).then(resp => {
if (resp && resp.coords.latitude && resp.coords.longitude) {
this.lat = resp.coords.latitude;
this.longt = resp.coords.longitude;
this.attendance();
} else {
this.common.presentAlert(this.ts.trPK('home', 'position-error'));
}
}).catch(error => {
this.common.presentAlert(this.ts.trPK('home', 'position-error'));
});
// this.geolocation.getCurrentPosition({ maximumAge: 3000, timeout: 10000, enableHighAccuracy: true }).then(resp => {
// if (resp && resp.coords.latitude && resp.coords.longitude) {
// this.lat = resp.coords.latitude;
// this.longt = resp.coords.longitude;
// this.attendance();
// } else {
// this.common.presentAlert(this.ts.trPK('home', 'position-error'));
// }
// }).catch(error => {
// this.common.presentAlert(this.ts.trPK('home', 'position-error'));
// });
}
} else {
return false;
@ -551,22 +551,22 @@ export class HomePage implements OnInit {
}
scanCode() {
this.barcodeScanner
.scan()
.then(barcodeData => {
if (!barcodeData.cancelled) {
this.scannedResult = barcodeData;
this.deviceID = this.device.uuid;
if (this.isFakeLocationUsed) {
this.fakeSwipeAttendance();
} else {
this.swipeAttendance();
}
}
})
.catch(err => {
console.log('Error', err);
});
// this.barcodeScanner
// .scan()
// .then(barcodeData => {
// if (!barcodeData.cancelled) {
// this.scannedResult = barcodeData;
// this.deviceID = this.device.uuid;
// if (this.isFakeLocationUsed) {
// this.fakeSwipeAttendance();
// } else {
// this.swipeAttendance();
// }
// }
// })
// .catch(err => {
// console.log('Error', err);
// });
}
fakeSwipeAttendance() {

@ -1,5 +1,5 @@
import { Component, OnInit, NgZone } from '@angular/core';
import { NFC } from "@ionic-native/nfc/ngx"
// import { NFC } from "@ionic-native/nfc/ngx"
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
import {AttendScanService} from '../../hmg-common/services/attend-services/attend-scan.service';
import { attendanceSwipeScannerRequest } from 'src/app/home/models/attendanceSwipe.Request';
@ -24,7 +24,7 @@ export class NfcModalComponent implements OnInit {
public longt: number;
constructor(
private nfc: NFC,
// private nfc: NFC,
public common: CommonService,
public attendScanService: AttendScanService,
private device: Device,
@ -45,15 +45,15 @@ export class NfcModalComponent implements OnInit {
}
async startAndroidNfc() {
let flags = this.nfc.FLAG_READER_NFC_A | this.nfc.FLAG_READER_NFC_V;
this.nfcReader = this.nfc.readerMode(flags).subscribe((tag) => {
const serialNumber = this.nfc.bytesToHexString(tag.id);
this.swipeAttendanceNFC(serialNumber);
}, (error) => {
this.modalController.dismiss();
this.common.presentAlert(this.ts.trPK('general', 'nfc-error'));
console.log('error =====>>>>>> + + + =' + error);
});
// let flags = this.nfc.FLAG_READER_NFC_A | this.nfc.FLAG_READER_NFC_V;
// this.nfcReader = this.nfc.readerMode(flags).subscribe((tag) => {
// const serialNumber = this.nfc.bytesToHexString(tag.id);
// this.swipeAttendanceNFC(serialNumber);
// }, (error) => {
// this.modalController.dismiss();
// this.common.presentAlert(this.ts.trPK('general', 'nfc-error'));
// console.log('error =====>>>>>> + + + =' + error);
// });
}
public swipeAttendanceNFC (nfcSerialCode: any) {

@ -8,7 +8,7 @@ import { Response } from 'src/app/hmg-common/services/models/response';
import { ModalController } from '@ionic/angular';
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
import { Platform } from "@ionic/angular";
import { WifiWizard2 } from "@ionic-native/wifi-wizard-2/ngx";
// import { WifiWizard2 } from "@ionic-native/wifi-wizard-2/ngx";
import { OpenNativeSettings } from '@ionic-native/open-native-settings/ngx';
import { AttendScanService } from "../../hmg-common/services/attend-services/attend-scan.service";
@ -42,7 +42,7 @@ export class WifiModalComponent implements OnInit {
public modalController: ModalController,
public ts: TranslatorService,
public ngZone: NgZone,
private wifiWizard2: WifiWizard2,
// private wifiWizard2: WifiWizard2,
private openNativeSettings: OpenNativeSettings,
private platform: Platform,
public attendScanService: AttendScanService
@ -58,8 +58,8 @@ export class WifiModalComponent implements OnInit {
async getConnectedBSSID(ssid:string){
let avaialbleSSID = await this.wifiWizard2.getConnectedBSSID();
console.log(avaialbleSSID);
// let avaialbleSSID = await this.wifiWizard2.getConnectedBSSID();
// console.log(avaialbleSSID);
}
async startWifiConnection() {
@ -67,49 +67,49 @@ export class WifiModalComponent implements OnInit {
const isIOS = this.platform.is("ios");
if (isAndroid) {
let isWifiAvailable = await this.isWifiAvailable(this.ssid);
console.debug("isWifiAvailable: " + isWifiAvailable);
if(isWifiAvailable){
console.debug("Wifi Credientials: " + this.ssid + " | " + this.password);
this.wifiWizard2.connect(this.ssid, true, this.password, this.algo).then(async (value) =>{
let ssid_ = await this.wifiWizard2.getConnectedSSID();
if(ssid_ == this.ssid){
console.debug("Wifi Connected: Verified Access | " + value + " | " + ssid_);
setTimeout(() => {
this.swipeAttendanceWifi(ssid_);
},2000);
}else{
this.showErrorInvalidWorkspace();
}
})
.catch((err) => {
console.debug(err);
this.showErrorForgetWifiConfiguration();
});
}else{
console.debug("Wifi is not available considered your device is not in range");
this.showErrorInvalidWorkspace();
}
// let isWifiAvailable = await this.isWifiAvailable(this.ssid);
// console.debug("isWifiAvailable: " + isWifiAvailable);
// if(isWifiAvailable){
// console.debug("Wifi Credientials: " + this.ssid + " | " + this.password);
// this.wifiWizard2.connect(this.ssid, true, this.password, this.algo).then(async (value) =>{
// let ssid_ = await this.wifiWizard2.getConnectedSSID();
// if(ssid_ == this.ssid){
// console.debug("Wifi Connected: Verified Access | " + value + " | " + ssid_);
// setTimeout(() => {
// this.swipeAttendanceWifi(ssid_);
// },2000);
// }else{
// this.showErrorInvalidWorkspace();
// }
// })
// .catch((err) => {
// console.debug(err);
// this.showErrorForgetWifiConfiguration();
// });
// }else{
// console.debug("Wifi is not available considered your device is not in range");
// this.showErrorInvalidWorkspace();
// }
} else if (isIOS) {
this.wifiWizard2.iOSConnectNetwork(this.ssid,this.password).then(async (value) => {
let ssid_ = await this.wifiWizard2.getConnectedSSID();
if(ssid_ == this.ssid){
console.debug("Wifi Connected: Verified Access | " + value + " | " + ssid_);
setTimeout(() => {
this.swipeAttendanceWifi(ssid_);
},6000);
}else{
this.showErrorInvalidWorkspace();
}
})
.catch((err) => {
console.debug(err);
this.showErrorInvalidWorkspace();
});
if(this.wifiWizard2.isWifiEnabled){
} else{
this.showWifiNotEnabled();
}
// this.wifiWizard2.iOSConnectNetwork(this.ssid,this.password).then(async (value) => {
// let ssid_ = await this.wifiWizard2.getConnectedSSID();
// if(ssid_ == this.ssid){
// console.debug("Wifi Connected: Verified Access | " + value + " | " + ssid_);
// setTimeout(() => {
// this.swipeAttendanceWifi(ssid_);
// },6000);
// }else{
// this.showErrorInvalidWorkspace();
// }
// })
// .catch((err) => {
// console.debug(err);
// this.showErrorInvalidWorkspace();
// });
// if(this.wifiWizard2.isWifiEnabled){
// } else{
// this.showWifiNotEnabled();
// }
}
}
@ -142,13 +142,13 @@ export class WifiModalComponent implements OnInit {
async disconnectWifi() {
const isAndroid = this.platform.is("android");
const isIOS = this.platform.is("ios");
if(isAndroid){
await this.wifiWizard2.disconnect(this.ssid).catch((error)=>{ console.error(error) });
await this.wifiWizard2.remove(this.ssid).catch((error)=>{ console.error(error) });
console.debug("Wifi Removed");
}else if(isIOS){
await this.wifiWizard2.iOSDisconnectNetwork(this.ssid);
}
// if(isAndroid){
// await this.wifiWizard2.disconnect(this.ssid).catch((error)=>{ console.error(error) });
// await this.wifiWizard2.remove(this.ssid).catch((error)=>{ console.error(error) });
// console.debug("Wifi Removed");
// }else if(isIOS){
// await this.wifiWizard2.iOSDisconnectNetwork(this.ssid);
// }
}
async swipeAttendanceWifi(code:any) {
@ -211,15 +211,15 @@ export class WifiModalComponent implements OnInit {
}
async isWifiAvailable(ssid:string){
let avaialble_wifi = await this.wifiWizard2.scan();
let find = avaialble_wifi.find(element => {
return element.SSID == ssid;
});
// let avaialble_wifi = await this.wifiWizard2.scan();
// let find = avaialble_wifi.find(element => {
// return element.SSID == ssid;
// });
if (find === undefined) {
return false;
} else {
return find.SSID == ssid;
}
// if (find === undefined) {
// return false;
// } else {
// return find.SSID == ssid;
// }
}
}

@ -2,7 +2,7 @@ import { Component, OnInit } from '@angular/core';
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
import { OfferDiscountService } from '../services/service';
import { SocialSharing } from '@ionic-native/social-sharing/ngx';
// import { SocialSharing } from '@ionic-native/social-sharing/ngx';
import { DomSanitizer } from '@angular/platform-browser';
@Component({
selector: 'app-offer-details',
@ -13,7 +13,7 @@ export class OfferDetailsComponent implements OnInit {
public details: any;
public direction: String;
public related: any;
constructor(public ts: TranslatorService, private socialSharing: SocialSharing, public cs: CommonService, public offersService: OfferDiscountService, private sanitizer: DomSanitizer) { }
constructor(public ts: TranslatorService, public cs: CommonService, public offersService: OfferDiscountService, private sanitizer: DomSanitizer) { }
ngOnInit() {
this.direction = TranslatorService.getCurrentDirection();
@ -45,9 +45,9 @@ export class OfferDetailsComponent implements OnInit {
subject: this.stripHtml(offerSubject),
files: [this.details.Banner_Image]
}
this.socialSharing.shareWithOptions(options).then((result) => {
console.log(result);
})
// this.socialSharing.shareWithOptions(options).then((result) => {
// console.log(result);
// })
}
openRelated(item) {
this.cs.sharedService.setSharedData(item, OfferDiscountService.selected_offers);

@ -2,7 +2,7 @@ import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { Routes, RouterModule } from '@angular/router';
import { SocialSharing } from '@ionic-native/social-sharing/ngx';
// import { SocialSharing } from '@ionic-native/social-sharing/ngx';
import { IonicModule } from '@ionic/angular';
import { OffersdiscountPage } from './offersdiscount.page';
@ -54,7 +54,7 @@ const routes: Routes = [
],
declarations: [OffersdiscountPage, HomeComponent, OfferDetailsComponent, FilterComponent, LocationComponent],
entryComponents: [FilterComponent],
providers: [OfferDiscountService, SocialSharing],
providers: [OfferDiscountService],
})
export class OffersdiscountPageModule { }

Loading…
Cancel
Save