sms_detector 0.0.2 copy "sms_detector: ^0.0.2" to clipboard
sms_detector: ^0.0.2 copied to clipboard

A flutter plugin for receiving incoming sms in android. Currently supports on only Android.

Flutter SMS Detector #

A flutter plugin for receiving incoming sms in android. Currently supports on only Android.

Usage #

To use this plugin, add sms_detector as a dependency in your pubspec.yaml file.

Example #

  @override
  void initState() {
    super.initState();
    retrieveNewSms();
  }

  retrieveNewSms()  {
    SmsDetector.waitForSms().then((x){
      // x is the body of SMS.
      setState(() {_smsBody = x;});
    }).catchError((e){
      print(e);
    });
  }


  @override
  void dispose() {
    //stop sms receiver
    SmsDetector.stopSmsReceiver();
    super.dispose();
  }
0
likes
40
pub points
0%
popularity

Publisher

unverified uploader

A flutter plugin for receiving incoming sms in android. Currently supports on only Android.

Repository (GitHub)
View/report issues

License

BSD-3-Clause (LICENSE)

Dependencies

flutter

More

Packages that depend on sms_detector