Replace not working

Post your questions and help other users.

Moderator: Martin

Post Reply
conradcliff
Posts: 6
Joined: 29 Dec 2014 05:28

Replace not working

Post by conradcliff » 29 Dec 2014 06:00

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 !

User avatar
MURTUMA
Posts: 697
Joined: 05 Mar 2013 22:43

Re: Replace not working

Post by MURTUMA » 29 Dec 2014 09:33

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.

conradcliff
Posts: 6
Joined: 29 Dec 2014 05:28

Re: Replace not working

Post by conradcliff » 29 Dec 2014 09:54

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

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Replace not working

Post by Martin » 29 Dec 2014 18:59

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.

andy
Posts: 40
Joined: 29 Dec 2014 21:00

Re: Replace not working

Post by andy » 29 Dec 2014 21:12

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.

conradcliff
Posts: 6
Joined: 29 Dec 2014 05:28

Re: Replace not working

Post by conradcliff » 03 Jan 2015 07:51

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!

andy
Posts: 40
Joined: 29 Dec 2014 21:00

Re: Replace not working

Post by andy » 03 Jan 2015 08:47

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

andy
Posts: 40
Joined: 29 Dec 2014 21:00

Re: Replace not working

Post by andy » 03 Jan 2015 09:17

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

conradcliff
Posts: 6
Joined: 29 Dec 2014 05:28

Re: Replace not working

Post by conradcliff » 03 Jan 2015 09:33

Andy, that sounds great!
I look forward to checking it out ;)

andy
Posts: 40
Joined: 29 Dec 2014 21:00

Re: Replace not working

Post by andy » 03 Jan 2015 09:36

Conradcliff,

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

Post Reply