1.0.26 • Published 5 months ago

react-native-siarashield v1.0.26

Weekly downloads
-
License
ISC
Repository
-
Last release
5 months ago

react-native-siarashield

Siarashield

To authenticate using siarashield

Prerequisites

These steps are to dynamically get public and private keys.

Installation

$ npm install react-native-dotenv

If you are using Yarn:

$ yarn add react-native-dotenv

This Package Url : Follow for more instruction more instruction.

Basic Setups : Add this code in your babel.config file.

{
  "plugins": [
    [
      "module:react-native-dotenv",
      {
        "moduleName": "@env",
        "path": ".env",
        "safe": false,
        "allowUndefined": true
      }
    ]
  ]
}

Configuration : Create a file on your root folder which name is ".env" .

Note: Use public key "TEST-CYBERSIARA" for staging/development.

Note : Open this link you can generate your public and private key open link.

.env

PUBLIC_KEY = TEST-CYBERSIARA      <!-- In that place you can put your public and private key   -->
PRIVATE_KEY = TEST-CYBERSIARA

Configuration This .env File into your project : Create a Folder on Your Project (src/Config) and after then Create a file which name is "envs.js"

// Paste this code into your "envs.js" file
import { PUBLIC_KEY, PRIVATE_KEY } from "@env";

const PUBLIC_KEYS = {
  PUBLIC_KEY,
};

const PRIVATE_KEYS = {
  PRIVATE_KEY,
};

export default { PUBLIC_KEYS, PRIVATE_KEYS };

Note : First complete above steps after then follow below steps.

Installation

Using npm:

npm install --save react-native-siarashield

or using yarn:

yarn add react-native-siarashield
Permissions

To get the Device Ip,

  1. On Android you must get Device Ip permission:
  <uses-permission android:name="android.permission.READ_PHONE_STATE" />

Properties

PropDescriptionDefaultRequired
titleThe name of the button displayed to the user.LoginNo
PUBLIC_KEYSet the public key, Which get from the mycybersiara.com site-Yes
PRIVATE_KEYSet the private key, Which get from the mycybersiara.com site-Yes
onPressButton press event, Set your custom logic for button press eventsMethodYes
verifyIconNameInclude a GIF or images that you want to display upon successful verificationGIFNo
titleStyleModify title text styles-No
buttonStylesModify button styles-No
isShowVerifyIconShow verification icon on button, while completed verification.trueNo

Usage

import CyberSiaraCaptcha from "react-native-siarashield";

// Import this file for geting data from that file
import envs from "../Config/envs";

const Login = () => {
  // You can change isLogin Props value using this Method.
  const onSubmitHandler = () => {
    // You can set your business logic here
    // like. Validation user form, APIs calling
  };

  return (
    // You can change props value by state variable.
    <CyberSiaraCaptcha
      PUBLIC_KEY={envs.PUBLIC_KEYS.PUBLIC_KEY}
      PRIVATE_KEY={envs.PRIVATE_KEYS.PRIVATE_KEY}
      onPress={onSubmitHandler}
    />
  );
};
1.0.26

5 months ago

1.0.19

11 months ago

1.0.18

11 months ago

1.0.17

11 months ago

1.0.16

11 months ago

1.0.22

11 months ago

1.0.21

11 months ago

1.0.20

11 months ago

1.0.25

10 months ago

1.0.24

11 months ago

1.0.23

11 months ago

1.0.15

11 months ago

1.0.14

11 months ago

1.0.13

11 months ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.12

1 year ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.0

2 years ago