0.0.33 • Published 1 year ago

@optisolbusiness/react-native-otp-inputs v0.0.33

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@optisolbusiness/react-native-otp-inputs

@optisolbusiness/react-native-otp-inputs

Installation

npm i @optisolbusiness/react-native-otp-inputs

npm install react-native-otp-verify

Usage

Things to follow for auto read otp feature

android

Make otpAutoRead prop as true can get hashValue from hashValue prop pass this hashValue while sending otp

While crafting the OTP message keep below things in mind

Should start with <#>, to register as an OTP SMS The message should end with the generated hash key

Sample Message

<#> Welcome to AwsomeProject. Your verification code is 5843.

kFUwfusCq/+ => Give your hash value

ios

In ios auto read otp work for ios 12+

In device settings => Passwords Enable AutoFill Passwords

In code Pass textType={'oneTimeCode'} for auto read otp from messages in ios

In ios otp will not fill automatically from messages, it will appear on top of keyboard. When click on otp it will fill automatically.

import { OTP_Input } from "@optisolbusiness/react-native-otp-inputs";
// ...

<OTP_Input
        numberOfDigits={5}
        onHandleOTPChange={valueChange}
        otpAutoRead={true}
        hashValue={hashNum} 
        InputStyle={{                 
          margin: 5,
          width: 40,
          height: 40,
          borderWidth: 1,
          borderColor: "#ccc",
          fontSize: 18,
          textAlign: "center",
          borderRadius: 5,
        }}
        styleContiner={{                  
          flexDirection: "row",
          justifyContent: "flex-start",
          alignItems: "center",
        }}
         textType={'oneTimeCode'}
      />

OTP_INput Props

PropTypeDescription
numberOfDigitsNumberMandatory. Pass Number accorind to requirement
onHandleOTPChangeFunctionMandatory. On otp input change
otpAutoReadbooleanOptional. Enable for auto read otp feature in android
hashValueNumberOptional. Pass this hash value while sending messages in android
textTypeStringOptional. Give oneTimeCode prop to enable auto read otp feature in ios
InputStyleObjectOptional. overide container style
styleContinerObjectOptional. overide TextBox style

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library

0.0.33

1 year ago

0.0.32

1 year ago

0.0.31

1 year ago

0.0.30

1 year ago

0.0.29

1 year ago

0.0.28

1 year ago

0.0.27

1 year ago

0.0.25

1 year ago

0.0.24

1 year ago

0.0.23

1 year ago

0.0.22

1 year ago

0.0.21

1 year ago

0.0.20

1 year ago

0.0.19

1 year ago

0.0.18

1 year ago

0.0.17

1 year ago

0.0.16

1 year ago

0.0.15

1 year ago

0.0.14

1 year ago

0.0.13

1 year ago

0.0.12

1 year ago

0.0.11

1 year ago

0.0.10

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago