fix notification

This commit is contained in:
Peter Maquiran
2022-01-29 17:06:25 +01:00
parent 2a0744e9ae
commit db987b00f9
5 changed files with 18 additions and 14 deletions
+8 -3
View File
@@ -2213,15 +2213,20 @@
"resolved": "https://registry.npmjs.org/@capacitor/keyboard/-/keyboard-1.1.3.tgz", "resolved": "https://registry.npmjs.org/@capacitor/keyboard/-/keyboard-1.1.3.tgz",
"integrity": "sha512-WpD1f/3HH6IpADiRaFTDGdhrqYhZDikybXXhUdGAEEwHbErHt9zS5RQgbeROjGmkXcurVvQsalQ59YuKU0VzwA==" "integrity": "sha512-WpD1f/3HH6IpADiRaFTDGdhrqYhZDikybXXhUdGAEEwHbErHt9zS5RQgbeROjGmkXcurVvQsalQ59YuKU0VzwA=="
}, },
"@capacitor/local-notifications": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@capacitor/local-notifications/-/local-notifications-1.1.0.tgz",
"integrity": "sha512-l6S9rBylxGPq/U+xpJzZcOL4l2s8I2Igq7uDTidR4imIxxX3bLRz9nDSQREWsbQkFx7ALFm/5Y8PJGz2C6qKPw=="
},
"@capacitor/network": { "@capacitor/network": {
"version": "1.0.6", "version": "1.0.6",
"resolved": "https://registry.npmjs.org/@capacitor/network/-/network-1.0.6.tgz", "resolved": "https://registry.npmjs.org/@capacitor/network/-/network-1.0.6.tgz",
"integrity": "sha512-xkkmRLlFcg1dM0WfblxKwcKFjcfBQ04yWYX0ubD/n5QfQjLCCb8GbAHlorqIyt2j4PUvSAb0ERLyL89hpKlh2w==" "integrity": "sha512-xkkmRLlFcg1dM0WfblxKwcKFjcfBQ04yWYX0ubD/n5QfQjLCCb8GbAHlorqIyt2j4PUvSAb0ERLyL89hpKlh2w=="
}, },
"@capacitor/push-notifications": { "@capacitor/push-notifications": {
"version": "1.0.7", "version": "1.0.9",
"resolved": "https://registry.npmjs.org/@capacitor/push-notifications/-/push-notifications-1.0.7.tgz", "resolved": "https://registry.npmjs.org/@capacitor/push-notifications/-/push-notifications-1.0.9.tgz",
"integrity": "sha512-vbvAptFq5cI6xKYYWMb7tsWvA88/PTG4v6ptxN0Ygtc1fQ4l/AzONQiYqdtFpbBhF2fML2kXQ/5eSAfn8HY9aw==" "integrity": "sha512-NaH+drTYjOGgFMHl/2Jn1/+2rlgomtwP2NfK20E0i7+QoRze1ArcSThJ4vSF0m7VkYBsH3MgbXkWfNSSPaYrtw=="
}, },
"@capacitor/share": { "@capacitor/share": {
"version": "1.0.7", "version": "1.0.7",
+2 -1
View File
@@ -43,8 +43,9 @@
"@capacitor/haptics": "^1.1.2", "@capacitor/haptics": "^1.1.2",
"@capacitor/ios": "3.3.0", "@capacitor/ios": "3.3.0",
"@capacitor/keyboard": "^1.1.2", "@capacitor/keyboard": "^1.1.2",
"@capacitor/local-notifications": "^1.1.0",
"@capacitor/network": "^1.0.6", "@capacitor/network": "^1.0.6",
"@capacitor/push-notifications": "^1.0.7", "@capacitor/push-notifications": "^1.0.9",
"@capacitor/share": "^1.0.7", "@capacitor/share": "^1.0.7",
"@capacitor/storage": "^1.2.3", "@capacitor/storage": "^1.2.3",
"@fortawesome/angular-fontawesome": "^0.9.0", "@fortawesome/angular-fontawesome": "^0.9.0",
+1 -3
View File
@@ -280,7 +280,7 @@ export class RoomService {
if (this.hasLoadHistory) { return false } if (this.hasLoadHistory) { return false }
this.storage.get('chatmsg' + this.id).then((messages = [])=>{ this.storage.get('chatmsg' + this.id).then((messages = []) => {
let localMessages = [] let localMessages = []
@@ -296,7 +296,6 @@ export class RoomService {
this.WsChatService.loadHistory(this.id, limit).then((chatHistory:chatHistory) => { this.WsChatService.loadHistory(this.id, limit).then((chatHistory:chatHistory) => {
console.log('loadHistory', chatHistory) console.log('loadHistory', chatHistory)
let localMessages = [] let localMessages = []
chatHistory.result.messages.reverse().forEach(message => { chatHistory.result.messages.reverse().forEach(message => {
@@ -311,7 +310,6 @@ export class RoomService {
this.storage.set('chatmsg' + this.id, chatHistory.result.messages.reverse()) this.storage.set('chatmsg' + this.id, chatHistory.result.messages.reverse())
}) })
/* this.WsChatService.loadHistory(this.id, limit).then(async (chatHistory: chatHistory) => { /* this.WsChatService.loadHistory(this.id, limit).then(async (chatHistory: chatHistory) => {
@@ -119,13 +119,13 @@ export class WsChatMethodsService {
subscribeToRoomUpdate(id, roomData) { subscribeToRoomUpdate(id, roomData) {
this.WsChatService.streamRoomMessages(id).then((subscription)=>{ this.WsChatService.streamRoomMessages(id).then((subscription)=> {
console.log('streamRoomMessages', subscription) console.log('streamRoomMessages', subscription)
}) })
this.WsChatService.streamRoomMessages(id).then((subscription)=>{ this.WsChatService.streamRoomMessages(id).then((subscription) => {
console.log('streamRoomMessages', subscription) console.log('streamRoomMessages', subscription)
}) })
this.WsChatService.streamNotifyLogged().then((subscription=>{ this.WsChatService.streamNotifyLogged().then((subscription=> {
console.log('streamRoomMessages', subscription) console.log('streamRoomMessages', subscription)
})) }))
this.WsChatService.streamNotifyRoomDeleteMessage(id).then((subscription)=>{ this.WsChatService.streamNotifyRoomDeleteMessage(id).then((subscription)=>{
@@ -138,7 +138,7 @@ export class WsChatMethodsService {
} }
prepareRoom(roomData){ prepareRoom(roomData) {
let room:RoomService; let room:RoomService;
room = new RoomService(this.WsChatService, new MessageService(this.storage), this.storage, this.platform, this.sqlservice, this.NativeNotificationService) room = new RoomService(this.WsChatService, new MessageService(this.storage), this.storage, this.platform, this.sqlservice, this.NativeNotificationService)
+3 -3
View File
@@ -302,7 +302,7 @@ export class WsChatService {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
this.ws.registerCallback({type:'Onmessage', funx:(message)=>{ this.ws.registerCallback({type:'Onmessage', funx:(message)=>{
if(message.id == requestId || deepFind(message,'result.id') == requestId) { // same request send if(message.id == requestId || deepFind(message,'result.id') == requestId) { // same request send
resolve('') resolve(message)
return true return true
} }
}}) }})
@@ -331,7 +331,7 @@ export class WsChatService {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
this.ws.registerCallback({type:'Onmessage', funx:(message)=>{ this.ws.registerCallback({type:'Onmessage', funx:(message)=>{
if(message.id == requestId ) { // same request send if(message.id == requestId ) { // same request send
resolve('') resolve(message)
return true return true
} }
}}) }})
@@ -517,7 +517,7 @@ updateRoomEventss(roomId, collection:string, funx: Function, ) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
this.ws.registerCallback({type:'Onmessage', funx:(message)=>{ this.ws.registerCallback({type:'Onmessage', funx:(message)=>{
if(message.id == requestId || deepFind(message,'result.id') == requestId) { // same request send if(message.id == requestId || deepFind(message,'result.id') == requestId) { // same request send
resolve('') resolve(message)
return true return true
} }
}}) }})