패키지, 저장소 및 앱 카테고리 검색

패키지 상세v0.1.0

flutter_recaptcha_v2

Google ReCaptcha V2용 Flutter 플러그인입니다.

30일 다운로드
68
좋아요
39
Pub 점수
15

패키지 설치

flutter pub add flutter_recaptcha_v2

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

모바일 애플리케이션에 Google ReCaptcha V2를 통합하는 Flutter 플러그인으로, 개발자가 폼과 로그인 흐름에 봇 보호 기능을 추가할 수 있도록 합니다. 이 플러그인은 Android 및 iOS 플랫폼에서 reCAPTCHA 도전 과제를 렌더링하고 검증하기 위한 간단한 인터페이스를 제공합니다. 플러그인은 Google의 reCAPTCHA 서비스와의 하위 수준 통신을 처리하여 사용자 상호작용의 안전한 검증을 보장합니다. 사용이 용이하도록 설계되어 비동기 검증을 지원하며 서버 측 검증을 위해 토큰을 반환합니다.

사용 사례

  • 로봇으로부터 로그인 폼 보호
  • 연락 양식 제출 보호
  • 자동 계정 생성 방지
  • 등록 워크플로우에서 보안 강화
  • 민감한 작업에서 사용자 동작 검증

주요 기능

  • Flutter 앱과의 간단한 통합
  • reCAPTCHA V2 숨겨진 및 일반 유형을 지원합니다
  • 서버 검증을 위한 인증 토큰을 반환합니다
  • 크로스 플랫폼 호환성 (Android 및 iOS)
  • 비동기 검증 워크플로우

적합한 대상

  • 보안 인증 흐름을 구축하는 개발자
  • 양식에서 봇 보호가 필요한 앱
  • 불법 사용 방지 조치 준수 필요 프로젝트
  • Flutter에 Google의 reCAPTCHA 서비스를 통합하는 팀
  • 자동 오용 위험이 높은 모바일 앱

고려 사항

  • reCAPTCHA 인증을 위해 인터넷 연결이 필요합니다
  • 서버 측 토큰 검증은 필수입니다
  • 신중하게 구현되지 않으면 사용자 경험에 영향을 줄 수 있습니다
  • 외부 Google 서비스의 가용성에 따라 달라집니다
  • reCAPTCHA V2에 한정되며, V3 또는 최신 버전은 제외

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

flutter_recaptcha_v2

A Flutter plugin for Google ReCaptcha V2.

Getting Started

This plugin requires Webview to use Google ReCaptcha. This plugin only supports Google ReCAPTCHA V2 (not V3)

Obtain your own key & secret here: https://www.google.com/recaptcha

!!! Remember to add this domain into the reCaptcha setting or add your own domain: recaptcha-flutter-plugin.firebaseapp.com

Then test your API KEY at: https://recaptcha-flutter-plugin.firebaseapp.com/?api_key=API_KEY

Put RecaptchaV2 widget into your widget tree (Usually inside Stack widget), make sure it's placed on top of the tree and block all the behind interactions:

  • You can change the plugin url for the captcha domain insde the RecaptchaV2 or leave it by default non adding the line:
pluginURL: "https://mypersonalurl.com"

if you have setted your own domain, specify the domain used

  • To show the Cancel Button with the captcha controller set the boolean to true:
visibleCancelBottom: true

otherwise it won't appear

  • Set the Text for the Cancel buttom or leave it by default:
textCancelButtom: "CANCEL CAPTCHA"
Example
RecaptchaV2Controller recaptchaV2Controller = RecaptchaV2Controller();
...
RecaptchaV2(
    apiKey: "YOUR_API_KEY", // for enabling the reCaptcha
    apiSecret: "YOUR_API_SECRET", // for verifying the responded token
    pluginURL: "https://mypersonalurl.com",
	visibleCancelBottom: true,
	textCancelButtom: "CUSTOM CANCEL CAPTCHA BUTTOM TEXT",
	controller: recaptchaV2Controller,
    onVerifiedError: (err){
        print(err);
    },
    onVerifiedSuccessfully: (success) {
        setState(() {
            if (success) {
                // You've been verified successfully.
            } else {
                // "Failed to verify.
            }
        });
    },
),

The RecaptchaV2 widget is hidden by default, you need to attach the RecaptchaV2Controller and call show() method when needed. Like this:

recaptchaV2Controller.show();

Manually hide it:

recaptchaV2Controller.hide();

That's it!

카테고리

의존성

의존성 목록 2 개

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.