🚀 Socket Launch Week Day 4:Socket MCP Adds Org Alerts, Threat Feed Review, and Package Inspection.Learn more
Sign In

react-native-direct-sms-giasin

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-direct-sms-giasin

This module allows send sms without user interaction

latest
Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
7
75%
Maintainers
1
Weekly downloads
 
Created
Source

react-native-direct-sms-giasin

Getting started

$ npm install react-native-direct-sms-giasin --save

Mostly automatic installation

$ react-native link react-native-direct-sms-giasin

Usage

import DirectSms from 'react-native-direct-sms-giasin';

DirectSms.sendDirectSms('999...', 'This is a direct sms');
 

User Permission

function sendDirectSms() {
    try {
        const granted = await PermissionsAndroid.request(
        PermissionsAndroid.PERMISSIONS.SEND_SMS,
            {
                title: 'App Sms Permission',
                message:
                'App needs access to your inbox         ' +
                'so you can send messages in background.',
                buttonNeutral: 'Ask Me Later',
                buttonNegative: 'Cancel',
                buttonPositive: 'OK',
            },
        );
        if (granted === PermissionsAndroid.RESULTS.GRANTED) {
            DirectSms.sendDirectSms('999...', 'This is a direct sms');
        } else {
            console.log('SMS permission denied');
        }
    } catch (err) {
        console.warn(err);
    }
}

Keywords

react-native

FAQs

Package last updated on 03 Sep 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts