Skip to content

Latest commit

 

History

History
41 lines (29 loc) · 1.53 KB

File metadata and controls

41 lines (29 loc) · 1.53 KB

Sms

This module is used to send an SMS message to a specific phone number.

Functions

The sms module contains the following function.

    send(String number, String message)

Permissions

In order to send an SMS message via send() function, the following permission should be included in the AndroidManifest.xml file.

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

Description

The above function is used to perform the following activities.

🔷 send(String number, String message):

is used to send an SMS message to a phone number specified by number parameter having a content specified by message parameter.

Sample code snippet
			import { Sms } from "react-native-system-applications";
            ...
            ...
            ....
            _sendSms = () => {
                Sms.send("+123456789", "Hi, how are you?").then((res) => {
                	// do something
                }).catch((err) => {
                	console.log(err);
                });
            } 

Call to _sendSms() function sends an SMS message to the number passed as the first parameter where the content of the message is passed as the second parameter. A promise rejection will be sent for unsuccessful requests.