Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
react-native-google-recaptcha-v2
Advanced tools
Readme
npm install react-native-google-recaptcha-v2
yarn add react-native-google-recaptcha-v2
import ConfirmGoogleCaptcha from 'react-native-google-recaptcha-v2';
import React from 'react';
import ConfirmGoogleCaptcha from 'react-native-google-recaptcha-v2';
const siteKey = 'you_site_key';
const baseUrl = 'base_url';
class App extends React.Component {
onMessage = event => {
if (event && event.nativeEvent.data) {
if (['cancel', 'error', 'expired'].includes(event.nativeEvent.data)) {
this.captchaForm.hide();
return;
} else {
console.log('Verified code from Google', event.nativeEvent.data);
setTimeout(() => {
this.captchaForm.hide();
// do what ever you want here
}, 1500);
}
}
};
render() {
return (
<View style={styles.container}>
<ConfirmGoogleCaptcha
ref={_ref => this.captchaForm = _ref}
siteKey={siteKey}
baseUrl={baseUrl}
languageCode='en'
onMessage={this.onMessage}
/>
<Button
onPress={() => {
this.captchaForm.show();
}}
title='Click'
style={{ width: 120, backgroundColor: 'darkviolet' }}
textColor='#fff'
/>
</View>
);
}
}
You can import GoogleReCaptcha from 'react-native-google-recaptcha-v2/GoogleReCaptcha';
to customize UI by yourself
siteKey
(String) - The site key of the Google Recaptcha.baseUrl
(String) The url domain defined on your Google Recaptcha.onMessage
(Function) - The callback function after received response, error of Google captcha or when user cancellanguageCode
(String) - Language to be display of captcha form. Can be found at this linkcancelButtonText
(String) - Title of cancel button.MIT Licensed
FAQs
Implement Google recaptcha v2 in React Native (both Android an iOS)
The npm package react-native-google-recaptcha-v2 receives a total of 538 weekly downloads. As such, react-native-google-recaptcha-v2 popularity was classified as not popular.
We found that react-native-google-recaptcha-v2 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.