1.0.0 • Published 1 year ago

react-native-sms-sender v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

react-native-sms-sender

SendSMS

Use this RN component to send an SMS with a DeviceEventEmitter (SMS_STATUS_LISTENER). iOS and Android are both supported.

How to install

  1. npm install react-native-sms-sender --save

Using the module

Once everything is all setup, it's pretty simple:

SendSMS.send(myOptionsObject);

Object Properties

KeyTypePlatformsRequired?Description
bodyStringiOS/AndroidNoThe text that shows by default when the SMS is initiated
recipientsArray (strings)iOS/AndroidNoProvides the phone number recipients to show by default

Example:

import SendSMS from 'react-native-sms-sender'

//some stuff

someFunction() {
	SendSMS.send({
		body: 'The default body of the SMS!',
		recipients: ['0123456789', '9876543210'],
	});
	
	//only for android |0:send,1:sent,2:delivered,3:errorSend,4:notDelivered|
	let statusListener = DeviceEventEmitter.addListener('SMS_STATUS_LISTENER', function(status) {
		console.log(status);
	});
}