mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 05:16:07 +00:00
Improve tinymce autosave and notification web click solved
This commit is contained in:
@@ -102,7 +102,7 @@ export class RoomService {
|
||||
private ViewedMessageService: ViewedMessageService,
|
||||
private notificationService: NotificationsService
|
||||
) {
|
||||
this.NativeNotificationService.askForPermission()
|
||||
/* this.NativeNotificationService.askForPermission() */
|
||||
|
||||
this.RochetChatConnectorService.getUserStatus((d) => {
|
||||
|
||||
@@ -337,10 +337,10 @@ export class RoomService {
|
||||
}
|
||||
|
||||
if(this.isSenderIsNotMe(ChatMessage)) {
|
||||
this.NativeNotificationService.sendNotificationChat({
|
||||
/* this.NativeNotificationService.sendNotificationChat({
|
||||
message: message.msg,
|
||||
title: this.name
|
||||
});
|
||||
}); */
|
||||
}
|
||||
|
||||
if(this.hasLoadHistory == true) {
|
||||
|
||||
@@ -15,26 +15,33 @@ export class NativeNotificationService {
|
||||
|
||||
askForPermission() {
|
||||
|
||||
LocalNotifications.requestPermissions()
|
||||
/* LocalNotifications.requestPermissions()
|
||||
|
||||
LocalNotifications.checkPermissions().then((data)=>{
|
||||
//
|
||||
}).catch((data)=>{
|
||||
//
|
||||
})
|
||||
}) */
|
||||
|
||||
}
|
||||
|
||||
foregroundNotification() {
|
||||
|
||||
LocalNotifications.addListener('localNotificationReceived', (notification) => {
|
||||
/* LocalNotifications.addListener('localNotificationReceived', (notification) => {
|
||||
|
||||
})
|
||||
}) */
|
||||
}
|
||||
|
||||
backgroundNotification() {
|
||||
/* LocalNotifications.addListener('localNotificationActionPerformed', (action) => {
|
||||
console.log('Local notification action performed (background):', action);
|
||||
// Implemente a lógica para lidar com a ação da notificação em segundo plano
|
||||
}); */
|
||||
}
|
||||
|
||||
sendNotificationChat({title = 'User', icon = '', message = 'hello'}) {
|
||||
|
||||
LocalNotifications.schedule({
|
||||
/* LocalNotifications.schedule({
|
||||
notifications:[
|
||||
{
|
||||
title : title,
|
||||
@@ -42,7 +49,7 @@ export class NativeNotificationService {
|
||||
id : new Date().getTime()
|
||||
}
|
||||
]
|
||||
});
|
||||
}); */
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -188,25 +188,44 @@ export class NotificationsService {
|
||||
}
|
||||
|
||||
onReciveBackground() {
|
||||
if (!this.isPushNotificationsAvailable) {
|
||||
return false
|
||||
}
|
||||
|
||||
PushNotifications.addListener('pushNotificationActionPerformed',
|
||||
(notification: ActionPerformed) => {
|
||||
this.active = true
|
||||
console.log('NOtification Listener Backgroud', notification)
|
||||
/* this.DataArray.push(notification.notification)
|
||||
|
||||
this.storageService.store("Notifications", this.DataArray)
|
||||
this.eventtrigger.publishSomeData({
|
||||
notification: "recive"
|
||||
}) */
|
||||
this.notificatinsRoutes(notification)
|
||||
// this.runNotificationCallback(notification)
|
||||
if(this.platform.is('mobile')) {
|
||||
if (!this.isPushNotificationsAvailable) {
|
||||
return false
|
||||
}
|
||||
);
|
||||
|
||||
PushNotifications.addListener('pushNotificationActionPerformed',
|
||||
(notification: ActionPerformed) => {
|
||||
this.active = true
|
||||
console.log('NOtification Listener Backgroud', notification)
|
||||
/* this.DataArray.push(notification.notification)
|
||||
|
||||
this.storageService.store("Notifications", this.DataArray)
|
||||
this.eventtrigger.publishSomeData({
|
||||
notification: "recive"
|
||||
}) */
|
||||
this.notificatinsRoutes(notification)
|
||||
// this.runNotificationCallback(notification)
|
||||
}
|
||||
);
|
||||
} else {
|
||||
navigator.serviceWorker.onmessage = (event) => {
|
||||
console.log('Mensagem recebida do Service Worker:', event.data.data);
|
||||
let object = {
|
||||
notification: event.data
|
||||
}
|
||||
|
||||
this.notificatinsRoutes(object)
|
||||
// Implemente a lógica para lidar com a mensagem recebida do Service Worker
|
||||
if (event.data.notificationClicked) {
|
||||
console.log('Notificação push do Firebase clicada em segundo plano!');
|
||||
// Implemente ações adicionais conforme necessário
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
ChatSendMessageNotification(userID, title, bodymsg, roomId) {
|
||||
const geturl = environment.apiURL + `notifications/sendbyUsername`;
|
||||
@@ -250,7 +269,7 @@ export class NotificationsService {
|
||||
|
||||
notificatinsRoutes = (notification) => {
|
||||
|
||||
|
||||
console.log('BACK BACK',notification)
|
||||
|
||||
if (notification.notification.data.Service === "agenda" && notification.notification.data.IdObject.length > 10) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user