Go to file
Flávio Caetano d5922386d5 Using xcpretty on travis 2017-04-18 16:07:48 -03:00
Example Fixing docs & codecov.yml 2017-04-17 10:43:14 -03:00
ReCaptcha Fixing docs & codecov.yml 2017-04-17 10:43:14 -03:00
.gitignore Documentation 2017-04-11 18:27:10 -03:00
.travis.yml Using xcpretty on travis 2017-04-18 16:07:48 -03:00
CHANGELOG.md CHANGELOG 2017-04-13 17:21:45 -03:00
LICENSE Initial code 2017-04-11 15:00:44 -03:00
README.md Using xcpretty on travis 2017-04-18 16:07:48 -03:00
ReCaptcha.podspec Updating README 2017-04-18 15:35:55 -03:00
_Pods.xcodeproj Initial code 2017-04-11 15:00:44 -03:00
codecov.yml Fixing docs & codecov.yml 2017-04-17 10:43:14 -03:00
example.gif Adding gif to README 2017-04-18 15:54:02 -03:00

README.md

ReCaptcha

Build Status Version License Platform codecov


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.

Example Gif

Installation

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

pod "ReCaptcha"
# or
pod "ReCaptcha/RxSwift"

Usage

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

let recaptcha = try? ReCaptcha()

override func viewDidLoad() {
    super.viewDidLoad()

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


func validate() {
    recaptcha?.validate(on: view) { [weak self] result in
        print(try? result.dematerialize())
    }
}

You can also install the reactive subpod and use it with RxSwift:

recaptcha.rx.validate(on: view)
    .map { try $0.dematerialize() }
    .subscribe(onNext: { (token: String) in
        // Do something
    })

License

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