whatsapp 1.0.6 copy "whatsapp: ^1.0.6" to clipboard
whatsapp: ^1.0.6 copied to clipboard

A top package for whatsapp business api, send messages, product, media, location through flutter app.

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
);

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 ❤️

172
likes
0
pub points
90%
popularity

Publisher

verified publisherrohitchouhan.com

A top package for whatsapp business api, send messages, product, media, location through flutter app.

Homepage
Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, http

More

Packages that depend on whatsapp