easysms 1.0.0 copy "easysms: ^1.0.0" to clipboard
easysms: ^1.0.0 copied to clipboard

Easy to use, simple configuration can send SMS messages to Phone. Easily expandable gateways, messages customized according to scenarios.

example/main.dart

import 'package:easysms/easysms.dart';

/// Create a tencent cloud SMS geteway
const Geteway geteway = TencentCloudGeteway(
  appId: '<You Tencent Cloud SMS APP ID>',
  secretId: '<You Tencent Cloud Secret ID>',
  secretKey: '<You Tencent Cloud Secret Key>',
);

/// Create a message
class VerificationCodeNessage extends Message {
  @override
  Future<void> initialize() async {
    // Initialize your message
  }

  @override
  String get content => '<You Message content>';

  @override
  List<String> get data => [
        '<You message data>', /* More data */
      ];

  @override
  String get signName => '<You sign name>';

  @override
  String get template => "<You sms template id>";
}

final Message message = VerificationCodeNessage();

void main() async {
  // Send a message
  final response =
      await geteway.send('<You E.164 formated phone number>', message);

  print(response.body);
}
4
likes
150
points
60
downloads

Publisher

verified publisherodroe.com

Weekly Downloads

Easy to use, simple configuration can send SMS messages to Phone. Easily expandable gateways, messages customized according to scenarios.

Repository (GitHub)
View/report issues
Contributing

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

crypto, http

More

Packages that depend on easysms