mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 13:55:51 +00:00
Notification done
This commit is contained in:
@@ -100,16 +100,9 @@ export class NotificationsService {
|
||||
const geturl = environment.apiURL + 'notifications/token';
|
||||
PushNotifications.addListener('registration',
|
||||
(token: Token) => {
|
||||
|
||||
|
||||
this.storageService.store(username, token.value);
|
||||
this.storageService.get(username).then(value => {
|
||||
|
||||
this.storageService.get(AuthConnstants.USER).then(res => {
|
||||
|
||||
const headers = { 'Authorization': SessionStore.user.BasicAuthKey };
|
||||
const body = {
|
||||
UserId: res.UserId,
|
||||
UserId: SessionStore.user.UserId,
|
||||
TokenId: token.value,
|
||||
Status: 1,
|
||||
Service: 1
|
||||
@@ -117,17 +110,10 @@ export class NotificationsService {
|
||||
|
||||
this.http.post<Tokenn>(`${geturl}`, body, { headers }).subscribe(data => {
|
||||
this.active = true
|
||||
//console.log(data)
|
||||
console.log(data)
|
||||
}, (error) => {
|
||||
//console.log(error)
|
||||
console.log(error)
|
||||
})
|
||||
}).catch((error) => {
|
||||
console.error('storage authorization', error)
|
||||
});;
|
||||
|
||||
}).catch((error) => {
|
||||
console.error('storage getAndPostToken', error)
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user