mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
Notification code Refactory
This commit is contained in:
@@ -81,28 +81,7 @@ export class LoginPage implements OnInit {
|
||||
}
|
||||
|
||||
getToken() {
|
||||
this.fcm.getToken().then(token => {
|
||||
console.log('token: ', token)
|
||||
this.storageService.store(this.username, token);
|
||||
this.storageService.get(this.username).then(value => {
|
||||
console.log('STORAGE TOKEN', value)
|
||||
this.storageService.get(AuthConnstants.USER).then(res => {
|
||||
console.log('USERID', res);
|
||||
const headers = { 'Authorization': 'Basic cGF1bG8ucGludG9AZ2FiaW5ldGVkaWdpdGFsLmxvY2FsOnRhYnRlc3RlQDAwNg==' };
|
||||
const body = {
|
||||
UserId: res.UserId,
|
||||
TokenId: token,
|
||||
Status: 1,
|
||||
Service: 1
|
||||
};
|
||||
|
||||
this.http.post<Token>('https://equilibrium.dyndns.info/GabineteDigital.Services/V4/api/notifications/token', body, { headers }).subscribe(data => {
|
||||
console.log('TOKEN USER MIDLE', data);
|
||||
})
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
this.notificatinsservice.getAndpostToken(this.username)
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user