How can I add a Whatsapp function to my website? - web

I have very little reputation points so I cannod add a comment in this similar question.
But I need an explanation as the code is working in a different way as expected.
I would like to have a link on my website where the user can click on the whatsapp link and start the conversation with the contact.
The code I add is this:
href="intent://send/0123456789#Intent;scheme=smsto;package=com.whatsapp;action=android.intent.action.SENDTO;end
where 0123456789 were substituted with a real number subscribed to whatsapp.
But it seems working only with my contact. If I have a new number it will not work and will tell me that the contact number is not connected to whatsapp (even if it is).
How can I solve this problem?
Once this first problem is solved, I'd like to add some preformatted text to the message like: message sent from website xyz. What code should I add?
This like of code is working for Android, I need it also for iPhone, what should I use?
This other code is working on Android and on iPhone, but it doesn't allow me to add a custom contact number:
whatsapp
abid can be only an ID from a contact already saved in you phone, otherwise it will open the contact selection page in whatsapp
Please, don't share links without explanation of the content as I'm not a developer, I'm just trying to do my best following instructions of people with more knowledge.
Thank you.

As long as your explanation describes you are looking for a user to be able to Click in order to open a Chat with a specific Whatsapp active user.
Nowadays Whatsapp has emitted an API to specifically solve this needs, it's called 'Click to Chat' API and must work on all devices:
https://faq.whatsapp.com/en/general/26000030
Also, the scheme for the link you were using seems to be working correctly nowadays when used like this:
whatsapp://send?text=MESSAGE&phone=+NUMBER&abid=+NUMBER

Related

Gmail - Link to Draft in non-conversation view

I am importing/creating drafts in Gmail using the Gmail API. After creation I'd like to redirect the user to the Gmail UI with the opened Draft in the composer window.
I made it work properly for https://mail.google.com/mail/#drafts?compose=[MESSAGE ID]. Other urls I found here also worked well. Gmail is doing some redirects and eventually the composer window is opened with the draft.
Now my issue:
If the user has not enabled "Conversation view" this will not work at all. The redirect will then result in https://mail.google.com/mail/u/0/#drafts?compose=new and only an empty, new composer window is shown and a new draft is created by the UI.
If I open the draft directly the ID-format is different. https://mail.google.com/mail/u/0/#drafts?compose=hJzgZpSqgLQcCWgZqnlNRzRBfMbjZVnZklzvcFxhQCdwT... and I have no idea if this format can be generated somehow.
Does anybody has an idea or experience to also make it work with this UI setting. How I can force Gmail to load the draft into the composer window?
Thanks in advance.
If you have Email Threading > Conversation View enabled
Make use of the following URL
https://mail.google.com/mail/u/0/#inbox?compose=DRAFT_MESSAGE_ID
If you have disabled the Email Threading > Conversation View option
Make use of the following URL
https://mail.google.com/mail/u/0/#inbox/DRAFT_MESSAGE_ID
Additional information
The main difference between them is that the first is treated as a conversation while the second example is not.
You can use #drafts instead of #inbox in the URL.
The number after .../mail/u/ is the session you have opened
You can retrieve the DRAFT_MESSAGE_ID by making a request to the API
You can approximately generate the compose ID by yourself, there are some examples out there (not recommended). I strongly recommend you to use the DRAFT_MESSAGE_ID instead.
This appears to still be an issue the one solution I did find was that you can find your draft directly (even though it would be the last draft) and go through multiple accounts by redirecting to
https://accounts.google.com/AccountChooser?authuser={user account}&Email={email account}&continue=https://mail.google.com/mail/#search/rfc822msgid:CAMU-31NcJCVHyGNsAycRKfuS0nMonoaZ6wFMD90Sej996qjuPQ#mail.gmail.com
You need to get your message id toi replace the area from <> from your draft. So you'll have to create the draft first. Get the google message ID, then use that with messages/get to get the Global Message Id (also referred to as message id) and then use that with a search. At this point you'll open a page with a search to a single draft but it will not be opened. Your users will have to click on the one message. Unfortunately there does not seem to be a way to have the good way work for conversation view, and this way work for non.
I tried many different URLS and nothing worked. As noted in the original question, it might work that you could link to the full URL but I see no way to get that. If you spend long enough working with an email you'll even find that ID changes so they aren't even stable within a single day.
Another solution that could work is as explained:
https://mail.google.com/mail/u/0/#inbox/DRAFT_MESSAGE_ID
But as noted this does not open the draft on the first time you go there. It seems you have to travel to that link 2 times in a row to get the message to appear. I guess you could go to the page maybe inject some javascript to go to the page again but I don't know how to do that.

URL to open a CashApp payment?

I'm building an app where I want users to be able click a link to open up CashApp (as well as various other P2P payment apps), as far along in the transaction as possible. My client doesn't want the app to actually handle the payments, just for it to forward along to a place to make the payment.
So, for example, I can go to venmo.com/username to open the Venmo app to a certain user's profile, which is basically enough for me. (anyone know how to include an amount or message in the url?)
But cash.app/username goes to a webpage that directs me to the App Store get the app, and doesn't even open the app on my phone if it's already downloaded.
Anyone know how to do this?
This is actually quite simple with a universal link:
https://cash.app/$username/amount
The following example will open a cash app payment of $12.50 for the user with username 'helloworld':
https://cash.app/$helloworld/12.50
To pass info to Venmo app you can use:
venmo://paycharge?txn=pay&recipients=someone&amount=9.99&note=For%20Things
This is the url format for Venmo deeplinking:
https://venmo.com/<USER_NAME_1>,<USER_NAME_2>...?txn=<charge|pay>&note=<NOTE>&amount=<AMOUNT>
You can read more about the url format for Venmo Deeplinking here.
##"This is actually quite simple with a universal link:
https://cash.app/$username/amount
The following example will open a cash app payment of $12.50 for the user with username 'helloworld':
https://cash.app/$helloworld/12.50"##
I also used the same format but instead of app I used me:
https://cash.me/$username/5.00/
And when i click on the button with the as anchored:
"href="https://cash.me/$username/5.00/">"
The phone with the APP opens the payment of $5.00 with the username and the person just needs to hit send.
At this time, the ability to integrate with Cash app or accept or send Square Cash payments aren't currently available for Square’s API.

How do I check if a mobile number is on WhatsApp or not with programming?

I wanted to build a web-based system using which you will come to know whether the mobile number is registered with WhatsApp or not? It's just to check whether the number entered in textbox have WhatsApp account or not?
I tried finding resources regarding the same but unable to get any solution on it, please share some link for reference so, I can implement it and get to the final result.
You can use the Whatsapp API through Wassenger of Waboxap to send a text message and via webhook service like Loggly determine if the message was delivered. The person will however get a message, which might cause them to block you.

Detect which url button was clicked facebook messenger

I'm developing an chatbot to facebook, but right now, i'm facing a problem.
The issue is, i want to give to the users the option to select a link and after the user opens it, i want him to give me a feedback about if this was helpfull.
Something like,
me: I've searched and i've found this.
http://facebook.com/1 | http://facebook.com/2
User: Clicks on the first link. And i'm notified about that.
me: Have you found what you were searching for?
Yes | No
So, after this i know that the user have clicked on the first link, and the feedback was positive.
Or at least this is what i want to know..
That may sound confusing.
There isn't a direct way to do this. You could append url params to the link and then parse them when the request is received by your webserver.

Branch.io: Extract custom value from link

we're facing a problem right now: We're using the SMS gateway feature from branch.io which simply does not work properly worldwide (e.g. Lituanian cell phones won't receive any messages at all).
Therefore i need a fallback method for people that cannot receive an SMS to their phone with the downloadlink in the Appstore. (The branch.io Links have an effect on the branding of our app)
The fallback is to let them use a voucher code which COULD be generated from a custom value that we store for each Link
This is an ordinary Link with its 2 custom values
The landing page http://learnmat.ch/spark7 opens in the browser and i'd like to be able to identify the SponsorID on the website so that i can return a voucher code that is suitable for the specific SponsorID of the Link.
Right now i've already integrated the Web SDK into the website.
Is that "reverse engineering of the SponsorID" possible based on the Link and the WebSDK integration?
I'd really appreciate your help!
Thank you,
Sven
Jackie from Branch here.
Our SMS page service supports international numbers but only if the number the SMS has to be delivered is in the same country the SMS is being sent from. Could you please make sure the sender is physically located in Lithuania? I'd also suggest creating your own Twilio integration if you want to bypass these restrictions we have on our system https://docs.branch.io/pages/web/text-me-the-app/#use-your-own-sms-service
Regarding your fallback method: you want to have users click on a Branch link that will open your website and based on the link data (sponsor ID), you want to provide them with unique voucher codes? If my assumption is correct, you can achieve this by custom event tracking and user identity tracking. (relevant docs: https://docs.branch.io/pages/dashboard/analytics/#user-value-attribution)
Hopefully, this helps. Let us know if you have additional questions about the info above, or about anything else related to integrating Branch.
Best,
Jackie Choi

Resources