Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WhatsApp Notification #28

Closed
sfnemis opened this issue Nov 20, 2022 · 5 comments
Closed

WhatsApp Notification #28

sfnemis opened this issue Nov 20, 2022 · 5 comments
Labels
waha:CORE Relates to WAHA Core version

Comments

@sfnemis
Copy link

sfnemis commented Nov 20, 2022

Hi,

I am using VENOM core and i just remark when i scan qr, my phone whatsapp notifications becoming silent ?

Thank you

@allburov
Copy link
Contributor

Weird, may be whatsapp send notification only to one device? Like Slack does
Or venom mark the message as seen automatically. I'll check and look at this

@allburov allburov added the waha:CORE Relates to WAHA Core version label Nov 21, 2022
@dv336699
Copy link

dv336699 commented Jul 7, 2023

@allburov I'm having the same behaviour with NOWEB. It seems that the engine is sending "read messages" when receiving a message.

https://github.com/WhiskeySockets/Baileys#reading-messages

On another library, as soon as they received a message, the library was sending the read command to mark the message as seen which was causing the notifications to not come through on phones with the API.

@dv336699
Copy link

@allburov sorry to bother you, but is there any chance this can be looked at, please?
thanks

@allburov
Copy link
Contributor

allburov commented Jul 12, 2023

In the multi-device version of WhatsApp - if a desktop client is active, WhatsApp doesn't send push notifications to the device. If you would like to receive said notifications - you need to mark a session's presence as "unavailable".
I'm planning to add POST /api/<session>/presence endpoint for that and test how it works.

@allburov
Copy link
Contributor

Hi! There's a new endpoint in the latest WAHA Plus version 2023.7.12, we'll add it in the next release in WAHA Core.

To turn on push notifications you need to send POST /api/<session>/presence request with the payload

{
  "presence": "offline"
}

Keep in mind that push notification is not compatible with "being always online" #121


Presence

Possible presence statuses that you can set or get for chats:

  • online
  • offline
  • typing
  • recording
  • paused resets the chat presence after you were typing

Endpoints

Set presence

You can set your global or chat-related presence with POST /api/{session}/presence endpoint

Start typing to a chat (you can use POST /startTyping instead)

{
  "chatId": "111111111@c.us",
  "presence": "typing"
}

Clear "typing" state (you can use POST /stopTyping instead)

{
  "chatId": "111111111@c.us",
  "presence": "paused"
}

Set global "online", all contacts will see it

{
  "presence": "online"
}

💡 In the multi-device version of WhatsApp - if a desktop client is active, WhatsApp doesn't send push notifications
to the device.
If you would like to receive said notifications - you need to mark a session's presence as offline.

{
  "presence": "offline"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waha:CORE Relates to WAHA Core version
Projects
None yet
Development

No branches or pull requests

3 participants