WhiskeySockets / Baileys

Lightweight full-featured typescript/javascript WhatsApp Web API
https://baileys.whiskeysockets.io/
MIT License
3.87k stars 1.33k forks source link

No new message notification on phone if message received in Baileys #299

Closed abdulloh10 closed 5 months ago

abdulloh10 commented 1 year ago

Hello For some reason, the notification of the received message does not appear on the phone if the message is also received in Baileys. How can I get notifications for new messages on my phone?

zennn08 commented 1 year ago

You can set markOnlineOnConnect to false in your configuration

const sock = makeWASocket({
  ...config,
  markOnlineOnConnect: false
})
abdulloh10 commented 1 year ago

You can set markOnlineOnConnect to false in your configuration

const sock = makeWASocket({
  ...config,
  markOnlineOnConnect: false
})

Thank You

salomonamiga commented 1 year ago

hi

im using https://github.com/code-chat-br/whatsapp-api with uses code as an implementation of Baileys, but im having the same issue, and can't find anywhere how to solve it, I tried to ask on that git repo but have no answer I tried to implement markOnlineOnConnect: false on the socketConfig but is not working for me maybe here someone can help me on this ? I need the notifications ! Thank you !

abdulloh10 commented 1 year ago

hi

im using https://github.com/code-chat-br/whatsapp-api with uses code as an implementation of Baileys, but im having the same issue, and can't find anywhere how to solve it, I tried to ask on that git repo but have no answer I tried to implement markOnlineOnConnect: false on the socketConfig but is not working for me maybe here someone can help me on this ? I need the notifications ! Thank you !

const sock = makeWASocket({ ...config, markOnlineOnConnect: false }) does not completely solve the problem. After scanning to add a new device, there is no notification. After restarting the node, a notification then appears. So restart the node every time you add a new device

salomonamiga commented 1 year ago

hi im using https://github.com/code-chat-br/whatsapp-api with uses code as an implementation of Baileys, but im having the same issue, and can't find anywhere how to solve it, I tried to ask on that git repo but have no answer I tried to implement markOnlineOnConnect: false on the socketConfig but is not working for me maybe here someone can help me on this ? I need the notifications ! Thank you !

const sock = makeWASocket({ ...config, markOnlineOnConnect: false }) does not completely solve the problem. After scanning to add a new device, there is no notification. After restarting the node, a notification then appears.

sorry I didnt understand 100% this "After restarting the node, a notification then appears." you mean you get WhatsApp notifications ?

is there any solution to my problem or anyhow the markOnlineOnConnect: false works ?

abdulloh10 commented 1 year ago

hi im using https://github.com/code-chat-br/whatsapp-api with uses code as an implementation of Baileys, but im having the same issue, and can't find anywhere how to solve it, I tried to ask on that git repo but have no answer I tried to implement markOnlineOnConnect: false on the socketConfig but is not working for me maybe here someone can help me on this ? I need the notifications ! Thank you !

const sock = makeWASocket({ ...config, markOnlineOnConnect: false }) does not completely solve the problem. After scanning to add a new device, there is no notification. After restarting the node, a notification then appears.

sorry I didnt understand 100% this "After restarting the node, a notification then appears." you mean you get WhatsApp notifications ?

is there any solution to my problem or anyhow the markOnlineOnConnect: false works ?

Yes, after applied markOnlineOnConnect: false and pm2 restart whatsapp a notification in mobile phone appears. But later the notification may disappear again. The solution is to pm2 restart again

salomonamiga commented 1 year ago

hi im using https://github.com/code-chat-br/whatsapp-api with uses code as an implementation of Baileys, but im having the same issue, and can't find anywhere how to solve it, I tried to ask on that git repo but have no answer I tried to implement markOnlineOnConnect: false on the socketConfig but is not working for me maybe here someone can help me on this ? I need the notifications ! Thank you !

const sock = makeWASocket({ ...config, markOnlineOnConnect: false }) does not completely solve the problem. After scanning to add a new device, there is no notification. After restarting the node, a notification then appears.

sorry I didnt understand 100% this "After restarting the node, a notification then appears." you mean you get WhatsApp notifications ? is there any solution to my problem or anyhow the markOnlineOnConnect: false works ?

Yes, after applied markOnlineOnConnect: false and pm2 restart whatsapp a notification in mobile phone appears. But later the notification may disappear again. The solution is to pm2 restart again

thank you for the clarification, is so sad there is no way to fix this, I have seen other APIs can do, but this API has much more features, this is the only one I wish there is a fix anytime soon

azudindaem commented 1 year ago

This dirty trick might help

if(events['messages.upsert']) {
   client.sendPresenceUpdate('unavailable')
kyraex commented 12 months ago

This dirty trick might help

if(events['messages.upsert']) {
   client.sendPresenceUpdate('unavailable')

If there are high number of incoming messages, will it cause any issue due to spamming of presence update?

diorgenesgrzesiuk commented 10 months ago

Any progress on this problem?

By making the suggestions above, the alerts on the cell phone temporarily work again... then the problem continues...

PurpShell commented 5 months ago

This dirty trick might help

if(events['messages.upsert']) {
   client.sendPresenceUpdate('unavailable')

If there are high number of incoming messages, will it cause any issue due to spamming of presence update?

Yes it will spam, this is not a proper way of doing things. This person should've set a debounce on it

PurpShell commented 5 months ago

For everyone confused here: client.sendPresenceUpdate('unavailable')

Readme reference: https://github.com/WhiskeySockets/Baileys?tab=readme-ov-file#update-presence