Jusibe SMS library for Dart. Based on the Official API Documentation provided by Jusibe.
Add jusibe as a dependency in your pubspec.yaml
file.
jusibe: ^0.1.2
Import the library in your dart file.
import 'package:jusibe/jusibe.dart';
Jusibe jusibe = Jusibe.initialize(
publicKey: 'PUBLIC_KEY_HERE',
accessToken: 'ACCESS_TOKEN_HERE',
);
This lets you make a request to send an SMS to the Jusibe API. It returns a type SMSDetails
containing the message status, ID and number of SMS credits used.
SMSDetails smsDetails = await jusibe.sendSMS(
from: "Fabusuyi", to: "08101563800", message: "Jusibe test");
print(smsDetails.messageID);
This gives you information on the delivery status of previously sent messages. It returns a type SMSDeliveryStatus
containing the message status, ID, date sent and date delivered.
SMSDeliveryStatus smsDeliveryStatus =
await jusibe.getDeliveryStatus(messageID: 'w53j2p6v12');
print(smsDeliveryStatus.status);
This gives you information about your available SMS credit balance. It returns a type int
representing the number of units left.
int creditsRemaining = await jusibe.checkCredits();
print(creditsRemaining);
Check out the example program here
Please feel free to fork this package and contribute by submitting a pull request to enhance its functionalities.
Just star and share the repo 🙂.