WhatsappWebToGo icon indicating copy to clipboard operation
WhatsappWebToGo copied to clipboard

Possible to get notifications?

Open R2D221 opened this issue 6 years ago • 19 comments

Would it be possible to receive notifications while the app is in the background? I know the web app issues web notifications, so maybe it could be possible to intercept those.

R2D221 avatar Feb 17 '18 04:02 R2D221

Hi, using the web notifications api is not possible as the webview doesn't implement it. TSGames managed to get notifications from reading the ui, I'll merge it for a future update. The problem now is that you'll only get notified if WAWeb is running in backgroud. If it gets killed by your phone (there is no background task yet), you will not get notifications. Thats a blocker issue

92lleo avatar Feb 17 '18 17:02 92lleo

@92lleo maybe you could force the app into remaining in background? Perhaps have a thick box on whether to enable notifications or not and warn him that in order to see them the app has to run constantly and might drain the batter. Could be a temporary solution?

WPFilmmaker avatar Feb 21 '19 11:02 WPFilmmaker

I'm experimenting with a solution to keep the app starting in the background periodically and also send notifications in case of new messages. Notifications alone would not be reliable and the battery impact of keeping the app in background all the time would be to high

92lleo avatar Mar 05 '19 20:03 92lleo

I don't know if it can be useful but Frost (a facebook wrapper. https://github.com/AllanWang/Frost-for-Facebook) uses "Android's Job scheduler, and lets the framework decide when to run background services...therefore doesn't need to constantly run in the background nor does it force your pone to stay awake". Maybe you can use the same approach?

WPFilmmaker avatar Apr 19 '19 00:04 WPFilmmaker

hey, this would be a nice feature. Is there any progress? Checking for new messages every few hours would be great

ristein avatar Mar 06 '21 09:03 ristein

I have a couple of suggestions

  1. Adding an optional permanent notification, doesn't display messages, it may consume more battery but the user will be warned about this and it will be optional. The permanent notification will keep the application alive in the background, but it won't display any messages. This is a solution that Accubattery, Blokada, and Macrodroid uses to stay alive. Blokada is open source
  2. I notice that I can at least get sound notifications. If the app detects sound while it's not active, a notification can pop up that says "you may have some messages". Hopefully there is a way to differentiate sounds from this app from system sounds or sounds from other applications
  3. Temporary solution for users: Use the feature to lock the app on your task manager in order to prevent yourself from closing it. This is usually done by opening your task manager (pressing 3 line button) and hold press the app icon. It may be different on your device

JXWw3wLD9LArcR7c avatar May 28 '21 19:05 JXWw3wLD9LArcR7c

Hi Simon,

thanks for the input

  1. The permanent notification seems like the easiest idea compared to a service checking for new messages or something similar. I'll put this on top of my todo, together with the needed settings page
  2. Thats right, but there is already an easier way, see the poc fork from https://github.com/TSGames/WhatsappWebToGo/. I just need to adapt /include that

92lleo avatar May 29 '21 19:05 92lleo

awesome!

JXWw3wLD9LArcR7c avatar Jun 04 '21 23:06 JXWw3wLD9LArcR7c

Any updates regarding this?

ronz91 avatar Aug 04 '21 13:08 ronz91

I built an automater script that sends me an email on new messages from the android phone running whatsapp. I can share that in the evening if anyone is interested

ristein avatar Aug 04 '21 13:08 ristein

@ristein sorry I am new on Git, how do I private message you?

ronz91 avatar Aug 05 '21 10:08 ronz91

I forgot it yesterday. Will publish how I built that today

ristein avatar Aug 05 '21 10:08 ristein

@ristein are you doing this via reading the whatsapp-android notifications or grabbing notification from whatsapp web? The later would help here, the first one might still be interesting for others here :)

92lleo avatar Aug 05 '21 10:08 92lleo

I only grab the android notifications, which is not related to this app

ristein avatar Aug 05 '21 10:08 ristein

Hi Simon,

thanks for the input

  1. The permanent notification seems like the easiest idea compared to a service checking for new messages or something similar. I'll put this on top of my todo, together with the needed settings page
  2. Thats right, but there is already an easier way, see the poc fork from https://github.com/TSGames/WhatsappWebToGo/. I just need to adapt /include that

Could you elaborate on how #2 would be implemented/how it works? Noob programmer apologies in advance.

ronz91 avatar Aug 05 '21 11:08 ronz91

to get email notifications on new messages I used this app on the phone running whatsapp: https://play.google.com/store/apps/details?id=com.llamalab.automate and this script (importable via that app): Send mail on noti.flo.zip

add your email preferences in the email-block. get a dump-address for this, don't give them your main address's password

ristein avatar Aug 05 '21 16:08 ristein

The current release of WhatsApp (not beta) allows the user to login with WhatsApp Web without their phone being nearby. It's a beta feature you're prompted to enable but it's on the regular production app from the Play Store. (Screenshots below.)

Given this addition, setting up WhatsApp in a VM or a spare phone then using WWTG as a primary WhatsApp client on your main device is now very much doable and it's exactly what I am doing. It works well, the only missing piece is the notifications.

Even if only as a short-term solution, having a persistent silent notification that keeps the app running and checking for new messages seems like the standard way to do this. It is what Signal already does if you install it on a phone without Google Play Services.

Although if the method used on that Facebook wrapper to periodically check for notifications without running the background can work without a GSF dependency that'll certainly be better for battery.

Either way a notification feature would be great, currently it is the only thing missing that makes this a 100% viable alternative to having WhatsApp installed on your main device imo. Everything else works great.

IMAGE 2021-10-13 1:24:34 pm

IMAGE 2021-10-13 1:24:53 pm

ftpmorph avatar Oct 13 '21 12:10 ftpmorph

Yeah with Multi-device beta it is almost there.

I have been using the beta since it was released and it works well for the most part.

Been using it to access the account on my other phone from my main phone.

Hopefully between WWTG and Multi-device 2.0 there will be a complete solution soon.

ronz91 avatar Oct 13 '21 13:10 ronz91

@ftpmorph @ronz91 the settings page I wanted to configure all of that takes longer than expected. In the meantime I'll release a beta with persistent notification enabled by default, which hopefully helps in the meantime

92lleo avatar Oct 13 '21 14:10 92lleo