Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/oskang09/sms_listener


https://github.com/oskang09/sms_listener

Last synced: about 2 months ago
JSON representation

Awesome Lists containing this project

README

        

# Introduction

a simple native sms listener ( android only )

# Usage

```dart
// Construct listener
SmsListener listener = SmsListener();

// After listen first message will unsubscribe automatically or cancel when error.
listener.receiveOnce(
(Message message) {},
errorCallback: (PlatformException exception) {},
cancelOnError: true,
);

// Will keep listening until error or cancel by unsubcribe
var sub = listener.onReceive(
(Message message) {},
errorCallback: (PlatformException exception) {},
cancelOnError: true,
);
sub();
```