Delightful WhatsApp Automation with the flutter_whatsapp package
Published on by Flutter News Hub
Streamline customer engagement, drive sales, and amplify your business reach with the flutter_whatsapp package for Flutter apps. By seamlessly integrating with WhatsApp Business API, this package unlocks a world of possibilities for automated messaging and communication.
Getting Started
To harness the power of flutter_whatsapp, add it to your Flutter project's dependencies:
dependencies:
flutter_whatsapp: ^latest_version
Configure your app with the WhatsApp Business API credentials:
WhatsApp whatsapp = WhatsApp();
whatsapp.setup(
accessToken: "your_access_token",
fromNumberId: 10000000000000,
);
Automated Messaging at Your Fingertips
Short and Sweet: Generate Short Links
Create shareable WhatsApp links that automatically open a chat with a pre-filled message:
whatsapp.short(
to: 910000000000,
message: "Hey, check this out!",
compress: true,
);
Templated Messages: Send Predefined Templates
Send customized templates with dynamic values, making communication efficient:
whatsapp.messagesTemplate(
to: 910000000000,
templateName: "hello_world",
);
Personalized Text Messages: Engage with Customers
Send personalized text messages with optional URL previews:
whatsapp.messagesTemplate(
to: 910000000000,
message: "Hey, Flutter! Follow us on https://example.com",
previewUrl: true,
);
Media Sharing: Captivate with Images and Videos
Share images, videos, and other media to enhance engagement:
whatsapp.messagesMedia(
to: 910000000000,
mediaType: "image",
mediaId: "f043afd0-f0ae-4b9c-ab3d-696fb4c8cd68",
);
Location Sharing: Guide Customers to Your Doorstep
Send location details to guide customers to your business or share meeting points:
whatsapp.messagesLocation(
to: 910000000000,
longitude: "26.4866491",
latitude: "74.5288578",
name: "Pushkar",
address: "Rajasthan, India",
);
Media Sharing from URL: Embed Content with Ease
Share media from external URLs with optional captions:
whatsapp.messagesMediaByLink(
to: 910000000000,
mediaType: "video",
mediaLink: "https://example.com/flutter.mp4",
caption: "My Flutter Video",
);
Advanced Features for Enhanced Engagement
Reaction on Messages: Express Quickly
React to messages with emojis to provide instant feedback:
whatsapp.messagesReaction(
to: 910000000000,
messageId: "wamid.xxxxxxxxxxxxxxxxxx==",
emoji: "👍",
);
Reply on Messages: Continue the Conversation
Reply to specific messages with text or media, keeping conversations organized:
whatsapp.messagesReply(
to: 910000000000,
messageId: "wamid.xxxxxxxxxxxxxxxxxx==",
message: "Hey, Flutter!",
previewUrl: true,
);
Action Buttons: Guide Customer Choices
Create interactive messages with action buttons, allowing customers to choose their next steps:
whatsapp.messagesButton(
bodyText: "Do you love flutter",
buttons: [
{"id": "yes", "text": "👍 Yes"},
{"id": "no", "text": "✋ No"},
],
);
Business Management and Integration
Register a Phone Number: Connect with Customers
Register a phone number with WhatsApp to send and receive messages:
whatsapp.registerNumber(
pin: "123456",
);
Deregister a Phone Number: Unlink Accounts
Deregister a phone number to disconnect it from WhatsApp:
whatsapp.deregisterNumber(
pin: "123456",
);
Update Business Profile: Showcase Your Brand
Update your WhatsApp Business profile with key information:
whatsapp.updateProfile(
businessAbout: "A.I.",
businessWebsites: ["https://tonystark.com"],
businessAddress: "New York",
businessDescription: "You know who I am, the Ironman",
businessEmail: "tony@ironman.com",
businessIndustry: "A.I",
businessProfileId: "10203949568543",
);
Conclusion
The flutter_whatsapp package empowers you to seamlessly integrate WhatsApp Business API into your Flutter apps. Automate messaging, engage customers, and drive business growth with ease. Enhance your customer experience, streamline communication, and unlock new possibilities for your app.
Embrace the power of WhatsApp automation today and connect with your customers in a whole new way!