smsfetcher 1.0.0
smsfetcher: ^1.0.0

Flutter Android iOS

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
80
pub points
18%
popularity

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

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

momohhero2@gmail.com

License

unknown (LICENSE)

Dependencies

flutter, permission

More

Packages that depend on smsfetcher