Page 1 of 1

Intent?

Posted: 15 Jul 2016 07:03
by pmgnt
Hello,
I found a tasker action/task on web that opens a certain whatsapp chat directly..
Intent is quite new to me so i was wondering if anyone is able to do the same using an AM action.

In tasker its a java script function which uses following data.

"#Intent;action=android.intent.action.MAIN;launchFlags=0x14000000;component=com.whatsapp/.Conversation;S.jid=4916308154711%40s.whatsapp.net;S.displayname=MaxMuster;end"

I tried Start Activity action but kept ending up somewhere in Main window of whatsapp :)

Any ideas?

Best regards & Thanks!

Re: Intent?

Posted: 15 Jul 2016 19:51
by Martin
Hi,

You can use action Start Activity with following configuration:
Action: android.intent.action.MAIN
Explicit Component: checked
Package Name: com.whatsapp
Class Name: com.whatsapp.Conversation
Extras:
putString("jid", "4916308154711@s.whatsapp.net");
putString("displayname", "MaxMuster");


The displayname-line is probably not required.

Alternatively you can also use action Launch Shortcut to open a Whatsapp conversation if you don't want to replace the phone number dynamically.

Regards,
Martin

Re: Intent?

Posted: 15 Jul 2016 22:26
by pmgnt
Thank you!

Well, so i was closer than expected as i can see..
My keys in both putString lines were wrong, also
did not replace %40 with @.

Couldnt use start shortcut action as phone number changes...

Thank you again!


Found another way while messing with it.

Action: android.intent.action.SENDTO
Daten URI: sms:4916308154711
Explicit Component: checked
Package Name: com.whatsapp

Regards!

Re: Intent?

Posted: 29 Oct 2020 20:37
by brunoaduarte
Problem with this approach is that if the number is invalid no error is shown.