How to send messages inside the whatsapp with flutter app, no open whatsApp
I'm building a app for one company of market. After select items and pay I want send message inside whatsApp for client speak "hey, yours items they were confirmed and 30minutes are in your house"
the contact made by the company and consumer only seems a message inside whatsApp. Is there a way to do this? WhatsApp API?
If you're looking for a simpler solution, you can indeed utilize the WhatsApp URI scheme to initiate a message directly from your Flutter app. This method doesn't require a backend server or integration with the WhatsApp Business API. Here's how you can do it:
The Simple Way:prefill message thru whatsapp url scheme
here https://stackoverflow.com/a/63312542/17773389
This approach is simple and straightforward, but it requires the user to manually send the message from the WhatsApp application.
However, if you need more control and automation, especially for business purposes, you should consider the hard way, which involves setting up a backend server to interact with the WhatsApp Business API.
The Hard Way:Set Up a Backend Server: Create a backend server using a programming language or framework of your choice (e.g., Node.js, Python, Java). This server will handle requests from your Flutter app and interact with the WhatsApp Business API.
Implement API Endpoints: Define API endpoints on your backend server to receive requests for sending WhatsApp messages. These endpoints should accept parameters such as the recipient's phone number and the message content.
Integrate WhatsApp Business API: Use the official WhatsApp Business API to send messages programmatically. You'll need to authenticate your server and obtain the necessary credentials to access the API.
While the hard way involves more complexity and setup, it provides greater control and automation, making it suitable for business applications and scenarios where manual intervention is not feasible.
The Bot/Scraping Way nodejs dart/flutterits free, but its a violation of their terms of service and its not only unethical but also illegal.