Go to file
Flávio Caetano f34cb7fbb5 Documentation 2017-04-11 18:27:10 -03:00
Example RxSwift support 2017-04-11 15:32:35 -03:00
ReCaptcha Documentation 2017-04-11 18:27:10 -03:00
.gitignore Documentation 2017-04-11 18:27:10 -03:00
LICENSE Initial code 2017-04-11 15:00:44 -03:00
README.md Documentation 2017-04-11 18:27:10 -03:00
ReCaptcha.podspec Documentation 2017-04-11 18:27:10 -03:00
_Pods.xcodeproj Initial code 2017-04-11 15:00:44 -03:00

README.md

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:

let recaptcha = try? ReCaptcha()

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
        print(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.