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

A Flutter package for sending SMS messages using the 4jawaly API. Supports sending messages, checking balance, and managing sender names.

SMS 4Jawaly Flutter Package #

A Flutter package for sending SMS messages using the 4jawaly API. This package provides a simple way to interact with the 4jawaly SMS service, allowing you to send messages, check balance, and manage sender names.

Features #

  • Send SMS messages
  • Check account balance
  • Get sender names
  • Support for multiple recipients
  • Error handling
  • Clean and simple API

Installation #

Add this to your package's pubspec.yaml file:

dependencies:
  sms_4jawaly: ^1.0.0

Usage #

Initialize the Gateway #

final gateway = Gateway(
  apiKey: 'YOUR_API_KEY',
  apiSecret: 'YOUR_API_SECRET',
);

Get Account Balance #

final balance = await gateway.getBalance();
if (balance['success']) {
  print('Balance: ${balance['data']}');
} else {
  print('Error: ${balance['error']}');
}

Get Sender Names #

final senders = await gateway.getSenders();
if (senders['success']) {
  print('All senders: ${senders['all_senders']}');
  print('Default senders: ${senders['default_senders']}');
} else {
  print('Error: ${senders['error']}');
}

Send SMS #

final result = await gateway.sendSms(
  message: 'Hello from Flutter!',
  numbers: ['966500000000', '966500000001'],
  sender: 'SENDER_NAME',
);

if (result['success']) {
  print('Successfully sent to ${result['total_success']} numbers');
  print('Job IDs: ${result['job_ids']}');
} else {
  print('Failed: ${result['errors']}');
}

Dispose #

Don't forget to dispose of the gateway when you're done:

gateway.dispose();

Example #

Check the example folder for a complete Flutter application demonstrating how to use this package.

License #

This project is licensed under the MIT License - see the LICENSE file for details.

1
likes
150
points
16
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter package for sending SMS messages using the 4jawaly API. Supports sending messages, checking balance, and managing sender names.

Documentation

API reference

License

MIT (license)

Dependencies

flutter, http

More

Packages that depend on sms_4jawaly