|
|
|
|
@ -19,7 +19,9 @@ import { DevicePermissionsService } from 'src/app/hmg-common/services/device-per
|
|
|
|
|
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';
|
|
|
|
|
|
|
|
|
|
declare var cordova: any;
|
|
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
|
selector: "app-attendance-options",
|
|
|
|
|
@ -47,6 +49,7 @@ export class AttendanceOptionsComponent implements OnInit {
|
|
|
|
|
public firebasex: FirebaseX
|
|
|
|
|
public isDocumentAvailable = false;
|
|
|
|
|
public document: any;
|
|
|
|
|
public check: any;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
constructor(
|
|
|
|
|
@ -63,7 +66,8 @@ export class AttendanceOptionsComponent implements OnInit {
|
|
|
|
|
private openNativeSettings: OpenNativeSettings,
|
|
|
|
|
private devicePermissionsService:DevicePermissionsService,
|
|
|
|
|
private geolocation: Geolocation,
|
|
|
|
|
public backgroundGeolocation: BackgroundGeolocation
|
|
|
|
|
public backgroundGeolocation: BackgroundGeolocation,
|
|
|
|
|
public hmgUtils: HMGUtils
|
|
|
|
|
) {}
|
|
|
|
|
|
|
|
|
|
ngOnInit() {
|
|
|
|
|
@ -76,6 +80,18 @@ export class AttendanceOptionsComponent implements OnInit {
|
|
|
|
|
this.priviligeList = AuthenticationService.servicePrivilage;
|
|
|
|
|
this.setServicesPrivilage();
|
|
|
|
|
this.checkNFCStatus("one");
|
|
|
|
|
this.test();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async test () {
|
|
|
|
|
const test = await this.hmgUtils.isHuaweiDevice();
|
|
|
|
|
if (test) {
|
|
|
|
|
this.check = 'this device is huawei device :' + test;
|
|
|
|
|
console.log('this device is huawei device :' + test);
|
|
|
|
|
} else {
|
|
|
|
|
this.check = 'this device is not huawei device :' + test;
|
|
|
|
|
console.log('this device is non-huawei device :' + test);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public checkFirebaseDocument() {
|
|
|
|
|
|