Page 1 of 1

Replace not working

Posted: 29 Dec 2014 06:00
by conradcliff
Hey there, first post in the forum, looks like a great community.

I've created a simple flow that reads the big text of a notification if your headset is plugged in.

http://automagic4android.com/flow.php?i ... 484b622236

The problem is that the apps I'm using(whatsapp mostly) just updates a single notification when new messages come through and so all the old messages get read over and over again. That's the main problem.

I thought I could solve that problem by using a replace script as seen in my flow, but it doesn't work.

The next problem is that as notifications keep coming in, not only will it read all of the old ones, but it will read the entire group multiple times...no idea why.

Any help would be awesome !

Re: Replace not working

Posted: 29 Dec 2014 09:33
by MURTUMA
I have made similar flow, but instead of reading it shows notifications in a text box. I have noticed that WhatsApp continues to push the notifications through, if you don't read them. I thought it was a problem of my phone, but it seems to come from WhatsApp.

You might be able to circumvent your problem by storing already read notifications in a variable and checking the similarities before reading them again. Of course, if they're similar, choose not to read them again.

Re: Replace not working

Posted: 29 Dec 2014 09:54
by conradcliff
Haha, that's exactly what I'm trying to do.
If you look at the flow, it stores the old notification in the variable "old_notification" and the next time it rolls around I use the replace script to remove anything that matches the old notification...but unfortunately, as the topic's subject states...replace not working

Re: Replace not working

Posted: 29 Dec 2014 18:59
by Martin
I think it might be quite complicated to achieve what you want depending on the app that posts the notification.
You could use a condition Debug Dialog as a first action in the flow and check if the app posts a more suitable text in variable notification_ticker_text. Maybe you are lucky and the app only posts the new text when a new message arrives.

Re: Replace not working

Posted: 29 Dec 2014 21:12
by andy
Hi, its right. Everytime you receive a message WhatsApp generates a complete overview of all non read messages. I already replace WhatsApp's native notification by catch each notification, storing text in string variable, remove original notification from status bar. By this way I avoid mentioned message overview. Additionally I light up LED by custom notification on status bar.

Re: Replace not working

Posted: 03 Jan 2015 07:51
by conradcliff
Martin and Andy, thanks for the replys!

Andy, do you think you could post your solution here in this thread?
I would love to see/use it if possible!

Re: Replace not working

Posted: 03 Jan 2015 08:47
by andy
Hi conradcliff,

During last days with more message exchange I noticed that behavior of WhatsApp is different. Nevertheless I will make public my flow as soon as I modify my flow a little bit. Maybe it will a good base to discuss and make it perfect hehe

Regards

Andy

Re: Replace not working

Posted: 03 Jan 2015 09:17
by andy
Hi,

I will post the flows in Share Area of this forum

Enjoy

Andy

PS: if there are some advises, improvements etc please tell me

Re: Replace not working

Posted: 03 Jan 2015 09:33
by conradcliff
Andy, that sounds great!
I look forward to checking it out ;)

Re: Replace not working

Posted: 03 Jan 2015 09:36
by andy
Conradcliff,

You can find my preliminary (hehe) version in sharing area right now