{"id":20564092,"url":"https://github.com/clintjang/sample-react-native-google-recaptcha-v2","last_synced_at":"2026-04-19T17:32:01.874Z","repository":{"id":99120057,"uuid":"146425026","full_name":"ClintJang/sample-react-native-google-recaptcha-v2","owner":"ClintJang","description":"Google reCaptcha V2를 React Native에 localhost로 적용해서 확인해 보기위한 정도의 Sample Source 입니다.","archived":false,"fork":false,"pushed_at":"2018-11-02T11:41:10.000Z","size":514,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-16T19:41:36.774Z","etag":null,"topics":["google-captcha","korean","react-native","recaptcha","recaptchav2","sample"],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ClintJang.png","metadata":{"files":{"readme":"Readme-en.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-08-28T09:38:40.000Z","updated_at":"2018-11-02T11:41:11.000Z","dependencies_parsed_at":"2023-03-13T15:52:01.036Z","dependency_job_id":null,"html_url":"https://github.com/ClintJang/sample-react-native-google-recaptcha-v2","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClintJang%2Fsample-react-native-google-recaptcha-v2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClintJang%2Fsample-react-native-google-recaptcha-v2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClintJang%2Fsample-react-native-google-recaptcha-v2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClintJang%2Fsample-react-native-google-recaptcha-v2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ClintJang","download_url":"https://codeload.github.com/ClintJang/sample-react-native-google-recaptcha-v2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242173585,"owners_count":20084037,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["google-captcha","korean","react-native","recaptcha","recaptchav2","sample"],"created_at":"2024-11-16T04:23:52.279Z","updated_at":"2026-04-19T17:32:01.786Z","avatar_url":"https://github.com/ClintJang.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sample React Native Google reCaptcha V2\n\n`Google ReCaptcha V2` to `React Native` `localhost` is a sample source to check enough to see.\n\nIn this case, I tried to reCaptcha V2 to React Native, and it was simple to sample.\n\nThank you for using Google reCaptcha for free. 🙇\n\n- [What is recaptcha? wiki Link](https://ko.wikipedia.org/wiki/ReCAPTCHA) \n- [Google reCaptcha V2 Link](https://developers.google.com/recaptcha/docs/display)\n- [Google reCaptcha V3 Link](https://developers.google.com/recaptcha/docs/v3) \n\n# reCaptcha v3\n\u003e `reCaptcha v3` has a library of react native.\n\n- Library link : [react-native-recaptcha-v3](https://www.npmjs.com/package/react-native-recaptcha-v3)\n\n#  reCaptcha v2\nThere seems **to be no library** that allows you to use the library link `reCaptcha v2` directly from react native.\n\nYou need to apply it **using webview**.\n\n## Native library\nreCaptcha v2 is a library link made to the native level.\n\n- iOS : [ReCaptcha\nSwift](https://github.com/fjcaetano/ReCaptcha),\nsupports swift and rxswift.\n- android : The [safetynet](https://developer.android.com/training/safetynet/recaptcha) service is supported. Please refer to the guide document.\n\n## Sampling \n\u003e Simple sampling.\u003cbr /\u003e\nWe can test it by issuing a key to localhost as an individual account. \u003cbr /\u003e\n\n### If first time\n- [React-Native getting-started](https://facebook.github.io/react-native/docs/getting-started) : I tested the sample source by implementing it with the `react-native` shell comment on that link. You need to have the package manager installed as required by the guide.\n- Then run the install command from the root directory of this sample source.\n\n\t``` \n\t$ npm install \n\t```\n\n- Once you have completed the process, you can run it in two ways.\n\t1. Run \"SampleRecaptchaV2.xcodeproj\" in iOS folder and execute it. \u003cbr /\u003e or \u003cbr /\u003e\n\t2. Execute shell command.\n\t\t- step 1\n\t\t\n\t\t```\n\t\t$ react-native start\n\t\t```\n\t\t- step 2\n\t\t\n\t\t```\n\t\t$ react-native run-ios\n\t\t```\n\t\t\n### Progress\n- I tested it with the` react-native` shell command.\n\n- [Key generation link](http://www.google.com/recaptcha/admin) : I selected v2 from the link and typed localhost.\n\u003cbr/\u003e\u003cimg width=\"611\" height=\"460\" src=\"/Image/register_new_site01.png\"\u003e\u003c/img\u003e\n- You can use Site Key issued from keys.\n\n### Result \n- The result screen.\n\n| The site key is incorrect | Validate Good Site Key |\n|------------------------------------------|:----------:|\n| \u003cimg width=\"270\" height=\"480\" src=\"/Image/error_site_key01.jpeg\"\u003e | \u003cimg width=\"268\" height=\"480\" src=\"/Image/site_key_good01.gif\"\u003e |\n\n\n- It is the source of `App.js`. (`siteKey: \"your site key !!\"` Will be corrected.)\n\n```react\n/**\n * Sample React Native App\n * https://github.com/facebook/react-native\n *\n * @format\n * @flow\n */\n\nimport React, {Component} from 'react';\nimport {WebView, Dimensions, StyleSheet, View} from 'react-native';\n\n// I do not want to see the log now!!\n// import {YellowBox} from 'react-native';\n// YellowBox.ignoreWarnings(['Warning: ReactNative.createElement']);\nconsole.disableYellowBox = true;\n\n\n\ntype Props = {};\nexport default class App extends Component\u003cProps\u003e {\n  constructor(props) {\n    super(props);\n\n    this.state = {\n      siteKey:\"your site key!!\"\n   };\n }\n\n  render() {\n    return (\n      \u003cView style={styles.container}\u003e\n        \u003cWebView \n          javaScriptEnabled={true} \n          mixedContentMode={'always'} \n          scalesPageToFit={true}\n          style={{\n            width: Dimensions.get('window').width-20,\n            // height: 500,\n            marginTop:40\n          }} \n          source={{\n              html: this.getHTMLStirng(),\n              baseUrl: 'http://localhost'\n          }}/\u003e\n      \u003c/View\u003e\n    );\n  }\n\n  getHTMLStirng(){\n    var originalForm = '\u003c!DOCTYPE html\u003e\u003chtml\u003e\u003chead\u003e'\n                        + '\u003cscript src=\"https://www.google.com/recaptcha/api.js\"\u003e'\n                        + '\u003c/script\u003e\u003c/head\u003e\u003cbody\u003e'\n                        + '\u003cdiv class=\"g-recaptcha\" data-sitekey=\"[MySiteKey]\"\u003e\u003c/div\u003e'\n                        + '\u003c/body\u003e\u003c/html\u003e'\n    let replaceForm =  originalForm\n        .replace(\"[MySiteKey]\", this.state.siteKey); \n\n    return replaceForm; \n  }\n}\n\n\nconst styles = StyleSheet.create({\n  container: {\n    flex: 1,\n    justifyContent: 'center',\n    alignItems: 'center',\n    backgroundColor: 'green',\n  },\n});\n\n```\n\n- development environment.\n\n```\n$ react-native info\nScanning folders for symlinks in /Users/clintjang/Documents/RNTest/react-native/SampleRecaptchaV2/node_modules (13ms)\n\n  React Native Environment Info:\n    System:\n      OS: macOS High Sierra 10.13.6\n      CPU: x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz\n      Memory: 32.00 MB / 16.00 GB\n      Shell: 3.2.57 - /bin/bash\n    Binaries:\n      Node: 10.9.0 - /usr/local/bin/node\n      Yarn: 1.9.4 - /usr/local/bin/yarn\n      npm: 6.2.0 - /usr/local/bin/npm\n    SDKs:\n      iOS SDK:\n        Platforms: iOS 11.4, macOS 10.13, tvOS 11.4, watchOS 4.3\n    IDEs:\n      Android Studio: 3.1 AI-173.4907809\n      Xcode: 9.4.1/9F2000 - /usr/bin/xcodebuild\n    npmPackages:\n      react: 16.4.1 =\u003e 16.4.1 \n      react-native: 0.56.0 =\u003e 0.56.0 \n    npmGlobalPackages:\n      create-react-native-app: 1.0.0\n      react-native-cli: 2.0.1\n```\n\n\nHave a nice day. 🙇\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclintjang%2Fsample-react-native-google-recaptcha-v2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclintjang%2Fsample-react-native-google-recaptcha-v2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclintjang%2Fsample-react-native-google-recaptcha-v2/lists"}