smsalert 0.1.3 copy "smsalert: ^0.1.3" to clipboard
smsalert: ^0.1.3 copied to clipboard

A Dart package which helps developers with SMS Alert API services.

example/main.dart

import 'dart:io' show Platform;

import 'package:smsalert/smsalert.dart';

Future<void> main() async {
  String? _user = Platform.environment['SMSALERT_ACCOUNT_USERNAME'];
  String? _pwd = Platform.environment['SMSALERT_ACCOUNT_PASSWORD'];

  /// Your SMSAlert account username and password.
  /// You can skip this block if you store your credentials in environment variables.
  _user ??= 'SMSALERT_ACCOUNT_USERNAME';
  _pwd ??= 'SMSALERT_ACCOUNT_PASSWORD';

  /// Create an authenticated SMSAlert sa instance.
  SMSAlert sa = new SMSAlert(_user, _pwd);

  // Send a text message.
  // Returns a Map object (key/value pairs).
  Map? message = await sa.messages.sendsms({
    'text': 'Hello from Dart!', //SMS text
    'sender': 'CVDEMO', // a valid sender ID
    'mobileno': '+918010551055', // your destination phone number
    'route': 'demo' //to select route
  });

  print(message);
}
3
likes
120
pub points
47%
popularity

Publisher

verified publishercozyvision.com

A Dart package which helps developers with SMS Alert API services.

Homepage

Documentation

API reference

License

MIT (LICENSE)

Dependencies

http

More

Packages that depend on smsalert