|
|
|
@ -88,9 +88,9 @@ export class AppComponent implements OnInit, AfterViewInit {
|
|
|
|
console.log("platform.ready")
|
|
|
|
console.log("platform.ready")
|
|
|
|
this.pushService.startReceiving();
|
|
|
|
this.pushService.startReceiving();
|
|
|
|
setTimeout(() => {
|
|
|
|
setTimeout(() => {
|
|
|
|
|
|
|
|
console.log(" in setTimeout startReceiving");
|
|
|
|
this.getLastLoginInfo();
|
|
|
|
this.getLastLoginInfo();
|
|
|
|
},5000);
|
|
|
|
},4000);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
subscribeEvents() {
|
|
|
|
subscribeEvents() {
|
|
|
|
@ -202,8 +202,18 @@ export class AppComponent implements OnInit, AfterViewInit {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
getLastLoginInfo(){
|
|
|
|
getLastLoginInfo(){
|
|
|
|
this.deviceToken= localStorage.getItem('devicyeToken');
|
|
|
|
|
|
|
|
console.log("let deviceToken app" + this.deviceToken);
|
|
|
|
|
|
|
|
|
|
|
|
console.log(" getLastLoginInfo");
|
|
|
|
|
|
|
|
console.log("get method :"+this.cs.getDeviceToken());
|
|
|
|
|
|
|
|
this.deviceToken= this.cs.getDeviceToken();
|
|
|
|
|
|
|
|
//this.cs.sharedService.getSharedData("new-device-token",false);// localStorage.getItem('devicyeToken');
|
|
|
|
|
|
|
|
console.log("let deviceToken app" + this.cs.sharedService.getSharedData("new-device-token",false));
|
|
|
|
|
|
|
|
console.log("localStorage.getItem app" + localStorage.getItem('devicyeToken'));
|
|
|
|
|
|
|
|
console.log("sheard DEVICE_TOKEN" + this.cs.sharedService.getSharedData(AuthenticationService.DEVICE_TOKEN, false));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (this.deviceToken) {
|
|
|
|
if (this.deviceToken) {
|
|
|
|
console.log('login enabled first time: ' + this.deviceToken);
|
|
|
|
console.log('login enabled first time: ' + this.deviceToken);
|
|
|
|
@ -236,8 +246,10 @@ export class AppComponent implements OnInit, AfterViewInit {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
this.user = true;
|
|
|
|
this.user = true;
|
|
|
|
this.events.publish('user', this.user);
|
|
|
|
this.events.publish('user', this.user);
|
|
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
|
|
|
this.splashScreen.hide();
|
|
|
|
|
|
|
|
},3000);
|
|
|
|
|
|
|
|
|
|
|
|
this.splashScreen.hide();
|
|
|
|
|
|
|
|
if(this.logoutFlage){
|
|
|
|
if(this.logoutFlage){
|
|
|
|
this.cs.openLogin();
|
|
|
|
this.cs.openLogin();
|
|
|
|
|
|
|
|
|
|
|
|
@ -247,7 +259,11 @@ export class AppComponent implements OnInit, AfterViewInit {
|
|
|
|
else{
|
|
|
|
else{
|
|
|
|
this.user = false;
|
|
|
|
this.user = false;
|
|
|
|
this.events.publish('user', this.user);
|
|
|
|
this.events.publish('user', this.user);
|
|
|
|
this.splashScreen.hide();
|
|
|
|
|
|
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
|
|
|
this.splashScreen.hide();
|
|
|
|
|
|
|
|
},3000);
|
|
|
|
|
|
|
|
|
|
|
|
if(this.logoutFlage){
|
|
|
|
if(this.logoutFlage){
|
|
|
|
this.cs.openLogin();
|
|
|
|
this.cs.openLogin();
|
|
|
|
|
|
|
|
|
|
|
|
|