ReCaptcha/README.md

1.5 KiB

ReCaptcha

CI Status Version License Platform


Add Google's Invisible ReCaptcha to your project. This library automatically handles ReCaptcha's events and retrieves the validation token or notifies you to present the challenge if invisibility is not possible.

Installation

ReCaptcha is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "ReCaptcha"

Usage

Simply add ReCaptchaKey and ReCaptchaDomain to your Info.plist and run:

override func viewDidLoad() {
    super.viewDidLoad()

    recaptcha.presenterView = view
    recaptcha.configureWebView { [weak self] webview in
        webview.frame = self?.view.bounds ?? CGRect.zero
        webview.tag = ViewController.webViewTag
    }
}


func validate() {
    recaptcha.validate { [weak self] result in
        dprint(try? result.dematerialize())
    }
}

Author

Flávio Caetano, flavio@vieiracaetano.com

License

ReCaptcha is available under the MIT license. See the LICENSE file for more info.