All Projects → fjcaetano → Recaptcha

fjcaetano / Recaptcha

Licence: mit
[In]visible ReCaptcha v2 for iOS

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Recaptcha

Angular Recaptcha
AngularJS directive to add a reCaptcha widget to your form
Stars: ✭ 502 (+141.35%)
Mutual labels:  google, recaptcha
Rxswift To Combine Cheatsheet
RxSwift to Apple’s Combine Cheat Sheet
Stars: ✭ 1,040 (+400%)
Mutual labels:  reactive, rxswift
Rxcombine
Bi-directional type bridging between RxSwift and Apple's Combine framework
Stars: ✭ 741 (+256.25%)
Mutual labels:  reactive, rxswift
Cycle.swift
An experiment in unidirectional architecture inspired by Cycle.js. https://cycle.js.org
Stars: ✭ 24 (-88.46%)
Mutual labels:  reactive, rxswift
Reduxmoviedb
🎥 See the upcoming movies! ReSwift + RxSwift 💖 Hacktoberfest 🎃
Stars: ✭ 137 (-34.13%)
Mutual labels:  reactive, rxswift
mvcvm-swift-file-templates
Swift file templates for boosting mobile app development.
Stars: ✭ 16 (-92.31%)
Mutual labels:  reactive, rxswift
Rxiglistkit
RxSwift wrapper for IGListKit
Stars: ✭ 44 (-78.85%)
Mutual labels:  reactive, rxswift
ReactiveAPI
Write clean, concise and declarative network code relying on URLSession, with the power of RxSwift. Inspired by Retrofit.
Stars: ✭ 79 (-62.02%)
Mutual labels:  reactive, rxswift
Easyreact
Are you confused by the functors, applicatives, and monads in RxSwift and ReactiveCocoa? It doesn't matter, the concepts are so complicated that not many developers actually use them in normal projects. Is there an easy-to-use way to use reactive programming? EasyReact is born for this reason.
Stars: ✭ 1,616 (+676.92%)
Mutual labels:  reactive, rxswift
Rxasdatasources
RxDataSource for AsyncDisplayKit/Texture
Stars: ✭ 114 (-45.19%)
Mutual labels:  reactive, rxswift
Mp3ID3Tagger
🎶🎵A macOS application to edit the ID3 tag of your mp3 files. Developed with RxSwift and RxCocoa. 🎸🎼
Stars: ✭ 17 (-91.83%)
Mutual labels:  reactive, rxswift
Rxgrdb
Reactive extensions for SQLite
Stars: ✭ 176 (-15.38%)
Mutual labels:  reactive, rxswift
SwiftObserver
Elegant Reactive Primitives for Clean Swift Architecture #NoRx
Stars: ✭ 14 (-93.27%)
Mutual labels:  reactive, rxswift
Rxswift
Reactive Programming in Swift
Stars: ✭ 21,163 (+10074.52%)
Mutual labels:  reactive, rxswift
Sensor
A fresh look at iOS development
Stars: ✭ 37 (-82.21%)
Mutual labels:  reactive, rxswift
Rxrealm
RxSwift extension for RealmSwift's types
Stars: ✭ 1,007 (+384.13%)
Mutual labels:  reactive, rxswift
Express Recaptcha
Implementation of google recaptcha v2 & V3 solutions for express.js
Stars: ✭ 104 (-50%)
Mutual labels:  google, recaptcha
Rxiglistkit
IGListKit with RxSwift🚀
Stars: ✭ 174 (-16.35%)
Mutual labels:  reactive, rxswift
Reactorkit
A library for reactive and unidirectional Swift applications
Stars: ✭ 2,237 (+975.48%)
Mutual labels:  reactive, rxswift
Zhuishushenqi
追书神器Swift版客户端(非官方)。 不断更新中......
Stars: ✭ 196 (-5.77%)
Mutual labels:  rxswift

ReCaptcha

Build Status codecov PRs welcome Carthage compatible Version License Platform


Add Google's Invisible ReCaptcha v2 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 2 Example Gif

Warning ⚠️

Beware that this library only works for ReCaptcha v2 Invisible keys! Make sure to check the reCAPTCHA v2 Invisible badge option when creating your API Key.

ReCaptcha v2 invisible key example

You won't be able to use a ReCaptcha v3 key because it requires server-side validation. On v3, all challenges succeed into a token which is then validated in the server for a score. For this reason, a frontend app can't know on its own wether or not a user is valid since the challenge will always result in a valid token.

Installation

ReCaptcha is available through CocoaPods and Carthage. To install it, simply add the following line to your dependencies file:

Cocoapods

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

Carthage

github "fjcaetano/ReCaptcha"

Carthage will create two different frameworks named ReCaptcha and ReCaptcha_RxSwift, the latter containing the RxSwift extension for the ReCaptcha framework.

Usage

The reCAPTCHA keys can be specified as Info.plist keys or can be passed as parameters when instantiating ReCaptcha().

For the Info.plist configuration, add ReCaptchaKey and ReCaptchaDomain (with a protocol ex. http:// or https://) 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: ReCaptchaResult) in
        print(try? result.dematerialize())
    }
}

If instead you prefer to keep the information out of the Info.plist, you can use:

let recaptcha = try? ReCaptcha(
    apiKey: "YOUR_RECAPTCHA_KEY", 
    baseURL: URL(string: "YOUR_RECAPTCHA_DOMAIN")!
)

...

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

recaptcha.rx.validate(on: view)
    .subscribe(onNext: { (token: String) in
        // Do something
    })

Alternte endpoint

If your app has firewall limitations that may be blocking Google's API, the JS endpoint may be changed on initialization. It'll then point to https://www.recaptcha.net/recaptcha/api.js:

public enum Endpoint {
    case default, alternate
}

let recaptcha = try? ReCaptcha(endpoint: .alternate) // Defaults to `default` when unset

Help Wanted

Do you love ReCaptcha and work actively on apps that use it? We'd love if you could help us keep improving it! Feel free to message us or to start contributing right away!

Full Documentation

License

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].