Mohemm Wifi Attendance, Fix

mohemm-wifi-feature
Zohaib Iqbal Kambrani 5 years ago
parent 95d608fca8
commit e67ade154f

@ -24,8 +24,8 @@ export class ConnectorService {
public static timeOut = 120 * 1000;
// public static host = 'http://10.50.100.113:6060/'; // development service
public static host = 'https://uat.hmgwebservices.com/';
// public static host = 'https://hmgwebservices.com/';
// public static host = 'https://uat.hmgwebservices.com/';
public static host = 'https://hmgwebservices.com/';
// public static host = 'http://10.50.100.198:6060/';
// public static host = 'http://10.50.100.113:6060/'; // development service
/* public static host = 'http://10.50.100.198:6060/';

@ -58,11 +58,13 @@ export class WifiModalComponent implements OnInit {
if (isAndroid) {
console.log("Connecting wifi to mark attendance...");
this.wifiWizard2.connect(this.ssid, true, this.password, this.algo).then((value) => {
this.wifiWizard2.connect(this.ssid, true, this.password, this.algo).then(async (value) =>{
console.log("Wifi Connected: Verified Access | " + value);
let ssid_ = await this.wifiWizard2.getConnectedSSID();
let bssid = await this.wifiWizard2.getConnectedBSSID();
console.log("Wifi Connected: Verified Access | " + value + " | " + ssid_ + " | " + bssid);
setTimeout(() => {
this.swipeAttendanceWifi(this.ssid);
this.swipeAttendanceWifi(bssid);
},2000);
})
@ -81,7 +83,7 @@ export class WifiModalComponent implements OnInit {
console.log("Wifi Connected: Verified Access | " + value + " | " + ssid_ + " | " + bssid);
setTimeout(() => {
this.swipeAttendanceWifi(this.ssid);
},2000);
},1000);
})
.catch((err) => {
@ -121,8 +123,8 @@ export class WifiModalComponent implements OnInit {
}
async swipeAttendanceWifi(code:string) {
this.attendScanService.getDeviceLocation( async (latitude, longitude)=>{
async swipeAttendanceWifi(code:any) {
// this.attendScanService.getDeviceLocation( async (latitude, longitude)=>{
console.log("Marking attendance to server... at location: "); //+ latitude +","+longitude
let ip = await this.wifiWizard2.getWifiIP();
@ -154,13 +156,13 @@ export class WifiModalComponent implements OnInit {
setTimeout(() => {
this.closeModal();
this.common.openHome();
}, 4000);
}, 6000);
}else{
console.log(result);
this.closeModal();
}
});
});
// });
}
public closeModal() {

Loading…
Cancel
Save