Skip to content

Commit

Permalink
v1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
pushpender-singh-ap committed Jul 9, 2022
1 parent 24e4f48 commit 987df56
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,22 @@ startListeningForOtp = () =>
.then(p => RNOtpVerify.addListener(this.otpHandler))
.catch(p => console.log(p));

otpHandler = (message: string) => {
otpHandler = (message: string) => {
const otp = /(\d{4})/g.exec(message)[1];
this.setState({ otp });
RNOtpVerify.removeListener();
Keyboard.dismiss();
}

componentWillUnmount() {
getMobilehint = () => {
RNOtpVerify.requestHint()
.then((h) => console.log(h))
.catch((e) => console.log(e));
}

componentWillUnmount() {
RNOtpVerify.removeListener();
}
}
```

### Example React Native App
Expand Down Expand Up @@ -113,6 +119,12 @@ Start listening for OTP/SMS. Return true if listener starts else throws error.
Gets the hash code for the application which should be added at the end of message.
This is just a one time process.

---

### `requestHint():Promise<string[]>`

This method is part of sms retreiver api and its show available phone number list.

---
### `addListener(handler:(message:string)=>any):Promise<boolean>`

Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-otp-verify-remastered",
"version": "1.0.2",
"version": "1.1.0",
"description": "Verify SMS messages natively through React-Native without requiring additional permissions.",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand All @@ -13,7 +13,8 @@
"SMS",
"OTP",
"Verification",
"Sms-retreiver"
"Sms-retreiver",
"remastered"
],
"license": "MIT",
"repository": {
Expand Down

0 comments on commit 987df56

Please sign in to comment.