A Dart package for both android and iOS which helps developers with Twilio API services. This Dart Package can be integrated into any Flutter application to make use of Twilio API.
- Send SMS programmatically
- Get all SMS related to a Twilio account
- Get more info on each SMS sent from a Twilio account
- Send WhatsApp messages programmatically
- Send Scheduled SMS
- Cancel Scheduled SMS
- Send Scheduled WhatsApp message
- Cancel Scheduled WhatsApp Message
Check out our comprehensive Example provided with this plugin.
To use this package :
- add the dependency to your pubspec.yaml file.
dependencies:
flutter:
sdk: flutter
twilio_flutter: ^0.3.0
Please find the following values from Twilio Console:
- accountSid
- Twilio Number
- Auth Token
- Messaging Service Sid (Optional, required for features like scheduled messages)
final TwilioFlutter twilioFlutter = TwilioFlutter(
accountSid : '', // replace with Account SID
authToken : '', // replace with Auth Token
twilioNumber:'', // replace with Twilio Number(With country code)
messagingServiceSid:'' // optional replace with messaging service sid, required for features like scheduled sms
);
Use sendSMS with the recipient number and message body.
await twilioFlutter.sendSMS(
toNumber : '',// replace with Mobile Number(With country code)
messageBody : 'hello world');
final data = await twilioFlutter.getSmsList({String pageSize}); //Returns list of SMS , pageSize defaults to 20
final data = await twilioFlutter.getSMS(String messageSID); //Use message sid from the individual messages.
twilioFlutter.changeTwilioNumber(''); // To change the twilio number(With country code)
await twilioFlutter.sendWhatsApp(toNumber : '',// replace with Mobile Number(With country code)
messageBody : 'hello world');
Scheduled messages can be sent if the sendAt
is at least 15 after the current time.
await twilioFlutter.sendScheduledSms(
toNumber : '',
messageBody : 'hello world',
sendAt:'2024-02-18T16:18:55Z'// Datetime has to be in the same format
);
Scheduled SMS can be cancelled using the messageSid.
await twilioFlutter.cancelScheduledSms(messageSID: '');
Scheduled messages can be sent if the sendAt
is at least 15 after the current time.
await twilioFlutter.sendScheduledWhatsAppMessage(
toNumber : '',
messageBody : 'hello world',
sendAt:'2024-02-18T16:18:55Z'// Datetime has to be in the same format
);
Scheduled whatsapp messages can be cancelled using the messageSid.
await twilioFlutter.cancelScheduledWhatsAppMessage(messageSID: '');
- Cancel Scheduled Messages
- Email Sending Support
- Update a Message resource
- Delete a Message resource
- Alphanumeric Sender IDs in Messaging Services
- More Support for Messaging Service
- Send message through Facebook Messenger
- Android
- iOS
- Web
- MacOs
- Windows
- Linux
Please file any issues, bugs or feature requests as an issue on our GitHub page.
If you would like to contribute to the plugin (e.g. by improving the documentation, solving a bug or adding a cool new feature), please carefully review our contribution guide and send us your pull request.
This Twilio Flutter plugin for Flutter is developed by Adarsh Balachandran.