From 987df569dbbfe4e663df7e01294fda63d2b2ecd2 Mon Sep 17 00:00:00 2001 From: Pushpender Singh Date: Sat, 9 Jul 2022 13:36:43 +0530 Subject: [PATCH] v1.1.0 --- README.md | 18 +++++++++++++++--- package.json | 5 +++-- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index b7b50ef..7c18dab 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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` + +This method is part of sms retreiver api and its show available phone number list. + --- ### `addListener(handler:(message:string)=>any):Promise` diff --git a/package.json b/package.json index 841ab6c..9c93db5 100644 --- a/package.json +++ b/package.json @@ -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", @@ -13,7 +13,8 @@ "SMS", "OTP", "Verification", - "Sms-retreiver" + "Sms-retreiver", + "remastered" ], "license": "MIT", "repository": {