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

SMSFetcher is a flutter library that makes retrieval of sms from android phone easy.

SMS FETCHER #

An Open Source Flutter Package that makes retrieving of SMS easier from your android phone.

Note: #

flutter_sms_fetcher doesn't support iOS due to Apple's Privacy Concerns. See link for more info: link

Usage #

Add the following permissions to your AndroidManifest.xml file

<uses-permission android:name="android.permission.READ_SMS"/>

Example #

import 'dart:async';

import 'package:flutter/services.dart';
import 'package:smsfetcher/smsfetcher.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  List<Sms> _smsList;


  Future<void> fetchSms() async {
    List<Sms> smsList;
    try {
      smsList = await Smsfetcher.getSms();
    }on PlatformException{
      print("Error");
    }
    setState(() {
      _smsList = smsList;
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Sms Fetcher'),
        ),
        body: Center(
          child: Column(
            children: <Widget>[
              Text('$_smsList'),
              RaisedButton(
                onPressed: (){
                  fetchSms();
                },
                child: Text("Fetch sms"),
                color: Colors.orange,
              )
            ],
          ),
        ),
      ),
    );
  }
}

Contributors #

Josteve Adekanbi and Momoh Hero

5
likes
30
pub points
0%
popularity

Publisher

unverified uploader

SMSFetcher is a flutter library that makes retrieval of sms from android phone easy.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, permission

More

Packages that depend on smsfetcher