Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rohit-chouhan/whatsapp
A package for whatsapp business api, send messages, product, media, location through flutter app.
https://github.com/rohit-chouhan/whatsapp
android dart facebook flutter ios whatsapp whatsapp-api whatsapp-automation whatsapp-bot
Last synced: 2 months ago
JSON representation
A package for whatsapp business api, send messages, product, media, location through flutter app.
- Host: GitHub
- URL: https://github.com/rohit-chouhan/whatsapp
- Owner: rohit-chouhan
- License: mit
- Created: 2022-06-07T12:13:37.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-15T19:20:45.000Z (6 months ago)
- Last Synced: 2024-12-15T02:34:49.558Z (2 months ago)
- Topics: android, dart, facebook, flutter, ios, whatsapp, whatsapp-api, whatsapp-automation, whatsapp-bot
- Language: Dart
- Homepage: https://pub.dev/packages/whatsapp
- Size: 349 KB
- Stars: 25
- Watchers: 2
- Forks: 19
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
This Flutter package allows you to integrate the WhatsApp Business API into your Flutter applications, enabling features such as sending `messages`, `media`, `templates`, `business information`, `interactives`, and more.
[](https://www.github.com/rohit-chouhan) _[](https://github.com/sponsors/rohit-chouhan)_
## Documentation
The full documentation for WhatsApp Package can be found on [whatsapp-flutter.github.io](https://whatsapp-flutter.github.io)
To switch the documentation version, use the version selector located at the top of the page, marked with `version:`.
**Note:** The documentation in the main branch is more up-to-date than the released documentation on the official docs website.
Other useful links:
- [Official WhatsApp Flutter website](https://whatsapp-flutter.github.io)
- [Initialization of WhatsApp Flutter](https://whatsapp-flutter.github.io/docs/initialization)
- [Return Methods](https://whatsapp-flutter.github.io/docs/return-methods) will help you determine your request.
- [Method Usage](https://whatsapp-flutter.github.io/docs/method-usage) contains important information to help you get started.Example:
```dart
const accessToken ='EAAGp6aTb8.....';
const fromNumberId = '1082772452xxxxx';final whatsapp = WhatsApp(accessToken, fromNumberId);
var res = await whatsapp.sendMessage(
phoneNumber : 'PHONE_NUMBER',
text : 'text_message',
previewUrl : true,
);if (res.isSuccess()) {
// when message sent
//Return id of message
debugPrint('Message ID: ${res.getMessageId()}');//Return number where message sent
debugPrint('Message sent to: ${res.getPhoneNumber()}');//Return exact API Response Body
debugPrint('API Response: ${res.getResponse().toString()}');
} else {
//when something went wrong
//Will return HTTP CODE
debugPrint('HTTP Code: ${res.getHttpCode()}');// Will return exact error from WhatsApp Cloud API
debugPrint('API Error: ${res.getErrorMessage()}');// Will return HTTP Request error
debugPrint('Request Error: ${res.getError()}');//Return exact API Response Body
debugPrint('API Response: ${res.getResponse().toString()}');
}
```# Contributors
[
](https://github.com/chouhan-rahul)Have you found a bug or have a suggestion of how to enhance WhatsApp Package? Open an issue or pull request and we will take a look at it as soon as possible.
# Report bugs or issues
You are welcome to open a _[ticket](https://github.com/rohit-chouhan/whatsapp/issues)_ on github if any problems arise. New ideas are always welcome.
# Copyright and License
> Copyright © 2022 **[Rohit Chouhan](https://rohitchouhan.com)**. Licensed under the _[MIT LICENSE](https://github.com/rohit-chouhan/whatsapp/blob/main/LICENSE)_.