
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
react-native-sms-retriever
Advanced tools
With the SMS Retriever API, you can perform SMS-based user verification in your Android app automatically, without requiring the user to manually type verification codes, and without requiring any extra app permissions.
npm install --save react-native-sms-retriever
react-native link react-native-sms-retriever
If you don't like to use
react-native link
, check Manual Installation Wiki Page.
import SmsRetriever from 'react-native-sms-retriever';
// Get the phone number (first gif)
_onPhoneNumberPressed = async () => {
try {
const phoneNumber = await SmsRetriever.requestPhoneNumber();
} catch (error) {
console.log(JSON.stringify(error));
}
};
// Get the SMS message (second gif)
_onSmsListenerPressed = async () => {
try {
const registered = await SmsRetriever.startSmsRetriever();
if (registered) {
SmsRetriever.addSmsListener(event => {
console.log(event.message);
SmsRetriever.removeSmsListener();
});
}
} catch (error) {
console.log(JSON.stringify(error));
}
};
If you have problems to get the SMS content, check the SMS Rules Wiki Page.
Method | Return | Description |
---|---|---|
requestPhoneNumber() | Promise<String> | Obtain the user's phone number (using the hint picket). |
startSmsRetriever() | Promise<Boolean> | Start to listen for SMS messages. |
addSmsListener(event: Function) | Promise<Boolean> | Get the SMS content with: event.message . |
removeSmsListener() | Void | Stop to listen for SMS messages. |
Check the erros of each method on Erros Wiki Page.
A brief summary of each React Native SMS Retriever release can be found on the releases.
This code is distributed under the terms and conditions of the MIT License.
Made with ❤ in Curitiba 🇧🇷
FAQs
Android SMS Retriever API for React Native
The npm package react-native-sms-retriever receives a total of 5,010 weekly downloads. As such, react-native-sms-retriever popularity was classified as popular.
We found that react-native-sms-retriever demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.