UNPKG

react-native-android-sms-listener

Version:

Allows you to listen for incoming SMS messages

18 lines (15 loc) 476 B
/* @flow */ import type CancellableSubscription from './CancellableSubscription' import type ReceivedSmsMessage from './ReceivedSmsMessage' import { DeviceEventEmitter } from 'react-native' const SMS_RECEIVED_EVENT = 'com.centaurwarchief.smslistener:smsReceived' export default { addListener( listener: (message: ReceivedSmsMessage) => void ): CancellableSubscription { return DeviceEventEmitter.addListener( SMS_RECEIVED_EVENT, listener ) } }