Socket
Socket
Sign inDemoInstall

react-native-sms-user-consent

Package Overview
Dependencies
0
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-native-sms-user-consent

This page describes how to use the SMS User Consent API to request user consent to read a single SMS verification message. If the user consents, the API returns the text of the message, from which you can get the verification code and complete the verific


Version published
Weekly downloads
9
decreased by-55%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

The SMS User Consent API complements the SMS Retriever API by allowing an app to prompt the user to grant access to the content of a single SMS message. When a user gives consent, the app will then have access to the entire message body to automatically complete SMS verification.

Getting Started

Install

$ yarn add react-native-sms-user-consent
  • React Native 0.60+

CLI autolink feature links the module while building the app.

  • React Native <= 0.59
$ react-native link react-native-sms-user-consent

Note For iOS using cocoapods, run:

$ cd ios/ && pod install

Usage

Import

import SMSUserConsent from 'react-native-sms-user-consent';

Start listen SMS and get message

interface SMSMessage {
  receivedOtpMessage: string
}

getSMSMessage = async () => {
  try {
    const message: SMSMessage = await SMSUserConsent.listenOTP()
  } catch (e) {
    // error
  }
}

Remove listener


removeSmsListener = () => {
  try {
    SMSUserConsent.removeOTPListener()
  } catch(e) {
    // error
  }
}

Keywords

FAQs

Last updated on 17 Jan 2020

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc