Improve tinymce autosave and notification web click solved

This commit is contained in:
Eudes Inácio
2023-08-08 15:40:10 +01:00
parent 5cf48c1b2f
commit bf89e46841
10 changed files with 109 additions and 63 deletions
+3 -3
View File
@@ -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()
}
]
});
}); */
}
+36 -17
View File
@@ -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) {