This README provides step-by-step instructions to set up a MTCaptcha project.
Before you begin, make sure you have the following software installed:
- Node.js
- npm (usually included with Node.js)
- React Native CLI
- Install Node.js and npm: you can install Node.js and npm with the following commands:
brew update
brew install nodeVerify that Node.js and npm are installed by running:
node -v
npm -v- Install React Native CLI:: Install the React Native CLI globally using npm:
npm install -g react-native-cliVerify the installation by running:
react-native --version- Install Project Dependencies:
Install the project dependencies using npm or yarn:
npm install
- Running the iOS App:
To run the iOS app, you will need to navigate to the ios folder and install the CocoaPods dependencies.
cd iospod installcd ..
npx react-native start
To run the iOS app, open a new terminal window, navigate to the project directory, and execute:
npx react-native run-ios
This will build and launch the iOS app in the simulator.
- Running the Android App:
To run the Android app, make sure you have the Android development environment set up. Follow the official React Native documentation for Android setup if you haven't done so already.
Start an Android emulator or connect a physical device to your computer.
To run the Android app, open a terminal window, navigate to the project directory, and execute:
npx react-native run-android
This will build and launch the Android app on your emulator or device.
If you can't get this to work, see the Troubleshooting page.
To learn more about React Native, take a look at the following resources:
- React Native Website - learn more about React Native.
- Getting Started - an overview of React Native and how setup your environment.
- Learn the Basics - a guided tour of the React Native basics.
- Blog - read the latest official React Native Blog posts.
react-native-webview (https://github.com/react-native-community/react-native-webview)
| Name | Type | Description |
|---|---|---|
| siteKey (required) | string | Site key associated with the site. It can be fetched from admin portal. For more info please visit https://www.mtcaptcha.com/dev-guide |
| domainName (required) | string | Fully qualified doamin name configured in MTCaptcha admin portal e.g https://www.mtcaptcha.com |
| lang | string | MTCaptcha supports more than 100 languages. Please refer https://www.mtcaptcha.com/faq-custom-text-language |
| style | ViewStyle (refer here) | Style for the webview |
| widgetSize | string | Supported values are mini and standard. Default is standard |
| theme | string | Find the different thme which can be set for captcha here |
| action | string | Tag for captcha alatytics. e.g mobile Read more https://www.mtcaptcha.com/dev-guide-captcha-action |
| customLangText | JSON | All text and language can be customed. Please read more https://www.mtcaptcha.com/dev-guide-custom-messages. |
| customStyle | JSON | To set custom style for the cpatcha widget. Please refer https://www.mtcaptcha.com/faq-custom-style |
| enableTestMode | string | This optimises captcha widget for automated testing please refer https://www.mtcaptcha.com/dev-guide-automated-testing |
| onCaptchaVerified | function | This is a callback function when the captcha is verified |
| onCaptchaExpired | function | This is a callback function when the captcha is expired |
| onError | function | This is a callback function when the captcha results in error such as invalid site key, un recognized doamin |