WhatsApp API package for flutter, to send message and product information.

Last update: Jun 17, 2022

WhatsApp API package for flutter, to send message and product information.

Platform Support

Android iOS MacOS Web Linux Windows
✔️ ✔️ ✔️ ✔️ ✔️ ✔️

WhatsApp Business Configuration

You must have WhatsApp apps in facebook developer, to use this package, please follow this link for Guidence.

Installation

import 'package:whatsapp/whatsapp.dart';
Whatsapp whatsapp = Whatsapp();

Configure accessToken and Phone ID

whatsapp.setup(
	accessToken: "your_access_token_here",
	fromNumberId: 10000000000000 //integer
);

💬 short Direct chat link

this method used to generate direct chat link

parameter:-

  • to - number of client
  • message - message
  • compress - true / false for compress link

sample code:-

whatsapp.short(
	to: 910000000000, // number with country code (without +),
	message: "Hey",
	compress: true
);

//return : https://wa.me/910000000000?text=Hy

💬 messagesTemplate Send a template message

this method used to send a template message to client's whatsapp

parameter:-

  • to - number of client
  • templateName - name of a template

sample code:-

whatsapp.messagesTemplate(
	to: 910000000000, // number with country code (without +),
	templateName: "hello_world" //template name
);

💬 messagesText Send a text message

this method used to send a text message to client's whatsapp

parameter:-

  • to - number of client
  • message - message your want to send
  • previewUrl - true and false for preview url in message

sample code:-

whatsapp.messagesTemplate(
	to: 910000000000, // number with country code (without +),
	message: "Hey, Flutter, follow me on https://example.com", //message
	previewUrl: true
);

💬 messagesMedia Send a media message

this method used to send a media message to client's whatsapp

parameter:-

  • to - number of client
  • mediaType - type of media ex. image
  • mediaId - uploaded media id on whatsapp business

sample code:-

whatsapp.messagesMedia(
	to: 910000000000, // number with country code (without +),
	mediaType: "image",
	mediaId: "f043afd0-f0ae-4b9c-ab3d-696fb4c8cd68"
);

💬 messagesLocation Send a location message

this method used to send a location message to client's whatsapp

parameter:-

  • to - number of client
  • longitude -longitude string
  • latitude - latitude string
  • name - name of location
  • address - full address of location

sample code:-

whatsapp.messagesLocation(
	to: 910000000000, // number with country code (without +),
	longitude: "26.4866491",
	latitude: "74.5288578",
	name: "Pushkar",
	address: "Rajasthan, India"
);

Feel free to contribute ❤️

GitHub

https://github.com/rohit-chouhan/whatsapp
You might also like...

Call OpenGL ES Api By Dart

Call OpenGL ES Api By Dart

Flutter GL Flutter GL can call OpenGL ES API with Dart Support iOS,Android,Web OpenGL ES API Now the api is similar to WebGL How to use Now this is on

Jun 27, 2022

This library contains methods that make it easy to consume Mpesa Api.

This library contains methods that make it easy to consume Mpesa Api. It's multi-platform, and supports CLI, server, mobile, desktop, and the browser.

Dec 15, 2021

A CLI tool to help generate dart classes from json returned from API

Json 2 Dart Command line utility Important note There is already a package called json2dart so this package will be called json2dartc ! This project w

May 23, 2022

Volt is a wrapper over the Revolt API for easily writing bots using the Dart language.

Volt is a wrapper over the Revolt API for easily writing bots using the Dart language. It is currently in active development so not all of the functionality has yet been implemented.

Jan 8, 2022

This is a dart library covering nearly 100% of the latest Planning Center public API.

Planning Center API for Dart Planning Center is an online platform for church management. It provides multiple apps for things like check-ins, service

Mar 17, 2022

🔍 👀 CLI utility to check last-visit of your CodeForces friends & much more, 🚀 powered by CodeForces API

JoJo 🔍 👀 CLI utility to check last-visit of your CodeForces friends & much more, 🚀 powered by CodeForces API Features Online Friends All Friends Pr

Jul 20, 2020

Cache json map to local file with Dart:io. Read file with sync api.

local_cache_sync 一个非常简单易用的Flutter本地储存库,适用于在本地储存一列轻量数据(例如用户保存在本地的设备信息,或者缓存一系列用户信息)。 local_cache_sync的所有方法都是同步,而不是异步的。这意味着你不需要使用await就可以获取数据。在flutter中,这

Jun 24, 2022

🏂 A self-hostable rest api server for Tenka

🏂 A self-hostable rest api server for Tenka

Fuyu 🏂 A self-hostable rest api server for Tenka. By using this project, you agree to the usage policy. Installation Pre-built binaries are released

Mar 14, 2022

Fetch Data From fakestoreapi.com Api Using Dio

Fetch Data From fakestoreapi.com Api Using Dio

A powerful Http client for Dart, which supports Interceptors, Global configuration, FormData, Request Cancellation, File downloading, Timeout etc

Jun 7, 2022

Related

A simple flexible API wrapper for coinbase commerce API. Totally unofficial.

coinbase_commerce A dart library that connects to interact with the Coinbase Commerce API. Enables projects to connect seamlessly to coinbase and rece

Oct 17, 2021
This package binds to Cronet's native API to expose them in Dart.

Experimental Cronet Dart bindings This package binds to Cronet's native API to expose them in Dart. This is an HTTP Client Package with almost the sam

Jun 24, 2022
A package that lets you include a cool, nice looking and validated Password TextFormField in your app to enhance user experience. The package is fully & easily modifiable.
A package that lets you include a cool, nice looking and validated Password TextFormField in your app to enhance user experience. The package is fully & easily modifiable.

A package that lets you include a cool, nice looking and validated Password TextFormField in your app to enhance user experience. The package is fully

Jun 7, 2022
Apr 17, 2022
A Dart package which supports checking if a current package is up-to-date.

pub_updater A Dart package which enables checking whether packages are up to date and supports updating them. Intended for use in CLIs for prompting u

Jun 19, 2022
Converts SVG icons to OTF font and generates Flutter-compatible class. Provides an API and a CLI tool.

Fontify The Fontify package provides an easy way to convert SVG icons to OpenType font and generate Flutter-compatible class that contains identifiers

May 1, 2022
An encapsulation made around openrouteservice API for Dart and Flutter projects.
An encapsulation made around openrouteservice API for Dart and Flutter projects.

An encapsulation made around openrouteservice API for Dart and Flutter projects. Made for easy generation of Routes and Directions on Maps, Isochrones, Time-Distance Matrix, Pelias Geocoding, POIs, Elevation and routing Optimizations using their amazing API.

May 16, 2022
A Flutter library to make Rest API clients more easily. Inspired by Java Feing.

A Flutter library to make Rest API clients more easily. Inspired by Java Feing. Features Facilitated JSON encode and decode using common interfaces. F

Mar 15, 2022
JSON API parser for Flutter
JSON API parser for Flutter

Flutter Japx - JSON:API Decoder/Encoder Lightweight [JSON:API][1] parser that flattens complex [JSON:API][1] structure and turns it into simple JSON a

May 4, 2022
Provides API to generate Dart source code

DartWriter DartWriter provides API to generate Dart source code. It can make your job easier while developing flutter/dart tools. You can also generat

May 7, 2022