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 timeOut = 120 * 1000;
// public static host = 'http://10.50.100.113:6060/'; // development service // public static host = 'http://10.50.100.113:6060/'; // development service
public static host = 'https://uat.hmgwebservices.com/'; // public static host = 'https://uat.hmgwebservices.com/';
// public static host = 'https://hmgwebservices.com/'; public static host = 'https://hmgwebservices.com/';
// public static host = 'http://10.50.100.198:6060/'; // 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.113:6060/'; // development service
/* public static host = 'http://10.50.100.198:6060/'; /* public static host = 'http://10.50.100.198:6060/';

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

Loading…
Cancel
Save