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
npm install react-native-sms-user-consent```
$ 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
`bash`
$ react-native link react-native-sms-user-consent
Note For iOS using cocoapods, run:
`bash`
$ cd ios/ && pod install



`js`
import SMSUserConsent from 'react-native-sms-user-consent';
tsx
interface SMSMessage {
receivedOtpMessage: string
}getSMSMessage = async () => {
try {
const message: SMSMessage = await SMSUserConsent.listenOTP()
} catch (e) {
// error
}
}
`$3
`tsxremoveSmsListener = () => {
try {
SMSUserConsent.removeOTPListener()
} catch(e) {
// error
}
}
``