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

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

WhatsApp Business Configuration #

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

Installation #

import ''
Whatsapp whatsapp = new Whatsapp();

Configure access_token and Phone ID

whatsapp.setup(
	access_token: "your_access_token_here",
	phone_numner: "your_business_number_id"
);

💬 messagesTemplate Send a template message

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

parameter:-

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

sample code:-

whatsapp.messagesTemplate(
	to: "910000000000", // number with country code (without +),
	template_name: "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
  • preview_url - 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
	preview_url: true
);

💬 messagesMedia Send a media message

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

parameter:-

  • to - number of client
  • media_type - type of media ex. image
  • media_id - uploaded media id on whatsapp business sample code:-
whatsapp.messagesMedia(
	to: "910000000000", // number with country code (without +),
	media_type: "image",
	media_id: "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.messagesMedia(
	to: "910000000000", // number with country code (without +),
	longitude: "26.4866491",
	latitude: "74.5288578",
	name: "Pushkar",
	address: "Rajasthan, India"
);
172
likes
0
pub points
90%
popularity

Publisher

verified publisherrohitchouhan.com

A 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