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

outdated

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 'package:whatsapp/whatsapp.dart';
Whatsapp whatsapp = Whatsapp();

Configure access_token and Phone ID

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

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", //template name
	compress: true
);

💬 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"
);
192
likes
0
points
772
downloads

Publisher

verified publisherrohitchouhan.com

Weekly Downloads

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