Compare commits
No commits in common. "gh-pages" and "master" have entirely different histories.
|
|
@ -0,0 +1,33 @@
|
|||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
---
|
||||
<!--
|
||||
## Is it really a bug?
|
||||
Before opening an issue, check the following:
|
||||
1. You are using the **SITE** key
|
||||
2. The correct domain, with protocol, is setup.
|
||||
3. You are using an **Invisible** reCAPTCHA v2 key.
|
||||
4. If the widget doesn't appear, that is expected since the library will try to resolve the challenge _invisibly_.
|
||||
|
||||
https://www.google.com/recaptcha/admin#site
|
||||
-->
|
||||
|
||||
## Bug description
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
## To Reproduce
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '...'
|
||||
3. ...
|
||||
4. Profit (jk See error)
|
||||
|
||||
## Expected behavior
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
## Logs
|
||||
Please add as many logs as you feel necessary. Be mindful of your application and remove any sensitive data.
|
||||
|
||||
## Additional context
|
||||
Add any other context about the problem here.
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
# Xcode
|
||||
#
|
||||
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
|
||||
|
||||
## Build generated
|
||||
build/
|
||||
DerivedData
|
||||
logs/
|
||||
ReCaptcha.framework.zip
|
||||
|
||||
## Various settings
|
||||
*.pbxuser
|
||||
!default.pbxuser
|
||||
*.mode1v3
|
||||
!default.mode1v3
|
||||
*.mode2v3
|
||||
!default.mode2v3
|
||||
*.perspectivev3
|
||||
!default.perspectivev3
|
||||
xcuserdata
|
||||
|
||||
## Other
|
||||
*.xccheckout
|
||||
*.moved-aside
|
||||
*.xcuserstate
|
||||
*.orig
|
||||
.bundle
|
||||
vendor
|
||||
|
||||
## Obj-C/Swift specific
|
||||
*.hmap
|
||||
*.ipa
|
||||
|
||||
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion
|
||||
|
||||
*.iml
|
||||
|
||||
## Directory-based project format:
|
||||
.idea/
|
||||
.DS_Store
|
||||
|
||||
## CocoaPods
|
||||
Pods/
|
||||
Carthage/
|
||||
|
||||
docs/
|
||||
|
||||
## Fastlane
|
||||
fastlane/report.xml
|
||||
fastlane/Preview.html
|
||||
fastlane/screenshots
|
||||
fastlane/README.md
|
||||
fastlane/test_output
|
||||
|
||||
## VS Code
|
||||
.vscode
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
[submodule "fastlane/actions/codecov"]
|
||||
path = fastlane/actions/codecov
|
||||
url = https://gist.github.com/04126b3051f6cd6aebe041bb1dfe14e9.git
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
author: Flávio Caetano (@fjcaetano)
|
||||
author_url: https://github.com/fjcaetano
|
||||
github_url: https://github.com/fjcaetano/ReCaptcha
|
||||
|
||||
readme: README.md
|
||||
|
||||
module: ReCaptcha
|
||||
xcodebuild_arguments:
|
||||
- -workspace
|
||||
- Example/ReCaptcha.xcworkspace
|
||||
- -scheme
|
||||
- ReCaptcha-Example
|
||||
- -configuration
|
||||
- Release
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
excluded:
|
||||
- Carthage
|
||||
- Example/Pods
|
||||
- vendor
|
||||
|
||||
disabled_rules:
|
||||
- nesting
|
||||
- opening_brace
|
||||
- statement_position
|
||||
- weak_delegate
|
||||
|
||||
opt_in_rules:
|
||||
# - array_init # is causing a false positive on `.map { !$0 }`
|
||||
- closure_end_indentation
|
||||
- closure_spacing
|
||||
- contains_over_first_not_nil
|
||||
- empty_count
|
||||
- explicit_init
|
||||
- explicit_top_level_acl
|
||||
- extension_access_modifier
|
||||
- fatal_error_message
|
||||
- file_header
|
||||
- first_where
|
||||
- force_unwrapping
|
||||
- implicit_return
|
||||
- let_var_whitespace
|
||||
- literal_expression_end_indentation
|
||||
- multiline_arguments
|
||||
- multiple_closures_with_trailing_closure
|
||||
- operator_usage_whitespace
|
||||
- redundant_nil_coalescing
|
||||
- single_test_class
|
||||
- sorted_imports
|
||||
# - trailing_closure # causing a false positive on `.subscribe(onNext:)`
|
||||
- unneeded_parentheses_in_closure_argument
|
||||
|
||||
vertical_whitespace:
|
||||
max_empty_lines: 2
|
||||
|
||||
file_header:
|
||||
required_pattern: |
|
||||
\/\/
|
||||
\/\/ .*?\.swift
|
||||
\/\/ ReCaptcha
|
||||
\/\/
|
||||
\/\/ Created by .*? on \d{1,2}\/\d{1,2}\/\d{2}\.
|
||||
\/\/ Copyright © 2018 ReCaptcha\. All rights reserved\.
|
||||
\/\/
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
osx_image: xcode10
|
||||
language: objective-c
|
||||
|
||||
cache:
|
||||
cocoapods: true
|
||||
directories:
|
||||
- Carthage
|
||||
|
||||
script:
|
||||
- bundle exec fastlane ci
|
||||
|
||||
deploy:
|
||||
- provider: script
|
||||
script: bundle exec fastlane release
|
||||
skip_cleanup: true
|
||||
on:
|
||||
repo: fjcaetano/ReCaptcha
|
||||
tags: true
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
# 1.4.2
|
||||
|
||||
- Fix: Webview's resource loading detection (#56 #60)
|
||||
|
||||
# 1.4.1
|
||||
|
||||
- Fix RxSwift dependency version (#58)
|
||||
|
||||
# 1.4
|
||||
|
||||
- Feature: Support Swift 4.2
|
||||
- Feature: enable validation to be skipped for testing
|
||||
|
||||
# 1.3.1
|
||||
|
||||
- Fix: Removing leftover print
|
||||
- Fix: Removing Result dependency from Carthage
|
||||
|
||||
# 1.3
|
||||
|
||||
- Feature: Locale support (#39)
|
||||
|
||||
- Fix: Reset not flagging ReCaptha as ready-to-execute (#36)
|
||||
- Fix: Multiple configure calls after app being idle (#40)
|
||||
|
||||
# 1.2
|
||||
|
||||
- Feature: Resettable ReCaptchas. (#23)
|
||||
- Feature: Forcing visible challenge on DEBUG. (#19)
|
||||
|
||||
- Fix: Better encapsulation architecture.
|
||||
- Fix: Retiring Result dependency. (#24)
|
||||
- Fix: `validate` completion closure being called consecutively. (#29)
|
||||
- Fix: `configureWebView` being called multiple times. (#31)
|
||||
|
||||
# 1.1
|
||||
|
||||
- Fix: better logging for when protocol isn't found on
|
||||
- Fix: Alternate endpoint not loading
|
||||
- Fix: Prepends a scheme if `baseURL` doesn't have one
|
||||
|
||||
# 1.0.2
|
||||
|
||||
- Fix: Better detection of resources loading end (#16)
|
||||
|
||||
# 1.0.1
|
||||
|
||||
- Fix: Webview content being dismissed when clicking outside of div frame area (#14)
|
||||
|
||||
# 1.0.0
|
||||
|
||||
- Swift 4 support
|
||||
|
||||
# 0.3.0
|
||||
|
||||
- Carthage support
|
||||
- Refactored framework errors
|
||||
- Alternate endpoint to bypass firewall limitations (#10)
|
||||
- Fix: JS not loaded (#7)
|
||||
- Fix: Wrong Domain retrieving (#6)
|
||||
|
||||
# 0.2.0
|
||||
|
||||
- Removing `presenterView` from ReCaptchaWebViewManager
|
||||
- Adding view to `validate(on:)` parameters
|
||||
|
|
@ -0,0 +1 @@
|
|||
binary "https://raw.github.com/TouchInstinct/CarthageBinaries/master/RxSwift/RxSwift.json"
|
||||
|
|
@ -0,0 +1 @@
|
|||
binary "https://raw.github.com/TouchInstinct/CarthageBinaries/master/RxSwift/RxSwift.json" "4.5.0"
|
||||
111
Classes.html
111
Classes.html
|
|
@ -1,111 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Classes Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="js/jquery.min.js" defer></script>
|
||||
<script src="js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a title="Classes Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="index.html">ReCaptcha Docs</a> (100% documented)</p>
|
||||
<p class="header-right"><a href="https://github.com/fjcaetano/ReCaptcha"><img src="img/gh.png"/>View on GitHub</a></p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="index.html">ReCaptcha Reference</a>
|
||||
<img id="carat" src="img/carat.png" />
|
||||
Classes Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/ReCaptcha.html">ReCaptcha</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/ReCaptcha/Endpoint.html">– Endpoint</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="Enums.html">Enumerations</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="Enums/ReCaptchaError.html">ReCaptchaError</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Enums/ReCaptchaResult.html">ReCaptchaResult</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="Extensions.html">Extensions</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="Extensions/Reactive.html">Reactive</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>Classes</h1>
|
||||
<p>The following classes are available globally.</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptchaAAC"></a>
|
||||
<a name="//apple_ref/swift/Class/ReCaptcha" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptchaAAC">ReCaptcha</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
|
||||
<a href="Classes/ReCaptcha.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">ReCaptcha</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/fjcaetano" target="_blank" rel="external">Flávio Caetano (@fjcaetano)</a>. All rights reserved. (Last updated: 2018-09-28)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
|
|
@ -1,488 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>ReCaptcha Class Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="../js/jquery.min.js" defer></script>
|
||||
<script src="../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a name="//apple_ref/swift/Class/ReCaptcha" class="dashAnchor"></a>
|
||||
<a title="ReCaptcha Class Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../index.html">ReCaptcha Docs</a> (100% documented)</p>
|
||||
<p class="header-right"><a href="https://github.com/fjcaetano/ReCaptcha"><img src="../img/gh.png"/>View on GitHub</a></p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../index.html">ReCaptcha Reference</a>
|
||||
<img id="carat" src="../img/carat.png" />
|
||||
ReCaptcha Class Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ReCaptcha.html">ReCaptcha</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ReCaptcha/Endpoint.html">– Endpoint</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../Enums.html">Enumerations</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Enums/ReCaptchaError.html">ReCaptchaError</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Enums/ReCaptchaResult.html">ReCaptchaResult</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../Extensions.html">Extensions</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Extensions/Reactive.html">Reactive</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>ReCaptcha</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">ReCaptcha</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptchaAAC8EndpointO"></a>
|
||||
<a name="//apple_ref/swift/Enum/Endpoint" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptchaAAC8EndpointO">Endpoint</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The JS API endpoint to be loaded onto the HTML file.</p>
|
||||
|
||||
<a href="../Classes/ReCaptcha/Endpoint.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">Endpoint</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptchaAAC6apiKey7baseURL8endpoint6localeABSSSg_10Foundation0F0VSgAB8EndpointOAH6LocaleVSgtKcfc"></a>
|
||||
<a name="//apple_ref/swift/Method/init(apiKey:baseURL:endpoint:locale:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptchaAAC6apiKey7baseURL8endpoint6localeABSSSg_10Foundation0F0VSgAB8EndpointOAH6LocaleVSgtKcfc">init(apiKey:baseURL:endpoint:locale:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Initializes a ReCaptcha object</p>
|
||||
|
||||
<p>Both <code>apiKey</code> and <code>baseURL</code> may be nil, in which case the lib will look for entries of <code>ReCaptchaKey</code> and
|
||||
<code>ReCaptchaDomain</code>, respectively, in the project’s Info.plist</p>
|
||||
|
||||
<p>A key may be aquired here: <a href="https://www.google.com/recaptcha/admin#list">https://www.google.com/recaptcha/admin#list</a></p>
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
<code><a href="../Enums/ReCaptchaError.html#/s:9ReCaptcha0aB5ErrorO08htmlLoadC0yA2CmF">ReCaptchaError.htmlLoadError</a></code>: if is unable to load the HTML embedded in the bundle.
|
||||
|
||||
</div>
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
<code><a href="../Enums/ReCaptchaError.html#/s:9ReCaptcha0aB5ErrorO14apiKeyNotFoundyA2CmF">ReCaptchaError.apiKeyNotFound</a></code>: if an <code>apiKey</code> is not provided and can’t find one in the project’s
|
||||
Info.plist.
|
||||
|
||||
</div>
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
<code><a href="../Enums/ReCaptchaError.html#/s:9ReCaptcha0aB5ErrorO15baseURLNotFoundyA2CmF">ReCaptchaError.baseURLNotFound</a></code>: if a <code>baseURL</code> is not provided and can’t find one in the project’s
|
||||
Info.plist.
|
||||
|
||||
</div>
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
Rethrows any exceptions thrown by <code>String(contentsOfFile:)</code>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="n">convenience</span> <span class="nf">init</span><span class="p">(</span>
|
||||
<span class="nv">apiKey</span><span class="p">:</span> <span class="kt">String</span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">,</span>
|
||||
<span class="nv">baseURL</span><span class="p">:</span> <span class="kt">URL</span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">,</span>
|
||||
<span class="nv">endpoint</span><span class="p">:</span> <span class="kt"><a href="../Classes/ReCaptcha/Endpoint.html">Endpoint</a></span> <span class="o">=</span> <span class="o">.</span><span class="k">default</span><span class="p">,</span>
|
||||
<span class="nv">locale</span><span class="p">:</span> <span class="kt">Locale</span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span>
|
||||
<span class="p">)</span> <span class="k">throws</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>apiKey</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The API key sent to the ReCaptcha init</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>infoPlistKey</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The API key retrived from the application’s Info.plist</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>baseURL</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The base URL sent to the ReCaptcha init</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>infoPlistURL</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The base URL retrieved from the application’s Info.plist</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>locale</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>A locale value to translate ReCaptcha into a different language</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptchaAAC8validate2on12resetOnError10completionySo6UIViewC_SbyAA0aB6ResultOctF"></a>
|
||||
<a name="//apple_ref/swift/Method/validate(on:resetOnError:completion:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptchaAAC8validate2on12resetOnError10completionySo6UIViewC_SbyAA0aB6ResultOctF">validate(on:resetOnError:completion:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Starts the challenge validation</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">validate</span><span class="p">(</span><span class="n">on</span> <span class="nv">view</span><span class="p">:</span> <span class="kt">UIView</span><span class="p">,</span> <span class="nv">resetOnError</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">true</span><span class="p">,</span> <span class="nv">completion</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">(</span><span class="kt"><a href="../Enums/ReCaptchaResult.html">ReCaptchaResult</a></span><span class="p">)</span> <span class="o">-></span> <span class="kt">Void</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>view</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The view that should present the webview.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>resetOnError</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>If ReCaptcha should be reset if it errors. Defaults to <code>true</code>.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>completion</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>A closure that receives a ReCaptchaResult which may contain a valid result token.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptchaAAC4stopyyF"></a>
|
||||
<a name="//apple_ref/swift/Method/stop()" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptchaAAC4stopyyF">stop()</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Stops the execution of the webview</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">stop</span><span class="p">()</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptchaAAC16configureWebViewyyySo05WKWebE0CcF"></a>
|
||||
<a name="//apple_ref/swift/Method/configureWebView(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptchaAAC16configureWebViewyyySo05WKWebE0CcF">configureWebView(_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Provides a closure to configure the webview for presentation if necessary.</p>
|
||||
|
||||
<p>If presentation is required, the webview will already be a subview of <code>presenterView</code> if one is provided. Otherwise
|
||||
it might need to be added in a view currently visible.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">configureWebView</span><span class="p">(</span><span class="n">_</span> <span class="nv">configure</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">(</span><span class="kt">WKWebView</span><span class="p">)</span> <span class="o">-></span> <span class="kt">Void</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>configure</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>A closure that receives an instance of <code>WKWebView</code> for configuration.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptchaAAC5resetyyF"></a>
|
||||
<a name="//apple_ref/swift/Method/reset()" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptchaAAC5resetyyF">reset()</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Resets the ReCaptcha.</p>
|
||||
|
||||
<p>The reset is achieved by calling <code>grecaptcha.reset()</code> on the JS API.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">reset</span><span class="p">()</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<div class="task-name-container">
|
||||
<a name="/Development"></a>
|
||||
<a name="//apple_ref/swift/Section/Development" class="dashAnchor"></a>
|
||||
<a href="#/Development">
|
||||
<h3 class="section-name">Development</h3>
|
||||
</a>
|
||||
</div>
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptchaAAC21forceVisibleChallengeSbvp"></a>
|
||||
<a name="//apple_ref/swift/Property/forceVisibleChallenge" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptchaAAC21forceVisibleChallengeSbvp">forceVisibleChallenge</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Forces the challenge widget to be explicitly displayed.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">forceVisibleChallenge</span><span class="p">:</span> <span class="kt">Bool</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptchaAAC18shouldSkipForTestsSbvp"></a>
|
||||
<a name="//apple_ref/swift/Property/shouldSkipForTests" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptchaAAC18shouldSkipForTestsSbvp">shouldSkipForTests</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Allows validation stubbing for testing</p>
|
||||
|
||||
<p>When this property is set to <code>true</code>, every call to <code>validate()</code> will immediately be resolved with <code>.token("")</code>.</p>
|
||||
|
||||
<p>Use only when testing your application.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">shouldSkipForTests</span><span class="p">:</span> <span class="kt">Bool</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/fjcaetano" target="_blank" rel="external">Flávio Caetano (@fjcaetano)</a>. All rights reserved. (Last updated: 2018-09-28)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
|
|
@ -1,379 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Config Structure Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="../../js/jquery.min.js" defer></script>
|
||||
<script src="../../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a name="//apple_ref/swift/Struct/Config" class="dashAnchor"></a>
|
||||
<a title="Config Structure Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../../index.html">ReCaptcha Docs</a> (87% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../../index.html">ReCaptcha Reference</a>
|
||||
<img id="carat" src="../../img/carat.png" />
|
||||
Config Structure Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="../../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptcha.html">ReCaptcha</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptcha/Constants.html">– Constants</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptcha/Endpoint.html">– Endpoint</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptcha/Config.html">– Config</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptchaDecoder.html">ReCaptchaDecoder</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptchaDecoder/Result.html">– Result</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptchaWebViewManager.html">ReCaptchaWebViewManager</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptchaWebViewManager/WebViewDelegate.html">– WebViewDelegate</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptchaWebViewManager/Constants.html">– Constants</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../../Enums.html">Enumerations</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Enums/ReCaptchaError.html">ReCaptchaError</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../../Extensions.html">Extensions</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Extensions/DispatchQueue.html">DispatchQueue</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Extensions/Reactive.html">Reactive</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Extensions/String.html">String</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>Config</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">struct</span> <span class="kt">Config</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p>Internal data model for CI in unit tests</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptchaAAC6ConfigV4htmlSSv"></a>
|
||||
<a name="//apple_ref/swift/Property/html" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptchaAAC6ConfigV4htmlSSv">html</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The raw unformated HTML file content</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">let</span> <span class="nv">html</span><span class="p">:</span> <span class="kt">String</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptchaAAC6ConfigV6apiKeySSv"></a>
|
||||
<a name="//apple_ref/swift/Property/apiKey" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptchaAAC6ConfigV6apiKeySSv">apiKey</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The API key that will be sent to the ReCaptcha API</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">let</span> <span class="nv">apiKey</span><span class="p">:</span> <span class="kt">String</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptchaAAC6ConfigV7baseURL10Foundation0E0Vv"></a>
|
||||
<a name="//apple_ref/swift/Property/baseURL" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptchaAAC6ConfigV7baseURL10Foundation0E0Vv">baseURL</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The base url to be used to resolve relative URLs in the webview</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">let</span> <span class="nv">baseURL</span><span class="p">:</span> <span class="kt">URL</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptchaAAC6ConfigV6bundle33_D88FD3D3A2EDF5CB44B90FDF7C150474LLSo6BundleCvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/bundle" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptchaAAC6ConfigV6bundle33_D88FD3D3A2EDF5CB44B90FDF7C150474LLSo6BundleCvZ">bundle</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The Bundle that holds ReCaptcha’s assets</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">private</span> <span class="kd">static</span> <span class="k">let</span> <span class="nv">bundle</span><span class="p">:</span> <span class="kt">Bundle</span> <span class="o">=</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptchaAAC6ConfigVADSSSg6apiKey_AE09infoPlistE010Foundation3URLVSg04baseI0AK0fgI0tKcfc"></a>
|
||||
<a name="//apple_ref/swift/Method/init(apiKey:infoPlistKey:baseURL:infoPlistURL:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptchaAAC6ConfigVADSSSg6apiKey_AE09infoPlistE010Foundation3URLVSg04baseI0AK0fgI0tKcfc">init(apiKey:infoPlistKey:baseURL:infoPlistURL:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
<p><code><a href="../../Enums/ReCaptchaError.html#/s:9ReCaptcha0aB5ErrorO08htmlLoadC0A2CmF">ReCaptchaError.htmlLoadError</a></code>: if is unable to load the HTML embedded in the bundle.</p>
|
||||
|
||||
</div>
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
<p><code><a href="../../Enums/ReCaptchaError.html#/s:9ReCaptcha0aB5ErrorO14apiKeyNotFoundA2CmF">ReCaptchaError.apiKeyNotFound</a></code>: if an <code><a href="../../Classes/ReCaptcha/Config.html#/s:9ReCaptchaAAC6ConfigV6apiKeySSv">apiKey</a></code> is not provided and can’t find one in the project’s
|
||||
Info.plist.</p>
|
||||
|
||||
</div>
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
<p><code><a href="../../Enums/ReCaptchaError.html#/s:9ReCaptcha0aB5ErrorO15baseURLNotFoundA2CmF">ReCaptchaError.baseURLNotFound</a></code>: if a <code><a href="../../Classes/ReCaptcha/Config.html#/s:9ReCaptchaAAC6ConfigV7baseURL10Foundation0E0Vv">baseURL</a></code> is not provided and can’t find one in the project’s
|
||||
Info.plist.</p>
|
||||
|
||||
</div>
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
<p>Rethrows any exceptions thrown by <code>String(contentsOfFile:)</code></p>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">apiKey</span><span class="p">:</span> <span class="kt">String</span><span class="p">?,</span> <span class="nv">infoPlistKey</span><span class="p">:</span> <span class="kt">String</span><span class="p">?,</span> <span class="nv">baseURL</span><span class="p">:</span> <span class="kt">URL</span><span class="p">?,</span> <span class="nv">infoPlistURL</span><span class="p">:</span> <span class="kt">URL</span><span class="p">?)</span> <span class="k">throws</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>apiKey</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The API key sent to the ReCaptcha init</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>infoPlistKey</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The API key retrived from the application’s Info.plist</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>baseURL</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The base URL sent to the ReCaptcha init</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>infoPlistURL</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The base URL retrieved from the application’s Info.plist</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptchaAAC6ConfigV17fixSchemeIfNeeded33_D88FD3D3A2EDF5CB44B90FDF7C150474LL10Foundation3URLVAI3for_tFZ"></a>
|
||||
<a name="//apple_ref/swift/Method/fixSchemeIfNeeded(for:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptchaAAC6ConfigV17fixSchemeIfNeeded33_D88FD3D3A2EDF5CB44B90FDF7C150474LL10Foundation3URLVAI3for_tFZ">fixSchemeIfNeeded(for:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>If the given URL has no scheme, prepends <code>http://</code> to it and return the fixed URL.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">static</span> <span class="kd">func</span> <span class="nf">fixSchemeIfNeeded</span><span class="p">(</span><span class="k">for</span> <span class="nv">url</span><span class="p">:</span> <span class="kt">URL</span><span class="p">)</span> <span class="o">-></span> <span class="kt">URL</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>url</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The URL to be fixed</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>An URL with scheme</p>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/fjcaetano/ReCaptcha" target="_blank" rel="external">Flávio Caetano</a>. All rights reserved. (Last updated: 2018-03-06)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
|
|
@ -1,128 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Constants Structure Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="../../js/jquery.min.js" defer></script>
|
||||
<script src="../../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a name="//apple_ref/swift/Struct/Constants" class="dashAnchor"></a>
|
||||
<a title="Constants Structure Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../../index.html">ReCaptcha Docs</a> (87% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../../index.html">ReCaptcha Reference</a>
|
||||
<img id="carat" src="../../img/carat.png" />
|
||||
Constants Structure Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="../../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptcha.html">ReCaptcha</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptcha/Constants.html">– Constants</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptcha/Endpoint.html">– Endpoint</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptcha/Config.html">– Config</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptchaDecoder.html">ReCaptchaDecoder</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptchaDecoder/Result.html">– Result</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptchaWebViewManager.html">ReCaptchaWebViewManager</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptchaWebViewManager/WebViewDelegate.html">– WebViewDelegate</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptchaWebViewManager/Constants.html">– Constants</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../../Enums.html">Enumerations</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Enums/ReCaptchaError.html">ReCaptchaError</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../../Extensions.html">Extensions</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Extensions/DispatchQueue.html">DispatchQueue</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Extensions/Reactive.html">Reactive</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Extensions/String.html">String</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>Constants</h1>
|
||||
<p>Undocumented</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptchaAAC9Constants33_D88FD3D3A2EDF5CB44B90FDF7C150474LLV12InfoDictKeysV"></a>
|
||||
<a name="//apple_ref/swift/Struct/InfoDictKeys" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptchaAAC9Constants33_D88FD3D3A2EDF5CB44B90FDF7C150474LLV12InfoDictKeysV">InfoDictKeys</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Undocumented</p>
|
||||
|
||||
<a href="../../Classes/ReCaptcha/Constants/InfoDictKeys.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/fjcaetano/ReCaptcha" target="_blank" rel="external">Flávio Caetano</a>. All rights reserved. (Last updated: 2018-03-06)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
|
|
@ -1,146 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>InfoDictKeys Structure Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../../css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="../../../js/jquery.min.js" defer></script>
|
||||
<script src="../../../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a name="//apple_ref/swift/Struct/InfoDictKeys" class="dashAnchor"></a>
|
||||
<a title="InfoDictKeys Structure Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../../../index.html">ReCaptcha Docs</a> (87% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../../../index.html">ReCaptcha Reference</a>
|
||||
<img id="carat" src="../../../img/carat.png" />
|
||||
InfoDictKeys Structure Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="../../../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../../../Classes/ReCaptcha.html">ReCaptcha</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../../Classes/ReCaptcha/Constants.html">– Constants</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../../Classes/ReCaptcha/Endpoint.html">– Endpoint</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../../Classes/ReCaptcha/Config.html">– Config</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../../Classes/ReCaptchaDecoder.html">ReCaptchaDecoder</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../../Classes/ReCaptchaDecoder/Result.html">– Result</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../../Classes/ReCaptchaWebViewManager.html">ReCaptchaWebViewManager</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../../Classes/ReCaptchaWebViewManager/WebViewDelegate.html">– WebViewDelegate</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../../Classes/ReCaptchaWebViewManager/Constants.html">– Constants</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../../../Enums.html">Enumerations</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../../../Enums/ReCaptchaError.html">ReCaptchaError</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../../../Extensions.html">Extensions</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../../../Extensions/DispatchQueue.html">DispatchQueue</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../../Extensions/Reactive.html">Reactive</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../../Extensions/String.html">String</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>InfoDictKeys</h1>
|
||||
<p>Undocumented</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptchaAAC9Constants33_D88FD3D3A2EDF5CB44B90FDF7C150474LLV12InfoDictKeysV6APIKeySSvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/APIKey" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptchaAAC9Constants33_D88FD3D3A2EDF5CB44B90FDF7C150474LLV12InfoDictKeysV6APIKeySSvZ">APIKey</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Undocumented</p>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptchaAAC9Constants33_D88FD3D3A2EDF5CB44B90FDF7C150474LLV12InfoDictKeysV6DomainSSvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/Domain" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptchaAAC9Constants33_D88FD3D3A2EDF5CB44B90FDF7C150474LLV12InfoDictKeysV6DomainSSvZ">Domain</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Undocumented</p>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/fjcaetano/ReCaptcha" target="_blank" rel="external">Flávio Caetano</a>. All rights reserved. (Last updated: 2018-03-06)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
|
|
@ -1,150 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Endpoint Enumeration Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="../../js/jquery.min.js" defer></script>
|
||||
<script src="../../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a name="//apple_ref/swift/Enum/Endpoint" class="dashAnchor"></a>
|
||||
<a title="Endpoint Enumeration Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../../index.html">ReCaptcha Docs</a> (100% documented)</p>
|
||||
<p class="header-right"><a href="https://github.com/fjcaetano/ReCaptcha"><img src="../../img/gh.png"/>View on GitHub</a></p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../../index.html">ReCaptcha Reference</a>
|
||||
<img id="carat" src="../../img/carat.png" />
|
||||
Endpoint Enumeration Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="../../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptcha.html">ReCaptcha</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptcha/Endpoint.html">– Endpoint</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../../Enums.html">Enumerations</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Enums/ReCaptchaError.html">ReCaptchaError</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Enums/ReCaptchaResult.html">ReCaptchaResult</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../../Extensions.html">Extensions</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Extensions/Reactive.html">Reactive</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>Endpoint</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">Endpoint</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p>The JS API endpoint to be loaded onto the HTML file.</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptchaAAC8EndpointO7defaultyA2DmF"></a>
|
||||
<a name="//apple_ref/swift/Element/default" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptchaAAC8EndpointO7defaultyA2DmF">default</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Google’s default endpoint. Points to
|
||||
<a href="https://www.google.com/recaptcha/api.js">https://www.google.com/recaptcha/api.js</a></p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="err">`</span><span class="k">default</span><span class="err">`</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptchaAAC8EndpointO9alternateyA2DmF"></a>
|
||||
<a name="//apple_ref/swift/Element/alternate" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptchaAAC8EndpointO9alternateyA2DmF">alternate</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Alternate endpoint. Points to <a href="https://www.recaptcha.net/recaptcha/api.js">https://www.recaptcha.net/recaptcha/api.js</a></p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="n">alternate</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/fjcaetano" target="_blank" rel="external">Flávio Caetano (@fjcaetano)</a>. All rights reserved. (Last updated: 2018-09-28)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
|
|
@ -1,292 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>ReCaptchaDecoder Class Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="../js/jquery.min.js" defer></script>
|
||||
<script src="../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a name="//apple_ref/swift/Class/ReCaptchaDecoder" class="dashAnchor"></a>
|
||||
<a title="ReCaptchaDecoder Class Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../index.html">ReCaptcha Docs</a> (87% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../index.html">ReCaptcha Reference</a>
|
||||
<img id="carat" src="../img/carat.png" />
|
||||
ReCaptchaDecoder Class Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ReCaptcha.html">ReCaptcha</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ReCaptcha/Constants.html">– Constants</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ReCaptcha/Endpoint.html">– Endpoint</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ReCaptcha/Config.html">– Config</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ReCaptchaDecoder.html">ReCaptchaDecoder</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ReCaptchaDecoder/Result.html">– Result</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ReCaptchaWebViewManager.html">ReCaptchaWebViewManager</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ReCaptchaWebViewManager/WebViewDelegate.html">– WebViewDelegate</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ReCaptchaWebViewManager/Constants.html">– Constants</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../Enums.html">Enumerations</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Enums/ReCaptchaError.html">ReCaptchaError</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../Extensions.html">Extensions</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Extensions/DispatchQueue.html">DispatchQueue</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Extensions/Reactive.html">Reactive</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Extensions/String.html">String</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>ReCaptchaDecoder</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">internal</span> <span class="kd">class</span> <span class="kt">ReCaptchaDecoder</span><span class="p">:</span> <span class="kt">NSObject</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p>The Decoder of javascript messages from the webview</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB7DecoderC6ResultO"></a>
|
||||
<a name="//apple_ref/swift/Enum/Result" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB7DecoderC6ResultO">Result</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The decoder result.</p>
|
||||
|
||||
<a href="../Classes/ReCaptchaDecoder/Result.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">enum</span> <span class="kt">Result</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB7DecoderC11sendMessage33_BFC5AA2DAB5901AE176B9DCF91FD1820LLyAC6ResultOcv"></a>
|
||||
<a name="//apple_ref/swift/Property/sendMessage" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB7DecoderC11sendMessage33_BFC5AA2DAB5901AE176B9DCF91FD1820LLyAC6ResultOcv">sendMessage</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The closure that receives messages</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="n">fileprivate</span> <span class="k">let</span> <span class="nv">sendMessage</span><span class="p">:</span> <span class="p">((</span><span class="kt"><a href="../Classes/ReCaptchaDecoder/Result.html">Result</a></span><span class="p">)</span> <span class="o">-></span> <span class="kt">Void</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB7DecoderCACyAC6ResultOc17didReceiveMessage_tcfc"></a>
|
||||
<a name="//apple_ref/swift/Method/init(didReceiveMessage:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB7DecoderCACyAC6ResultOc17didReceiveMessage_tcfc">init(didReceiveMessage:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Initializes a decoder with a completion closure.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="nf">init</span><span class="p">(</span><span class="nv">didReceiveMessage</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">(</span><span class="kt"><a href="../Classes/ReCaptchaDecoder/Result.html">Result</a></span><span class="p">)</span> <span class="o">-></span> <span class="kt">Void</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>didReceiveMessage</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>A closure that receives a ReCaptchaDecoder.Result</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB7DecoderC4sendyAA0aB5ErrorO5error_tF"></a>
|
||||
<a name="//apple_ref/swift/Method/send(error:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB7DecoderC4sendyAA0aB5ErrorO5error_tF">send(error:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Sends an error to the completion closure</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">func</span> <span class="nf">send</span><span class="p">(</span><span class="nv">error</span><span class="p">:</span> <span class="kt"><a href="../Enums/ReCaptchaError.html">ReCaptchaError</a></span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>error</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The error to be sent.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/c:@CM@ReCaptcha@objc(cs)ReCaptchaDecoder(im)userContentController:didReceiveScriptMessage:"></a>
|
||||
<a name="//apple_ref/swift/Method/userContentController(_:didReceive:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/c:@CM@ReCaptcha@objc(cs)ReCaptchaDecoder(im)userContentController:didReceiveScriptMessage:">userContentController(_:didReceive:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Undocumented</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">internal</span> <span class="kd">class</span> <span class="kt">ReCaptchaDecoder</span><span class="p">:</span> <span class="kt">NSObject</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/fjcaetano/ReCaptcha" target="_blank" rel="external">Flávio Caetano</a>. All rights reserved. (Last updated: 2018-03-06)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
|
|
@ -1,319 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Result Enumeration Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="../../js/jquery.min.js" defer></script>
|
||||
<script src="../../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a name="//apple_ref/swift/Enum/Result" class="dashAnchor"></a>
|
||||
<a title="Result Enumeration Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../../index.html">ReCaptcha Docs</a> (87% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../../index.html">ReCaptcha Reference</a>
|
||||
<img id="carat" src="../../img/carat.png" />
|
||||
Result Enumeration Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="../../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptcha.html">ReCaptcha</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptcha/Constants.html">– Constants</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptcha/Endpoint.html">– Endpoint</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptcha/Config.html">– Config</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptchaDecoder.html">ReCaptchaDecoder</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptchaDecoder/Result.html">– Result</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptchaWebViewManager.html">ReCaptchaWebViewManager</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptchaWebViewManager/WebViewDelegate.html">– WebViewDelegate</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptchaWebViewManager/Constants.html">– Constants</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../../Enums.html">Enumerations</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Enums/ReCaptchaError.html">ReCaptchaError</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../../Extensions.html">Extensions</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Extensions/DispatchQueue.html">DispatchQueue</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Extensions/Reactive.html">Reactive</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Extensions/String.html">String</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>Result</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">enum</span> <span class="kt">Result</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p>The decoder result.</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB7DecoderC6ResultO5tokenAESScAEmF"></a>
|
||||
<a name="//apple_ref/swift/Element/token" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB7DecoderC6ResultO5tokenAESScAEmF">token</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>A result token, if any</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="nf">token</span><span class="p">(</span><span class="kt">String</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB7DecoderC6ResultO04showaB0A2EmF"></a>
|
||||
<a name="//apple_ref/swift/Element/showReCaptcha" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB7DecoderC6ResultO04showaB0A2EmF">showReCaptcha</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Indicates that the webview containing the challenge should be displayed.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="n">showReCaptcha</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB7DecoderC6ResultO5errorAeA0aB5ErrorOcAEmF"></a>
|
||||
<a name="//apple_ref/swift/Element/error" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB7DecoderC6ResultO5errorAeA0aB5ErrorOcAEmF">error</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Any errors</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="nf">error</span><span class="p">(</span><span class="kt"><a href="../../Enums/ReCaptchaError.html">ReCaptchaError</a></span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB7DecoderC6ResultO7didLoadA2EmF"></a>
|
||||
<a name="//apple_ref/swift/Element/didLoad" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB7DecoderC6ResultO7didLoadA2EmF">didLoad</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Did finish loading resources</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="n">didLoad</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB7DecoderC6ResultO3logAESScAEmF"></a>
|
||||
<a name="//apple_ref/swift/Element/log" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB7DecoderC6ResultO3logAESScAEmF">log</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Logs a string onto the console</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="nf">log</span><span class="p">(</span><span class="kt">String</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB7DecoderC6ResultO4from33_BFC5AA2DAB5901AE176B9DCF91FD1820LLAEs10DictionaryVySSypG8response_tFZ"></a>
|
||||
<a name="//apple_ref/swift/Method/from(response:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB7DecoderC6ResultO4from33_BFC5AA2DAB5901AE176B9DCF91FD1820LLAEs10DictionaryVySSypG8response_tFZ">from(response:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Parses a dict received from the webview onto a <code>ReCaptchaDecoder.Result</code></p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">static</span> <span class="kd">func</span> <span class="nf">from</span><span class="p">(</span><span class="nv">response</span><span class="p">:</span> <span class="p">[</span><span class="kt">String</span><span class="p">:</span> <span class="kt">Any</span><span class="p">])</span> <span class="o">-></span> <span class="kt"><a href="../../Classes/ReCaptchaDecoder.html">ReCaptchaDecoder</a></span><span class="o">.</span><span class="kt">Result</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>response</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>A dictionary containing the message to be parsed</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>A decoded ReCaptchaDecoder.Result</p>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/fjcaetano/ReCaptcha" target="_blank" rel="external">Flávio Caetano</a>. All rights reserved. (Last updated: 2018-03-06)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
|
|
@ -1,268 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>ReCaptchaWebViewManager Class Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="../js/jquery.min.js" defer></script>
|
||||
<script src="../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a name="//apple_ref/swift/Class/ReCaptchaWebViewManager" class="dashAnchor"></a>
|
||||
<a title="ReCaptchaWebViewManager Class Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../index.html">ReCaptcha Docs</a> (100% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../index.html">ReCaptcha Reference</a>
|
||||
<img id="carat" src="../img/carat.png" />
|
||||
ReCaptchaWebViewManager Class Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ReCaptcha.html">ReCaptcha</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ReCaptcha/Endpoint.html">– Endpoint</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ReCaptchaWebViewManager.html">ReCaptchaWebViewManager</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../Enums.html">Enumerations</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Enums/ReCaptchaError.html">ReCaptchaError</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Enums/ReCaptchaResult.html">ReCaptchaResult</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../Extensions.html">Extensions</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Extensions/Reactive.html">Reactive</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>ReCaptchaWebViewManager</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="n">open</span> <span class="kd">class</span> <span class="kt">ReCaptchaWebViewManager</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p>Handles comunications with the webview containing the ReCaptcha challenge.</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB14WebViewManagerC8validateySo6UIViewC2on_Sb12resetOnErroryAA0aB6ResultOc10completiontF"></a>
|
||||
<a name="//apple_ref/swift/Method/validate(on:resetOnError:completion:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB14WebViewManagerC8validateySo6UIViewC2on_Sb12resetOnErroryAA0aB6ResultOc10completiontF">validate(on:resetOnError:completion:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Starts the challenge validation</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="n">open</span> <span class="kd">func</span> <span class="nf">validate</span><span class="p">(</span><span class="n">on</span> <span class="nv">view</span><span class="p">:</span> <span class="kt">UIView</span><span class="p">,</span> <span class="nv">resetOnError</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">true</span><span class="p">,</span> <span class="nv">completion</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">(</span><span class="kt"><a href="../Enums/ReCaptchaResult.html">ReCaptchaResult</a></span><span class="p">)</span> <span class="o">-></span> <span class="kt">Void</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>view</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The view that should present the webview.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>resetOnError</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>If ReCaptcha should be reset if it errors. Defaults to <code>true</code>.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>completion</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>A closure that receives a ReCaptchaResult which may contain a valid result token.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB14WebViewManagerC4stopyyF"></a>
|
||||
<a name="//apple_ref/swift/Method/stop()" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB14WebViewManagerC4stopyyF">stop()</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Stops the execution of the webview</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="n">open</span> <span class="kd">func</span> <span class="nf">stop</span><span class="p">()</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB14WebViewManagerC09configurecD0yySo05WKWebD0CcF"></a>
|
||||
<a name="//apple_ref/swift/Method/configureWebView(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB14WebViewManagerC09configurecD0yySo05WKWebD0CcF">configureWebView(_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Provides a closure to configure the webview for presentation if necessary.</p>
|
||||
|
||||
<p>If presentation is required, the webview will already be a subview of <code>presenterView</code> if one is provided. Otherwise
|
||||
it might need to be added in a view currently visible.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="n">open</span> <span class="kd">func</span> <span class="nf">configureWebView</span><span class="p">(</span><span class="n">_</span> <span class="nv">configure</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">(</span><span class="kt">WKWebView</span><span class="p">)</span> <span class="o">-></span> <span class="kt">Void</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>configure</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>A closure that receives an instance of <code>WKWebView</code> for configuration.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB14WebViewManagerC5resetyyF"></a>
|
||||
<a name="//apple_ref/swift/Method/reset()" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB14WebViewManagerC5resetyyF">reset()</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Resets the ReCaptcha.</p>
|
||||
|
||||
<p>The reset is achieved by calling <code>grecaptcha.reset()</code> on the JS API.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="n">open</span> <span class="kd">func</span> <span class="nf">reset</span><span class="p">()</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/fjcaetano/ReCaptcha" target="_blank" rel="external">Flávio Caetano</a>. All rights reserved. (Last updated: 2018-03-06)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
|
|
@ -1,146 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Constants Structure Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="../../js/jquery.min.js" defer></script>
|
||||
<script src="../../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a name="//apple_ref/swift/Struct/Constants" class="dashAnchor"></a>
|
||||
<a title="Constants Structure Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../../index.html">ReCaptcha Docs</a> (87% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../../index.html">ReCaptcha Reference</a>
|
||||
<img id="carat" src="../../img/carat.png" />
|
||||
Constants Structure Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="../../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptcha.html">ReCaptcha</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptcha/Constants.html">– Constants</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptcha/Endpoint.html">– Endpoint</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptcha/Config.html">– Config</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptchaDecoder.html">ReCaptchaDecoder</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptchaDecoder/Result.html">– Result</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptchaWebViewManager.html">ReCaptchaWebViewManager</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptchaWebViewManager/WebViewDelegate.html">– WebViewDelegate</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptchaWebViewManager/Constants.html">– Constants</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../../Enums.html">Enumerations</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Enums/ReCaptchaError.html">ReCaptchaError</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../../Extensions.html">Extensions</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Extensions/DispatchQueue.html">DispatchQueue</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Extensions/Reactive.html">Reactive</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Extensions/String.html">String</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>Constants</h1>
|
||||
<p>Undocumented</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB14WebViewManagerC9Constants33_C3529EC2362FD51A816C2A521FEB1AA9LLV16ExecuteJSCommandSSvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/ExecuteJSCommand" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB14WebViewManagerC9Constants33_C3529EC2362FD51A816C2A521FEB1AA9LLV16ExecuteJSCommandSSvZ">ExecuteJSCommand</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Undocumented</p>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB14WebViewManagerC9Constants33_C3529EC2362FD51A816C2A521FEB1AA9LLV12ResetCommandSSvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/ResetCommand" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB14WebViewManagerC9Constants33_C3529EC2362FD51A816C2A521FEB1AA9LLV12ResetCommandSSvZ">ResetCommand</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Undocumented</p>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/fjcaetano/ReCaptcha" target="_blank" rel="external">Flávio Caetano</a>. All rights reserved. (Last updated: 2018-03-06)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
|
|
@ -1,417 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>WebViewDelegate Class Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="../../js/jquery.min.js" defer></script>
|
||||
<script src="../../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a name="//apple_ref/swift/Class/WebViewDelegate" class="dashAnchor"></a>
|
||||
<a title="WebViewDelegate Class Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../../index.html">ReCaptcha Docs</a> (87% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../../index.html">ReCaptcha Reference</a>
|
||||
<img id="carat" src="../../img/carat.png" />
|
||||
WebViewDelegate Class Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="../../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptcha.html">ReCaptcha</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptcha/Constants.html">– Constants</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptcha/Endpoint.html">– Endpoint</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptcha/Config.html">– Config</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptchaDecoder.html">ReCaptchaDecoder</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptchaDecoder/Result.html">– Result</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptchaWebViewManager.html">ReCaptchaWebViewManager</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptchaWebViewManager/WebViewDelegate.html">– WebViewDelegate</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptchaWebViewManager/Constants.html">– Constants</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../../Enums.html">Enumerations</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Enums/ReCaptchaError.html">ReCaptchaError</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../../Extensions.html">Extensions</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Extensions/DispatchQueue.html">DispatchQueue</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Extensions/Reactive.html">Reactive</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Extensions/String.html">String</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>WebViewDelegate</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="n">fileprivate</span> <span class="kd">class</span> <span class="kt">WebViewDelegate</span><span class="p">:</span> <span class="kt">NSObject</span><span class="p">,</span> <span class="kt">WKNavigationDelegate</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p>The <code><a href="../../Classes/ReCaptchaWebViewManager.html#/s:9ReCaptcha0aB14WebViewManagerC03webD033_C3529EC2362FD51A816C2A521FEB1AA9LLSo05WKWebD0Cv">webView</a></code> delegate object that performs execution uppon script loading</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB14WebViewManagerC0cD8Delegate33_C3529EC2362FD51A816C2A521FEB1AA9LLC9ConstantsV"></a>
|
||||
<a name="//apple_ref/swift/Struct/Constants" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB14WebViewManagerC0cD8Delegate33_C3529EC2362FD51A816C2A521FEB1AA9LLC9ConstantsV">Constants</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Undocumented</p>
|
||||
|
||||
<a href="../../Classes/ReCaptchaWebViewManager/WebViewDelegate/Constants.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="n">fileprivate</span> <span class="kd">class</span> <span class="kt">WebViewDelegate</span><span class="p">:</span> <span class="kt">NSObject</span><span class="p">,</span> <span class="kt">WKNavigationDelegate</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB14WebViewManagerC0cD8Delegate33_C3529EC2362FD51A816C2A521FEB1AA9LLC7managerACSgXwv"></a>
|
||||
<a name="//apple_ref/swift/Property/manager" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB14WebViewManagerC0cD8Delegate33_C3529EC2362FD51A816C2A521FEB1AA9LLC7managerACSgXwv">manager</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The parent manager</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">private</span> <span class="k">weak</span> <span class="k">var</span> <span class="nv">manager</span><span class="p">:</span> <span class="kt"><a href="../../Classes/ReCaptchaWebViewManager.html">ReCaptchaWebViewManager</a></span><span class="p">?</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB14WebViewManagerC0cD8Delegate33_C3529EC2362FD51A816C2A521FEB1AA9LLC14activeRequestss3SetVySSGv"></a>
|
||||
<a name="//apple_ref/swift/Property/activeRequests" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB14WebViewManagerC0cD8Delegate33_C3529EC2362FD51A816C2A521FEB1AA9LLC14activeRequestss3SetVySSGv">activeRequests</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The active requests’ urls</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">private</span> <span class="k">var</span> <span class="nv">activeRequests</span> <span class="o">=</span> <span class="kt">Set</span><span class="o"><</span><span class="kt">String</span><span class="o">></span><span class="p">(</span><span class="nv">minimumCapacity</span><span class="p">:</span> <span class="mi">0</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB14WebViewManagerC0cD8Delegate33_C3529EC2362FD51A816C2A521FEB1AA9LLCAfC7manager_tcfc"></a>
|
||||
<a name="//apple_ref/swift/Method/init(manager:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB14WebViewManagerC0cD8Delegate33_C3529EC2362FD51A816C2A521FEB1AA9LLCAfC7manager_tcfc">init(manager:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="nf">init</span><span class="p">(</span><span class="nv">manager</span><span class="p">:</span> <span class="kt"><a href="../../Classes/ReCaptchaWebViewManager.html">ReCaptchaWebViewManager</a></span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>manager</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The parent manager</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB14WebViewManagerC0cD8Delegate33_C3529EC2362FD51A816C2A521FEB1AA9LLC03webD0ySo05WKWebD0C_So18WKNavigationActionC15decidePolicyForySC0qrT0Oc15decisionHandlertF"></a>
|
||||
<a name="//apple_ref/swift/Method/webView(_:decidePolicyFor:decisionHandler:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB14WebViewManagerC0cD8Delegate33_C3529EC2362FD51A816C2A521FEB1AA9LLC03webD0ySo05WKWebD0C_So18WKNavigationActionC15decidePolicyForySC0qrT0Oc15decisionHandlertF">webView(_:decidePolicyFor:decisionHandler:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Decides whether to allow or cancel a navigation.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">func</span> <span class="nf">webView</span><span class="p">(</span>
|
||||
<span class="n">_</span> <span class="nv">webView</span><span class="p">:</span> <span class="kt">WKWebView</span><span class="p">,</span>
|
||||
<span class="n">decidePolicyFor</span> <span class="nv">navigationAction</span><span class="p">:</span> <span class="kt">WKNavigationAction</span><span class="p">,</span>
|
||||
<span class="nv">decisionHandler</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">(</span><span class="kt">WKNavigationActionPolicy</span>
|
||||
<span class="p">)</span> <span class="o">-></span> <span class="kt">Void</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>webView</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The web view invoking the delegate method.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>navigationAction</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>Descriptive information about the action triggering the navigation request.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>decisionHandler</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The decision handler to call to allow or cancel the navigation. The argument is one of
|
||||
the constants of the enumerated type WKNavigationActionPolicy.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB14WebViewManagerC0cD8Delegate33_C3529EC2362FD51A816C2A521FEB1AA9LLC03webD0ySo05WKWebD0C_So20WKNavigationResponseC15decidePolicyForySC0qrT0Oc15decisionHandlertF"></a>
|
||||
<a name="//apple_ref/swift/Method/webView(_:decidePolicyFor:decisionHandler:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB14WebViewManagerC0cD8Delegate33_C3529EC2362FD51A816C2A521FEB1AA9LLC03webD0ySo05WKWebD0C_So20WKNavigationResponseC15decidePolicyForySC0qrT0Oc15decisionHandlertF">webView(_:decidePolicyFor:decisionHandler:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Decides whether to allow or cancel a navigation after its response is known.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">func</span> <span class="nf">webView</span><span class="p">(</span>
|
||||
<span class="n">_</span> <span class="nv">webView</span><span class="p">:</span> <span class="kt">WKWebView</span><span class="p">,</span>
|
||||
<span class="n">decidePolicyFor</span> <span class="nv">navigationResponse</span><span class="p">:</span> <span class="kt">WKNavigationResponse</span><span class="p">,</span>
|
||||
<span class="nv">decisionHandler</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">(</span><span class="kt">WKNavigationResponsePolicy</span><span class="p">)</span> <span class="o">-></span> <span class="kt">Void</span>
|
||||
<span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>webView</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The web view invoking the delegate method.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>navigationResponse</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>Descriptive information about the navigation response.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>decisionHandler</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>A block to be called when your app has decided whether to allow or cancel the navigation</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB14WebViewManagerC0cD8Delegate33_C3529EC2362FD51A816C2A521FEB1AA9LLC7executeyyF"></a>
|
||||
<a name="//apple_ref/swift/Method/execute()" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB14WebViewManagerC0cD8Delegate33_C3529EC2362FD51A816C2A521FEB1AA9LLC7executeyyF">execute()</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Flag the requests as finished and call ReCaptcha execution if necessary</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">func</span> <span class="nf">execute</span><span class="p">()</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/fjcaetano/ReCaptcha" target="_blank" rel="external">Flávio Caetano</a>. All rights reserved. (Last updated: 2018-03-06)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
|
|
@ -1,135 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Constants Structure Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../../css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="../../../js/jquery.min.js" defer></script>
|
||||
<script src="../../../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a name="//apple_ref/swift/Struct/Constants" class="dashAnchor"></a>
|
||||
<a title="Constants Structure Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../../../index.html">ReCaptcha Docs</a> (87% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../../../index.html">ReCaptcha Reference</a>
|
||||
<img id="carat" src="../../../img/carat.png" />
|
||||
Constants Structure Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="../../../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../../../Classes/ReCaptcha.html">ReCaptcha</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../../Classes/ReCaptcha/Constants.html">– Constants</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../../Classes/ReCaptcha/Endpoint.html">– Endpoint</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../../Classes/ReCaptcha/Config.html">– Config</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../../Classes/ReCaptchaDecoder.html">ReCaptchaDecoder</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../../Classes/ReCaptchaDecoder/Result.html">– Result</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../../Classes/ReCaptchaWebViewManager.html">ReCaptchaWebViewManager</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../../Classes/ReCaptchaWebViewManager/WebViewDelegate.html">– WebViewDelegate</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../../Classes/ReCaptchaWebViewManager/Constants.html">– Constants</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../../../Enums.html">Enumerations</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../../../Enums/ReCaptchaError.html">ReCaptchaError</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../../../Extensions.html">Extensions</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../../../Extensions/DispatchQueue.html">DispatchQueue</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../../Extensions/Reactive.html">Reactive</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../../Extensions/String.html">String</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>Constants</h1>
|
||||
<p>Undocumented</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB14WebViewManagerC0cD8Delegate33_C3529EC2362FD51A816C2A521FEB1AA9LLC9ConstantsV10apiURLHostSSvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/apiURLHost" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB14WebViewManagerC0cD8Delegate33_C3529EC2362FD51A816C2A521FEB1AA9LLC9ConstantsV10apiURLHostSSvZ">apiURLHost</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The host that loaded requests should have</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">static</span> <span class="k">let</span> <span class="nv">apiURLHost</span> <span class="o">=</span> <span class="s">"www.google.com"</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/fjcaetano/ReCaptcha" target="_blank" rel="external">Flávio Caetano</a>. All rights reserved. (Last updated: 2018-03-06)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
146
Enums.html
146
Enums.html
|
|
@ -1,146 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Enumerations Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="js/jquery.min.js" defer></script>
|
||||
<script src="js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a title="Enumerations Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="index.html">ReCaptcha Docs</a> (100% documented)</p>
|
||||
<p class="header-right"><a href="https://github.com/fjcaetano/ReCaptcha"><img src="img/gh.png"/>View on GitHub</a></p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="index.html">ReCaptcha Reference</a>
|
||||
<img id="carat" src="img/carat.png" />
|
||||
Enumerations Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/ReCaptcha.html">ReCaptcha</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/ReCaptcha/Endpoint.html">– Endpoint</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="Enums.html">Enumerations</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="Enums/ReCaptchaError.html">ReCaptchaError</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Enums/ReCaptchaResult.html">ReCaptchaResult</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="Extensions.html">Extensions</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="Extensions/Reactive.html">Reactive</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>Enumerations</h1>
|
||||
<p>The following enumerations are available globally.</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB5ErrorO"></a>
|
||||
<a name="//apple_ref/swift/Enum/ReCaptchaError" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB5ErrorO">ReCaptchaError</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The codes of possible errors thrown by ReCaptcha</p>
|
||||
|
||||
<a href="Enums/ReCaptchaError.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">ReCaptchaError</span><span class="p">:</span> <span class="kt">Error</span><span class="p">,</span> <span class="kt">CustomStringConvertible</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB6ResultO"></a>
|
||||
<a name="//apple_ref/swift/Enum/ReCaptchaResult" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB6ResultO">ReCaptchaResult</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The ReCaptcha result.</p>
|
||||
|
||||
<p>This may contain the validation token on success, or an error that may have occurred.</p>
|
||||
|
||||
<a href="Enums/ReCaptchaResult.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">ReCaptchaResult</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/fjcaetano" target="_blank" rel="external">Flávio Caetano (@fjcaetano)</a>. All rights reserved. (Last updated: 2018-09-28)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
|
|
@ -1,273 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>ReCaptchaError Enumeration Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="../js/jquery.min.js" defer></script>
|
||||
<script src="../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a name="//apple_ref/swift/Enum/ReCaptchaError" class="dashAnchor"></a>
|
||||
<a title="ReCaptchaError Enumeration Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../index.html">ReCaptcha Docs</a> (100% documented)</p>
|
||||
<p class="header-right"><a href="https://github.com/fjcaetano/ReCaptcha"><img src="../img/gh.png"/>View on GitHub</a></p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../index.html">ReCaptcha Reference</a>
|
||||
<img id="carat" src="../img/carat.png" />
|
||||
ReCaptchaError Enumeration Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ReCaptcha.html">ReCaptcha</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ReCaptcha/Endpoint.html">– Endpoint</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../Enums.html">Enumerations</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Enums/ReCaptchaError.html">ReCaptchaError</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Enums/ReCaptchaResult.html">ReCaptchaResult</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../Extensions.html">Extensions</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Extensions/Reactive.html">Reactive</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>ReCaptchaError</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">ReCaptchaError</span><span class="p">:</span> <span class="kt">Error</span><span class="p">,</span> <span class="kt">CustomStringConvertible</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p>The codes of possible errors thrown by ReCaptcha</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB5ErrorO10unexpectedyACs0C0_pcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/unexpected(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB5ErrorO10unexpectedyACs0C0_pcACmF">unexpected(_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Unexpected error</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="nf">unexpected</span><span class="p">(</span><span class="kt">Error</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB5ErrorO08htmlLoadC0yA2CmF"></a>
|
||||
<a name="//apple_ref/swift/Element/htmlLoadError" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB5ErrorO08htmlLoadC0yA2CmF">htmlLoadError</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Could not load the HTML embedded in the bundle</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="n">htmlLoadError</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB5ErrorO14apiKeyNotFoundyA2CmF"></a>
|
||||
<a name="//apple_ref/swift/Element/apiKeyNotFound" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB5ErrorO14apiKeyNotFoundyA2CmF">apiKeyNotFound</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>ReCaptchaKey was not provided</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="n">apiKeyNotFound</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB5ErrorO15baseURLNotFoundyA2CmF"></a>
|
||||
<a name="//apple_ref/swift/Element/baseURLNotFound" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB5ErrorO15baseURLNotFoundyA2CmF">baseURLNotFound</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>ReCaptchaDomain was not provided</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="n">baseURLNotFound</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB5ErrorO18wrongMessageFormatyA2CmF"></a>
|
||||
<a name="//apple_ref/swift/Element/wrongMessageFormat" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB5ErrorO18wrongMessageFormatyA2CmF">wrongMessageFormat</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Received an unexpected message from javascript</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="n">wrongMessageFormat</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB5ErrorO11descriptionSSvp"></a>
|
||||
<a name="//apple_ref/swift/Property/description" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB5ErrorO11descriptionSSvp">description</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>A human-readable description for each error</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">description</span><span class="p">:</span> <span class="kt">String</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/fjcaetano" target="_blank" rel="external">Flávio Caetano (@fjcaetano)</a>. All rights reserved. (Last updated: 2018-09-28)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
|
|
@ -1,191 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>ReCaptchaResult Enumeration Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="../js/jquery.min.js" defer></script>
|
||||
<script src="../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a name="//apple_ref/swift/Enum/ReCaptchaResult" class="dashAnchor"></a>
|
||||
<a title="ReCaptchaResult Enumeration Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../index.html">ReCaptcha Docs</a> (100% documented)</p>
|
||||
<p class="header-right"><a href="https://github.com/fjcaetano/ReCaptcha"><img src="../img/gh.png"/>View on GitHub</a></p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../index.html">ReCaptcha Reference</a>
|
||||
<img id="carat" src="../img/carat.png" />
|
||||
ReCaptchaResult Enumeration Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ReCaptcha.html">ReCaptcha</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ReCaptcha/Endpoint.html">– Endpoint</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../Enums.html">Enumerations</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Enums/ReCaptchaError.html">ReCaptchaError</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Enums/ReCaptchaResult.html">ReCaptchaResult</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../Extensions.html">Extensions</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Extensions/Reactive.html">Reactive</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>ReCaptchaResult</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">ReCaptchaResult</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p>The ReCaptcha result.</p>
|
||||
|
||||
<p>This may contain the validation token on success, or an error that may have occurred.</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB6ResultO5tokenyACSScACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/token(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB6ResultO5tokenyACSScACmF">token(_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The validation token.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="nf">token</span><span class="p">(</span><span class="kt">String</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB6ResultO5erroryAcA0aB5ErrorOcACmF"></a>
|
||||
<a name="//apple_ref/swift/Element/error(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB6ResultO5erroryAcA0aB5ErrorOcACmF">error(_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An error that may have occurred.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="nf">error</span><span class="p">(</span><span class="kt"><a href="../Enums/ReCaptchaError.html">ReCaptchaError</a></span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB6ResultO13dematerializeSSyKF"></a>
|
||||
<a name="//apple_ref/swift/Method/dematerialize()" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB6ResultO13dematerializeSSyKF">dematerialize()</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Tries to unwrap the Result and retrieve the token if it’s successful.</p>
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
<code><a href="../Enums/ReCaptchaError.html">ReCaptchaError</a></code>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">dematerialize</span><span class="p">()</span> <span class="k">throws</span> <span class="o">-></span> <span class="kt">String</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>The validation token uppon success.</p>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/fjcaetano" target="_blank" rel="external">Flávio Caetano (@fjcaetano)</a>. All rights reserved. (Last updated: 2018-09-28)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
platform :ios, 8.3
|
||||
|
||||
use_frameworks!
|
||||
inhibit_all_warnings!
|
||||
|
||||
target 'ReCaptcha_Example' do
|
||||
pod 'ReCaptcha/RxSwift', :path => '../'
|
||||
pod 'RxCocoa', '~> 4.3'
|
||||
pod 'SwiftLint', '~> 0.27'
|
||||
|
||||
target 'ReCaptcha_Tests' do
|
||||
inherit! :search_paths
|
||||
|
||||
pod 'AppSwizzle', '~> 1.3'
|
||||
pod 'RxBlocking', '~> 4.0'
|
||||
end
|
||||
|
||||
target 'ReCaptcha_UITests' do
|
||||
inherit! :search_paths
|
||||
end
|
||||
end
|
||||
|
||||
post_install do |i|
|
||||
target = File.join(Dir.pwd, "../.git/hooks/pre-push")
|
||||
unless File.symlink?(target)
|
||||
puts "Installing git hook for pre-push"
|
||||
|
||||
begin
|
||||
File.symlink(File.join(Dir.pwd, "../pre-push.sh"), target)
|
||||
rescue => exc
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
PODS:
|
||||
- AppSwizzle (1.3.1)
|
||||
- ReCaptcha/Core (1.4.1)
|
||||
- ReCaptcha/RxSwift (1.4.1):
|
||||
- ReCaptcha/Core
|
||||
- RxSwift (~> 4.3)
|
||||
- RxAtomic (4.4.0)
|
||||
- RxBlocking (4.4.0):
|
||||
- RxAtomic (~> 4.4)
|
||||
- RxSwift (~> 4.0)
|
||||
- RxCocoa (4.4.0):
|
||||
- RxSwift (~> 4.0)
|
||||
- RxSwift (4.4.0):
|
||||
- RxAtomic (~> 4.4)
|
||||
- SwiftLint (0.27.0)
|
||||
|
||||
DEPENDENCIES:
|
||||
- AppSwizzle (~> 1.3)
|
||||
- ReCaptcha/RxSwift (from `../`)
|
||||
- RxBlocking (~> 4.0)
|
||||
- RxCocoa (~> 4.3)
|
||||
- SwiftLint (~> 0.27)
|
||||
|
||||
SPEC REPOS:
|
||||
https://github.com/cocoapods/specs.git:
|
||||
- AppSwizzle
|
||||
- RxAtomic
|
||||
- RxBlocking
|
||||
- RxCocoa
|
||||
- RxSwift
|
||||
- SwiftLint
|
||||
|
||||
EXTERNAL SOURCES:
|
||||
ReCaptcha:
|
||||
:path: "../"
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
AppSwizzle: db36e436f56110d93e5ae0147683435df593cabc
|
||||
ReCaptcha: 520a707a38dfbb1e5de812aa3c041df60bd31827
|
||||
RxAtomic: eacf60db868c96bfd63320e28619fe29c179656f
|
||||
RxBlocking: 138ad53217434444d6eeeb4fb406a45431d92e31
|
||||
RxCocoa: df63ebf7b9a70d6b4eeea407ed5dd4efc8979749
|
||||
RxSwift: 5976ecd04fc2fefd648827c23de5e11157faa973
|
||||
SwiftLint: 3207c1faa2240bf8973b191820a116113cd11073
|
||||
|
||||
PODFILE CHECKSUM: 63f50401dee6a885ae0eea927fb966553c6d0f33
|
||||
|
||||
COCOAPODS: 1.5.3
|
||||
|
|
@ -0,0 +1,858 @@
|
|||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 46;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD51AFB9204008FA782 /* AppDelegate.swift */; };
|
||||
607FACD81AFB9204008FA782 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD71AFB9204008FA782 /* ViewController.swift */; };
|
||||
607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 607FACD91AFB9204008FA782 /* Main.storyboard */; };
|
||||
607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDC1AFB9204008FA782 /* Images.xcassets */; };
|
||||
607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */; };
|
||||
9D85E832734B73CFBD0156E0 /* Pods_ReCaptcha_UITests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B4C17A11F39B6DC940891AE0 /* Pods_ReCaptcha_UITests.framework */; };
|
||||
BD850CB2DF4C9C94FC51226C /* Pods_ReCaptcha_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 62BEEA62161F672468CCFD64 /* Pods_ReCaptcha_Example.framework */; };
|
||||
D091B6E053FD250B4757E34C /* Pods_ReCaptcha_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9417A28DC340FF0BC1627B3F /* Pods_ReCaptcha_Tests.framework */; };
|
||||
F206BAD51F8D3FEB00A25807 /* Cartfile in Resources */ = {isa = PBXBuildFile; fileRef = F206BAD41F8D3FEB00A25807 /* Cartfile */; };
|
||||
F211C22220F7E0B100709B26 /* ReCaptcha_Endpoint__Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F211C22120F7E0B100709B26 /* ReCaptcha_Endpoint__Tests.swift */; };
|
||||
F231B3971FEC325A00F82943 /* DispatchQueue__Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F231B3961FEC325A00F82943 /* DispatchQueue__Tests.swift */; };
|
||||
F231B39F1FED4A8C00F82943 /* ReCaptchaDecoder+Helper.swift in Sources */ = {isa = PBXBuildFile; fileRef = F231B39E1FED4A8C00F82943 /* ReCaptchaDecoder+Helper.swift */; };
|
||||
F288E9451F9537760018688D /* ReCaptchaError+Equatable.swift in Sources */ = {isa = PBXBuildFile; fileRef = F288E9441F9537760018688D /* ReCaptchaError+Equatable.swift */; };
|
||||
F28FAC9F200E425600E14987 /* ReCaptcha_UITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F28FAC9E200E425600E14987 /* ReCaptcha_UITests.swift */; };
|
||||
F2AE8612204F3430002E28D7 /* ReCaptchaResult__Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2AE8611204F3430002E28D7 /* ReCaptchaResult__Tests.swift */; };
|
||||
F2E2685E1F7AEE3400CD876D /* ReCaptcha__Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2E2685D1F7AEE3400CD876D /* ReCaptcha__Tests.swift */; };
|
||||
F2ECCF8A1E9FCEFE0097B199 /* ReCaptchaDecoder__Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2ECCF891E9FCEFE0097B199 /* ReCaptchaDecoder__Tests.swift */; };
|
||||
F2ECCF8C1E9FE37C0097B199 /* mock.html in Resources */ = {isa = PBXBuildFile; fileRef = F2ECCF8B1E9FE37C0097B199 /* mock.html */; };
|
||||
F2ECCF8E1E9FE68C0097B199 /* ReCaptchaWebViewManager__Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2ECCF8D1E9FE68C0097B199 /* ReCaptchaWebViewManager__Tests.swift */; };
|
||||
F2ECCF931EA009360097B199 /* ReCaptcha+Rx__Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2ECCF921EA009360097B199 /* ReCaptcha+Rx__Tests.swift */; };
|
||||
F2ECCF961EA00A5B0097B199 /* ReCaptchaWebViewManager+Helpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2ECCF951EA00A5B0097B199 /* ReCaptchaWebViewManager+Helpers.swift */; };
|
||||
F2ECCF981EA011370097B199 /* Result+Helpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2ECCF971EA011370097B199 /* Result+Helpers.swift */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
F28FACA1200E425600E14987 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 607FACC81AFB9204008FA782 /* Project object */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 607FACCF1AFB9204008FA782;
|
||||
remoteInfo = ReCaptcha_Example;
|
||||
};
|
||||
F2ECCF7B1E9FC47B0097B199 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 607FACC81AFB9204008FA782 /* Project object */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 607FACCF1AFB9204008FA782;
|
||||
remoteInfo = ReCaptcha_Example;
|
||||
};
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
0A2D0E5B4C6E445BF971488B /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; };
|
||||
44568771DD76CFBDF2D1C83D /* Pods-ReCaptcha_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ReCaptcha_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-ReCaptcha_Tests/Pods-ReCaptcha_Tests.release.xcconfig"; sourceTree = "<group>"; };
|
||||
4A242A5E18CBBFA095B66558 /* Pods-ReCaptcha_UITests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ReCaptcha_UITests.release.xcconfig"; path = "Pods/Target Support Files/Pods-ReCaptcha_UITests/Pods-ReCaptcha_UITests.release.xcconfig"; sourceTree = "<group>"; };
|
||||
4FED8267564AACFFEE83DB15 /* Pods-ReCaptcha_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ReCaptcha_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-ReCaptcha_Tests/Pods-ReCaptcha_Tests.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
607FACD01AFB9204008FA782 /* ReCaptcha_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ReCaptcha_Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
607FACD41AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
607FACD51AFB9204008FA782 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
607FACD71AFB9204008FA782 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
|
||||
607FACDA1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
|
||||
607FACDC1AFB9204008FA782 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
|
||||
607FACDF1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; };
|
||||
62BEEA62161F672468CCFD64 /* Pods_ReCaptcha_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ReCaptcha_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
62C1DD0E80E9920845E5DA51 /* ReCaptcha.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = ReCaptcha.podspec; path = ../ReCaptcha.podspec; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
|
||||
80FF4E03D71AACBD81A36301 /* Pods-ReCaptcha_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ReCaptcha_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-ReCaptcha_Example/Pods-ReCaptcha_Example.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
930BD5ACA20B973070B89ACF /* Pods-ReCaptcha_UITests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ReCaptcha_UITests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-ReCaptcha_UITests/Pods-ReCaptcha_UITests.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
9417A28DC340FF0BC1627B3F /* Pods_ReCaptcha_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ReCaptcha_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
B4C17A11F39B6DC940891AE0 /* Pods_ReCaptcha_UITests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ReCaptcha_UITests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
C2A0BDD35B5E219129E9BC65 /* Pods-ReCaptcha_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ReCaptcha_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-ReCaptcha_Example/Pods-ReCaptcha_Example.release.xcconfig"; sourceTree = "<group>"; };
|
||||
C8537003ECC47117AF54DCA9 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; };
|
||||
F206BAD41F8D3FEB00A25807 /* Cartfile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Cartfile; path = ../Cartfile; sourceTree = "<group>"; };
|
||||
F211C22120F7E0B100709B26 /* ReCaptcha_Endpoint__Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReCaptcha_Endpoint__Tests.swift; sourceTree = "<group>"; };
|
||||
F21901D91F98D62F00D8E2C9 /* CHANGELOG.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; name = CHANGELOG.md; path = ../CHANGELOG.md; sourceTree = "<group>"; };
|
||||
F231B3961FEC325A00F82943 /* DispatchQueue__Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DispatchQueue__Tests.swift; sourceTree = "<group>"; };
|
||||
F231B39E1FED4A8C00F82943 /* ReCaptchaDecoder+Helper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ReCaptchaDecoder+Helper.swift"; sourceTree = "<group>"; };
|
||||
F288E9441F9537760018688D /* ReCaptchaError+Equatable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ReCaptchaError+Equatable.swift"; sourceTree = "<group>"; };
|
||||
F28FAC9C200E425600E14987 /* ReCaptcha_UITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ReCaptcha_UITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
F28FAC9E200E425600E14987 /* ReCaptcha_UITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReCaptcha_UITests.swift; sourceTree = "<group>"; };
|
||||
F28FACA0200E425600E14987 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
F2AE8611204F3430002E28D7 /* ReCaptchaResult__Tests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ReCaptchaResult__Tests.swift; sourceTree = "<group>"; };
|
||||
F2E2685D1F7AEE3400CD876D /* ReCaptcha__Tests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ReCaptcha__Tests.swift; sourceTree = "<group>"; };
|
||||
F2ECCF761E9FC47B0097B199 /* ReCaptcha_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ReCaptcha_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
F2ECCF7A1E9FC47B0097B199 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
F2ECCF891E9FCEFE0097B199 /* ReCaptchaDecoder__Tests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ReCaptchaDecoder__Tests.swift; sourceTree = "<group>"; };
|
||||
F2ECCF8B1E9FE37C0097B199 /* mock.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = mock.html; sourceTree = "<group>"; };
|
||||
F2ECCF8D1E9FE68C0097B199 /* ReCaptchaWebViewManager__Tests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ReCaptchaWebViewManager__Tests.swift; sourceTree = "<group>"; };
|
||||
F2ECCF921EA009360097B199 /* ReCaptcha+Rx__Tests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "ReCaptcha+Rx__Tests.swift"; sourceTree = "<group>"; };
|
||||
F2ECCF951EA00A5B0097B199 /* ReCaptchaWebViewManager+Helpers.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "ReCaptchaWebViewManager+Helpers.swift"; sourceTree = "<group>"; };
|
||||
F2ECCF971EA011370097B199 /* Result+Helpers.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Result+Helpers.swift"; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
607FACCD1AFB9204008FA782 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
BD850CB2DF4C9C94FC51226C /* Pods_ReCaptcha_Example.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
F28FAC99200E425600E14987 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
9D85E832734B73CFBD0156E0 /* Pods_ReCaptcha_UITests.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
F2ECCF731E9FC47B0097B199 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
D091B6E053FD250B4757E34C /* Pods_ReCaptcha_Tests.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
607FACC71AFB9204008FA782 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
607FACF51AFB993E008FA782 /* Podspec Metadata */,
|
||||
607FACD21AFB9204008FA782 /* Example for ReCaptcha */,
|
||||
F2ECCF771E9FC47B0097B199 /* ReCaptcha_Tests */,
|
||||
F28FAC9D200E425600E14987 /* ReCaptcha_UITests */,
|
||||
607FACD11AFB9204008FA782 /* Products */,
|
||||
716E2370DBF48D5E2C86E802 /* Pods */,
|
||||
FDC29111B59FAB9F0F44DADB /* Frameworks */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
607FACD11AFB9204008FA782 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
607FACD01AFB9204008FA782 /* ReCaptcha_Example.app */,
|
||||
F2ECCF761E9FC47B0097B199 /* ReCaptcha_Tests.xctest */,
|
||||
F28FAC9C200E425600E14987 /* ReCaptcha_UITests.xctest */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
607FACD21AFB9204008FA782 /* Example for ReCaptcha */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
607FACD51AFB9204008FA782 /* AppDelegate.swift */,
|
||||
607FACD71AFB9204008FA782 /* ViewController.swift */,
|
||||
607FACD91AFB9204008FA782 /* Main.storyboard */,
|
||||
607FACDC1AFB9204008FA782 /* Images.xcassets */,
|
||||
607FACDE1AFB9204008FA782 /* LaunchScreen.xib */,
|
||||
607FACD31AFB9204008FA782 /* Supporting Files */,
|
||||
);
|
||||
name = "Example for ReCaptcha";
|
||||
path = ReCaptcha;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
607FACD31AFB9204008FA782 /* Supporting Files */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
607FACD41AFB9204008FA782 /* Info.plist */,
|
||||
);
|
||||
name = "Supporting Files";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
607FACF51AFB993E008FA782 /* Podspec Metadata */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
62C1DD0E80E9920845E5DA51 /* ReCaptcha.podspec */,
|
||||
F206BAD41F8D3FEB00A25807 /* Cartfile */,
|
||||
0A2D0E5B4C6E445BF971488B /* README.md */,
|
||||
C8537003ECC47117AF54DCA9 /* LICENSE */,
|
||||
F21901D91F98D62F00D8E2C9 /* CHANGELOG.md */,
|
||||
);
|
||||
name = "Podspec Metadata";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
716E2370DBF48D5E2C86E802 /* Pods */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
80FF4E03D71AACBD81A36301 /* Pods-ReCaptcha_Example.debug.xcconfig */,
|
||||
C2A0BDD35B5E219129E9BC65 /* Pods-ReCaptcha_Example.release.xcconfig */,
|
||||
4FED8267564AACFFEE83DB15 /* Pods-ReCaptcha_Tests.debug.xcconfig */,
|
||||
44568771DD76CFBDF2D1C83D /* Pods-ReCaptcha_Tests.release.xcconfig */,
|
||||
930BD5ACA20B973070B89ACF /* Pods-ReCaptcha_UITests.debug.xcconfig */,
|
||||
4A242A5E18CBBFA095B66558 /* Pods-ReCaptcha_UITests.release.xcconfig */,
|
||||
);
|
||||
name = Pods;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F28FAC9D200E425600E14987 /* ReCaptcha_UITests */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F28FAC9E200E425600E14987 /* ReCaptcha_UITests.swift */,
|
||||
F28FACA0200E425600E14987 /* Info.plist */,
|
||||
);
|
||||
path = ReCaptcha_UITests;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F2ECCF771E9FC47B0097B199 /* ReCaptcha_Tests */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F2ECCF8B1E9FE37C0097B199 /* mock.html */,
|
||||
F2ECCF821E9FC4AC0097B199 /* Core */,
|
||||
F2ECCF911EA009220097B199 /* RxSwift */,
|
||||
F2ECCF941EA00A4A0097B199 /* Helpers */,
|
||||
F2ECCF7A1E9FC47B0097B199 /* Info.plist */,
|
||||
);
|
||||
path = ReCaptcha_Tests;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F2ECCF821E9FC4AC0097B199 /* Core */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F2ECCF891E9FCEFE0097B199 /* ReCaptchaDecoder__Tests.swift */,
|
||||
F2ECCF8D1E9FE68C0097B199 /* ReCaptchaWebViewManager__Tests.swift */,
|
||||
F2E2685D1F7AEE3400CD876D /* ReCaptcha__Tests.swift */,
|
||||
F231B3961FEC325A00F82943 /* DispatchQueue__Tests.swift */,
|
||||
F2AE8611204F3430002E28D7 /* ReCaptchaResult__Tests.swift */,
|
||||
F211C22120F7E0B100709B26 /* ReCaptcha_Endpoint__Tests.swift */,
|
||||
);
|
||||
path = Core;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F2ECCF911EA009220097B199 /* RxSwift */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F2ECCF921EA009360097B199 /* ReCaptcha+Rx__Tests.swift */,
|
||||
);
|
||||
path = RxSwift;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F2ECCF941EA00A4A0097B199 /* Helpers */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F2ECCF951EA00A5B0097B199 /* ReCaptchaWebViewManager+Helpers.swift */,
|
||||
F2ECCF971EA011370097B199 /* Result+Helpers.swift */,
|
||||
F288E9441F9537760018688D /* ReCaptchaError+Equatable.swift */,
|
||||
F231B39E1FED4A8C00F82943 /* ReCaptchaDecoder+Helper.swift */,
|
||||
);
|
||||
path = Helpers;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
FDC29111B59FAB9F0F44DADB /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
62BEEA62161F672468CCFD64 /* Pods_ReCaptcha_Example.framework */,
|
||||
9417A28DC340FF0BC1627B3F /* Pods_ReCaptcha_Tests.framework */,
|
||||
B4C17A11F39B6DC940891AE0 /* Pods_ReCaptcha_UITests.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
607FACCF1AFB9204008FA782 /* ReCaptcha_Example */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "ReCaptcha_Example" */;
|
||||
buildPhases = (
|
||||
51299F67A8756E2B3EAE411A /* [CP] Check Pods Manifest.lock */,
|
||||
607FACCC1AFB9204008FA782 /* Sources */,
|
||||
607FACCD1AFB9204008FA782 /* Frameworks */,
|
||||
607FACCE1AFB9204008FA782 /* Resources */,
|
||||
8F03FFB3F5C55E873C23C682 /* [CP] Embed Pods Frameworks */,
|
||||
F231B3981FEC3B7F00F82943 /* SwiftLint */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = ReCaptcha_Example;
|
||||
productName = ReCaptcha;
|
||||
productReference = 607FACD01AFB9204008FA782 /* ReCaptcha_Example.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
F28FAC9B200E425600E14987 /* ReCaptcha_UITests */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = F28FACA5200E425600E14987 /* Build configuration list for PBXNativeTarget "ReCaptcha_UITests" */;
|
||||
buildPhases = (
|
||||
B8A66872166B84DAD39A3E1F /* [CP] Check Pods Manifest.lock */,
|
||||
F28FAC98200E425600E14987 /* Sources */,
|
||||
F28FAC99200E425600E14987 /* Frameworks */,
|
||||
F28FAC9A200E425600E14987 /* Resources */,
|
||||
F28FACA6200E447600E14987 /* ShellScript */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
F28FACA2200E425600E14987 /* PBXTargetDependency */,
|
||||
);
|
||||
name = ReCaptcha_UITests;
|
||||
productName = ReCaptcha_UITests;
|
||||
productReference = F28FAC9C200E425600E14987 /* ReCaptcha_UITests.xctest */;
|
||||
productType = "com.apple.product-type.bundle.ui-testing";
|
||||
};
|
||||
F2ECCF751E9FC47B0097B199 /* ReCaptcha_Tests */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = F2ECCF7D1E9FC47B0097B199 /* Build configuration list for PBXNativeTarget "ReCaptcha_Tests" */;
|
||||
buildPhases = (
|
||||
DDB47454887253730AB35230 /* [CP] Check Pods Manifest.lock */,
|
||||
F2ECCF721E9FC47B0097B199 /* Sources */,
|
||||
F2ECCF731E9FC47B0097B199 /* Frameworks */,
|
||||
F2ECCF741E9FC47B0097B199 /* Resources */,
|
||||
77003100630E7783A936C451 /* [CP] Embed Pods Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
F2ECCF7C1E9FC47B0097B199 /* PBXTargetDependency */,
|
||||
);
|
||||
name = ReCaptcha_Tests;
|
||||
productName = ReCaptcha_Tests;
|
||||
productReference = F2ECCF761E9FC47B0097B199 /* ReCaptcha_Tests.xctest */;
|
||||
productType = "com.apple.product-type.bundle.unit-test";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
607FACC81AFB9204008FA782 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastSwiftUpdateCheck = 0910;
|
||||
LastUpgradeCheck = 0900;
|
||||
ORGANIZATIONNAME = ReCaptcha;
|
||||
TargetAttributes = {
|
||||
607FACCF1AFB9204008FA782 = {
|
||||
CreatedOnToolsVersion = 6.3.1;
|
||||
LastSwiftMigration = 0900;
|
||||
};
|
||||
F28FAC9B200E425600E14987 = {
|
||||
CreatedOnToolsVersion = 9.1;
|
||||
ProvisioningStyle = Automatic;
|
||||
TestTargetID = 607FACCF1AFB9204008FA782;
|
||||
};
|
||||
F2ECCF751E9FC47B0097B199 = {
|
||||
CreatedOnToolsVersion = 8.3;
|
||||
LastSwiftMigration = 0900;
|
||||
ProvisioningStyle = Automatic;
|
||||
TestTargetID = 607FACCF1AFB9204008FA782;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "ReCaptcha" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
Base,
|
||||
);
|
||||
mainGroup = 607FACC71AFB9204008FA782;
|
||||
productRefGroup = 607FACD11AFB9204008FA782 /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
607FACCF1AFB9204008FA782 /* ReCaptcha_Example */,
|
||||
F2ECCF751E9FC47B0097B199 /* ReCaptcha_Tests */,
|
||||
F28FAC9B200E425600E14987 /* ReCaptcha_UITests */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
607FACCE1AFB9204008FA782 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
F206BAD51F8D3FEB00A25807 /* Cartfile in Resources */,
|
||||
607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */,
|
||||
607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */,
|
||||
607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
F28FAC9A200E425600E14987 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
F2ECCF741E9FC47B0097B199 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
F2ECCF8C1E9FE37C0097B199 /* mock.html in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
51299F67A8756E2B3EAE411A /* [CP] Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
|
||||
"${PODS_ROOT}/Manifest.lock",
|
||||
);
|
||||
name = "[CP] Check Pods Manifest.lock";
|
||||
outputPaths = (
|
||||
"$(DERIVED_FILE_DIR)/Pods-ReCaptcha_Example-checkManifestLockResult.txt",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
77003100630E7783A936C451 /* [CP] Embed Pods Frameworks */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${SRCROOT}/Pods/Target Support Files/Pods-ReCaptcha_Tests/Pods-ReCaptcha_Tests-frameworks.sh",
|
||||
"${BUILT_PRODUCTS_DIR}/RxAtomic/RxAtomic.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/RxSwift/RxSwift.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/AppSwizzle/AppSwizzle.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/RxBlocking/RxBlocking.framework",
|
||||
);
|
||||
name = "[CP] Embed Pods Frameworks";
|
||||
outputPaths = (
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RxAtomic.framework",
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RxSwift.framework",
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AppSwizzle.framework",
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RxBlocking.framework",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-ReCaptcha_Tests/Pods-ReCaptcha_Tests-frameworks.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
8F03FFB3F5C55E873C23C682 /* [CP] Embed Pods Frameworks */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${SRCROOT}/Pods/Target Support Files/Pods-ReCaptcha_Example/Pods-ReCaptcha_Example-frameworks.sh",
|
||||
"${BUILT_PRODUCTS_DIR}/ReCaptcha/ReCaptcha.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/RxAtomic/RxAtomic.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/RxCocoa/RxCocoa.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/RxSwift/RxSwift.framework",
|
||||
);
|
||||
name = "[CP] Embed Pods Frameworks";
|
||||
outputPaths = (
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ReCaptcha.framework",
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RxAtomic.framework",
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RxCocoa.framework",
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RxSwift.framework",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-ReCaptcha_Example/Pods-ReCaptcha_Example-frameworks.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
B8A66872166B84DAD39A3E1F /* [CP] Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
|
||||
"${PODS_ROOT}/Manifest.lock",
|
||||
);
|
||||
name = "[CP] Check Pods Manifest.lock";
|
||||
outputPaths = (
|
||||
"$(DERIVED_FILE_DIR)/Pods-ReCaptcha_UITests-checkManifestLockResult.txt",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
DDB47454887253730AB35230 /* [CP] Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
|
||||
"${PODS_ROOT}/Manifest.lock",
|
||||
);
|
||||
name = "[CP] Check Pods Manifest.lock";
|
||||
outputPaths = (
|
||||
"$(DERIVED_FILE_DIR)/Pods-ReCaptcha_Tests-checkManifestLockResult.txt",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
F231B3981FEC3B7F00F82943 /* SwiftLint */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = SwiftLint;
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${PODS_ROOT}/SwiftLint/swiftlint\" --path \"${PROJECT_DIR}/..\"\n";
|
||||
};
|
||||
F28FACA6200E447600E14987 /* ShellScript */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "# Unfortuantely, Xcode 7.3 and Cocoapods are not yet fully compatible. The location of the xctest bundle has changed and so we need to manually copy some things ...\n# this fix is necesary - tested on Cocoapods 1.1.rc2 that still have the issue.\n# ver 0.2\n\n# set variables\nBUILD_ROOT=\"${BUILT_PRODUCTS_DIR}\"\n\nMAIN_TARGET_NAME=\"ReCaptcha_Example.app\" #if you know how to get this from here do let me know!\nMAIN_TARGET_FRAMEWORKS=\"${BUILT_PRODUCTS_DIR}/${MAIN_TARGET_NAME}/Frameworks\"\n\nTEST_TARGET_NAME=\"ReCaptcha_UITests\"\nTEST_RUNNER_TARGET_FRAMEWORKS=\"${BUILT_PRODUCTS_DIR}/${TEST_TARGET_NAME}-Runner.app\"\n\n# COPY FRAMEWORKS FROM MAIN TARGET TO TEST TARGET if framework folder exists\nif [[ -d \"${MAIN_TARGET_FRAMEWORKS}\" ]]; then\necho \"**** COPYING FRAMEWORKS FROM \\\"${MAIN_TARGET_FRAMEWORKS}\\\" TO \\\"${TEST_RUNNER_TARGET_FRAMEWORKS}\\\" ...\"\ncp -R \"${MAIN_TARGET_FRAMEWORKS}\" \"${TEST_RUNNER_TARGET_FRAMEWORKS}\"\nfi\n\n# You don't really need this section below if your script works, otherwise it is quite helpful to troubleshoot any problems with paths.\n\n# DEBUG SECTION\necho \"BUILD_ROOT : ${BUILD_ROOT}\"\necho \"MAIN_TARGET_NAME : ${MAIN_TARGET_NAME}\"\necho \"MAIN_TARGET_FRAMEWORKS ${MAIN_TARGET_FRAMEWORKS}\"\necho \"TEST_TARGET_NAME : ${TEST_TARGET_NAME}\"\necho \"TEST_RUNNER_TARGET_FRAMEWORKS : ${TEST_TARGET_FRAMEWORKS}\"\necho \"CONTENT: ${CONTENTS_FOLDER_PATH}\"\necho \"FRAMEWORK PATH: ${FRAMEWORKS_FOLDER_PATH}\"\necho \"TARGET BUILD DIR: ${TARGET_BUILD_DIR}\"";
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
607FACCC1AFB9204008FA782 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
607FACD81AFB9204008FA782 /* ViewController.swift in Sources */,
|
||||
607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
F28FAC98200E425600E14987 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
F28FAC9F200E425600E14987 /* ReCaptcha_UITests.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
F2ECCF721E9FC47B0097B199 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
F2AE8612204F3430002E28D7 /* ReCaptchaResult__Tests.swift in Sources */,
|
||||
F2ECCF961EA00A5B0097B199 /* ReCaptchaWebViewManager+Helpers.swift in Sources */,
|
||||
F2ECCF8E1E9FE68C0097B199 /* ReCaptchaWebViewManager__Tests.swift in Sources */,
|
||||
F2ECCF981EA011370097B199 /* Result+Helpers.swift in Sources */,
|
||||
F231B3971FEC325A00F82943 /* DispatchQueue__Tests.swift in Sources */,
|
||||
F231B39F1FED4A8C00F82943 /* ReCaptchaDecoder+Helper.swift in Sources */,
|
||||
F211C22220F7E0B100709B26 /* ReCaptcha_Endpoint__Tests.swift in Sources */,
|
||||
F2E2685E1F7AEE3400CD876D /* ReCaptcha__Tests.swift in Sources */,
|
||||
F2ECCF931EA009360097B199 /* ReCaptcha+Rx__Tests.swift in Sources */,
|
||||
F288E9451F9537760018688D /* ReCaptchaError+Equatable.swift in Sources */,
|
||||
F2ECCF8A1E9FCEFE0097B199 /* ReCaptchaDecoder__Tests.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXTargetDependency section */
|
||||
F28FACA2200E425600E14987 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = 607FACCF1AFB9204008FA782 /* ReCaptcha_Example */;
|
||||
targetProxy = F28FACA1200E425600E14987 /* PBXContainerItemProxy */;
|
||||
};
|
||||
F2ECCF7C1E9FC47B0097B199 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = 607FACCF1AFB9204008FA782 /* ReCaptcha_Example */;
|
||||
targetProxy = F2ECCF7B1E9FC47B0097B199 /* PBXContainerItemProxy */;
|
||||
};
|
||||
/* End PBXTargetDependency section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
607FACD91AFB9204008FA782 /* Main.storyboard */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
607FACDA1AFB9204008FA782 /* Base */,
|
||||
);
|
||||
name = Main.storyboard;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
607FACDE1AFB9204008FA782 /* LaunchScreen.xib */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
607FACDF1AFB9204008FA782 /* Base */,
|
||||
);
|
||||
name = LaunchScreen.xib;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
607FACED1AFB9204008FA782 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
607FACEE1AFB9204008FA782 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
607FACF01AFB9204008FA782 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 80FF4E03D71AACBD81A36301 /* Pods-ReCaptcha_Example.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
INFOPLIST_FILE = ReCaptcha/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
MODULE_NAME = ExampleApp;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.flaviocaetano.ReCaptcha-Example";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
|
||||
SWIFT_VERSION = 4.2;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
607FACF11AFB9204008FA782 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = C2A0BDD35B5E219129E9BC65 /* Pods-ReCaptcha_Example.release.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
INFOPLIST_FILE = ReCaptcha/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
MODULE_NAME = ExampleApp;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.flaviocaetano.ReCaptcha-Example";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
|
||||
SWIFT_VERSION = 4.2;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
F28FACA3200E425600E14987 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 930BD5ACA20B973070B89ACF /* Pods-ReCaptcha_UITests.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
INFOPLIST_FILE = ReCaptcha_UITests/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "ReCaptcha.ReCaptcha-UITests";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||
SWIFT_VERSION = 4.2;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
TEST_TARGET_NAME = ReCaptcha_Example;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
F28FACA4200E425600E14987 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 4A242A5E18CBBFA095B66558 /* Pods-ReCaptcha_UITests.release.xcconfig */;
|
||||
buildSettings = {
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
INFOPLIST_FILE = ReCaptcha_UITests/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "ReCaptcha.ReCaptcha-UITests";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 4.2;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
TEST_TARGET_NAME = ReCaptcha_Example;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
F2ECCF7E1E9FC47B0097B199 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 4FED8267564AACFFEE83DB15 /* Pods-ReCaptcha_Tests.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
INFOPLIST_FILE = ReCaptcha_Tests/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.flaviocaetano.ReCaptcha-Tests";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG UNIT_TESTS";
|
||||
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
|
||||
SWIFT_VERSION = 4.2;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ReCaptcha_Example.app/ReCaptcha_Example";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
F2ECCF7F1E9FC47B0097B199 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 44568771DD76CFBDF2D1C83D /* Pods-ReCaptcha_Tests.release.xcconfig */;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
INFOPLIST_FILE = ReCaptcha_Tests/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.flaviocaetano.ReCaptcha-Tests";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
|
||||
SWIFT_VERSION = 4.2;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ReCaptcha_Example.app/ReCaptcha_Example";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "ReCaptcha" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
607FACED1AFB9204008FA782 /* Debug */,
|
||||
607FACEE1AFB9204008FA782 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "ReCaptcha_Example" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
607FACF01AFB9204008FA782 /* Debug */,
|
||||
607FACF11AFB9204008FA782 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
F28FACA5200E425600E14987 /* Build configuration list for PBXNativeTarget "ReCaptcha_UITests" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
F28FACA3200E425600E14987 /* Debug */,
|
||||
F28FACA4200E425600E14987 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
F2ECCF7D1E9FC47B0097B199 /* Build configuration list for PBXNativeTarget "ReCaptcha_Tests" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
F2ECCF7E1E9FC47B0097B199 /* Debug */,
|
||||
F2ECCF7F1E9FC47B0097B199 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 607FACC81AFB9204008FA782 /* Project object */;
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:ReCaptcha.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
|
|
@ -0,0 +1,126 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0900"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "607FACCF1AFB9204008FA782"
|
||||
BuildableName = "ReCaptcha_Example.app"
|
||||
BlueprintName = "ReCaptcha_Example"
|
||||
ReferencedContainer = "container:ReCaptcha.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "NO"
|
||||
buildForProfiling = "NO"
|
||||
buildForArchiving = "NO"
|
||||
buildForAnalyzing = "NO">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "F2ECCF751E9FC47B0097B199"
|
||||
BuildableName = "ReCaptcha_Tests.xctest"
|
||||
BlueprintName = "ReCaptcha_Tests"
|
||||
ReferencedContainer = "container:ReCaptcha.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
codeCoverageEnabled = "YES"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
<TestableReference
|
||||
skipped = "NO">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "F2ECCF751E9FC47B0097B199"
|
||||
BuildableName = "ReCaptcha_Tests.xctest"
|
||||
BlueprintName = "ReCaptcha_Tests"
|
||||
ReferencedContainer = "container:ReCaptcha.xcodeproj">
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
<TestableReference
|
||||
skipped = "NO">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "F28FAC9B200E425600E14987"
|
||||
BuildableName = "ReCaptcha_UITests.xctest"
|
||||
BlueprintName = "ReCaptcha_UITests"
|
||||
ReferencedContainer = "container:ReCaptcha.xcodeproj">
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
</Testables>
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "607FACCF1AFB9204008FA782"
|
||||
BuildableName = "ReCaptcha_Example.app"
|
||||
BlueprintName = "ReCaptcha_Example"
|
||||
ReferencedContainer = "container:ReCaptcha.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "607FACCF1AFB9204008FA782"
|
||||
BuildableName = "ReCaptcha_Example.app"
|
||||
BlueprintName = "ReCaptcha_Example"
|
||||
ReferencedContainer = "container:ReCaptcha.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "607FACCF1AFB9204008FA782"
|
||||
BuildableName = "ReCaptcha_Example.app"
|
||||
BlueprintName = "ReCaptcha_Example"
|
||||
ReferencedContainer = "container:ReCaptcha.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "group:ReCaptcha.xcodeproj">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "group:Pods/Pods.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
disabled_rules:
|
||||
- explicit_top_level_acl
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
//
|
||||
// AppDelegate.swift
|
||||
// ReCaptcha
|
||||
//
|
||||
// Created by Flávio Caetano on 03/22/17.
|
||||
// Copyright © 2018 ReCaptcha. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
@UIApplicationMain
|
||||
class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
|
||||
var window: UIWindow?
|
||||
|
||||
|
||||
func application(
|
||||
_ application: UIApplication,
|
||||
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
|
||||
) -> Bool {
|
||||
// Override point for customization after application launch.
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/>
|
||||
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<view contentMode="scaleToFill" id="iN0-l3-epB">
|
||||
<rect key="frame" x="0.0" y="0.0" width="480" height="480"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" Copyright (c) 2018 Flávio Caetano. All rights reserved." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="8ie-xW-0ye">
|
||||
<rect key="frame" x="20" y="439" width="441" height="21"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="ReCaptcha" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX">
|
||||
<rect key="frame" x="20" y="140" width="441" height="43"/>
|
||||
<fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
|
||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstItem="kId-c2-rCX" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="bottom" multiplier="1/3" constant="1" id="5cJ-9S-tgC"/>
|
||||
<constraint firstAttribute="centerX" secondItem="kId-c2-rCX" secondAttribute="centerX" id="Koa-jz-hwk"/>
|
||||
<constraint firstAttribute="bottom" secondItem="8ie-xW-0ye" secondAttribute="bottom" constant="20" id="Kzo-t9-V3l"/>
|
||||
<constraint firstItem="8ie-xW-0ye" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="MfP-vx-nX0"/>
|
||||
<constraint firstAttribute="centerX" secondItem="8ie-xW-0ye" secondAttribute="centerX" id="ZEH-qu-HZ9"/>
|
||||
<constraint firstItem="kId-c2-rCX" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="fvb-Df-36g"/>
|
||||
</constraints>
|
||||
<nil key="simulatedStatusBarMetrics"/>
|
||||
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
|
||||
<point key="canvasLocation" x="548" y="455"/>
|
||||
</view>
|
||||
</objects>
|
||||
</document>
|
||||
|
|
@ -0,0 +1,122 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14109" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="vXZ-lx-hvc">
|
||||
<device id="retina4_7" orientation="portrait">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="ufC-wZ-h7g">
|
||||
<objects>
|
||||
<viewController id="vXZ-lx-hvc" customClass="ViewController" customModule="ReCaptcha_Example" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<layoutGuides>
|
||||
<viewControllerLayoutGuide type="top" id="jyV-Pf-zRb"/>
|
||||
<viewControllerLayoutGuide type="bottom" id="2fi-mo-0CV"/>
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="kh9-bI-dsS">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<subviews>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="RDW-bD-rSo">
|
||||
<rect key="frame" x="50" y="450" width="275" height="50"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="50" id="Bt8-Ou-ht2"/>
|
||||
</constraints>
|
||||
<state key="normal" title="Validate"/>
|
||||
<connections>
|
||||
<action selector="didPressButtonWithButton:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="FpZ-S1-HW0"/>
|
||||
</connections>
|
||||
</button>
|
||||
<activityIndicatorView hidden="YES" opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" hidesWhenStopped="YES" style="gray" translatesAutoresizingMaskIntoConstraints="NO" id="jHc-GP-v1Z">
|
||||
<rect key="frame" x="177" y="323" width="20" height="20"/>
|
||||
</activityIndicatorView>
|
||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="249" text="" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="o6f-cL-1PF">
|
||||
<rect key="frame" x="20" y="247" width="335" height="173"/>
|
||||
<accessibility key="accessibilityConfiguration" identifier="resultLabel"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<segmentedControl clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="top" segmentControlStyle="plain" selectedSegmentIndex="0" translatesAutoresizingMaskIntoConstraints="NO" id="X8E-G9-9IV">
|
||||
<rect key="frame" x="71" y="568" width="233" height="29"/>
|
||||
<segments>
|
||||
<segment title="Default Endpoint"/>
|
||||
<segment title="Alternate"/>
|
||||
</segments>
|
||||
<connections>
|
||||
<action selector="didPressEndpointSegmentedControl:" destination="vXZ-lx-hvc" eventType="valueChanged" id="Sdm-dO-doL"/>
|
||||
</connections>
|
||||
</segmentedControl>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Uyt-0M-CR7">
|
||||
<rect key="frame" x="77" y="616" width="221" height="31"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Force visible captcha" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="awK-8H-OCQ">
|
||||
<rect key="frame" x="0.0" y="0.0" width="162" height="31"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="mGh-Ox-cFf">
|
||||
<rect key="frame" x="172" y="0.0" width="51" height="31"/>
|
||||
<accessibility key="accessibilityConfiguration" identifier="Switch"/>
|
||||
</switch>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="bottom" secondItem="awK-8H-OCQ" secondAttribute="bottom" id="0Wx-IJ-Kwg"/>
|
||||
<constraint firstAttribute="trailing" secondItem="mGh-Ox-cFf" secondAttribute="trailing" id="8Xc-zN-tVW"/>
|
||||
<constraint firstItem="awK-8H-OCQ" firstAttribute="top" secondItem="Uyt-0M-CR7" secondAttribute="top" id="IbZ-YP-G0R"/>
|
||||
<constraint firstItem="mGh-Ox-cFf" firstAttribute="top" secondItem="Uyt-0M-CR7" secondAttribute="top" id="P27-Ua-aX7"/>
|
||||
<constraint firstItem="awK-8H-OCQ" firstAttribute="leading" secondItem="Uyt-0M-CR7" secondAttribute="leading" id="fna-4f-wRD"/>
|
||||
<constraint firstAttribute="bottom" secondItem="mGh-Ox-cFf" secondAttribute="bottom" id="vnT-b0-5h3"/>
|
||||
<constraint firstItem="mGh-Ox-cFf" firstAttribute="leading" secondItem="awK-8H-OCQ" secondAttribute="trailing" constant="10" id="wzo-g0-VEj"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<segmentedControl clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="top" segmentControlStyle="plain" selectedSegmentIndex="0" translatesAutoresizingMaskIntoConstraints="NO" id="kq2-ci-l1u">
|
||||
<rect key="frame" x="114" y="520" width="147" height="29"/>
|
||||
<segments>
|
||||
<segment title="Nil Locale"/>
|
||||
<segment title="Chinese"/>
|
||||
</segments>
|
||||
<connections>
|
||||
<action selector="didPressLocaleSegmentedControl:" destination="vXZ-lx-hvc" eventType="valueChanged" id="nSA-f3-8eS"/>
|
||||
</connections>
|
||||
</segmentedControl>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstItem="o6f-cL-1PF" firstAttribute="leading" secondItem="kh9-bI-dsS" secondAttribute="leading" constant="20" id="0dV-t0-W0Y"/>
|
||||
<constraint firstAttribute="trailing" secondItem="RDW-bD-rSo" secondAttribute="trailing" constant="50" id="1Lj-Ox-Kl4"/>
|
||||
<constraint firstItem="X8E-G9-9IV" firstAttribute="top" secondItem="kq2-ci-l1u" secondAttribute="bottom" constant="20" id="8ye-XO-bpK"/>
|
||||
<constraint firstItem="X8E-G9-9IV" firstAttribute="centerX" secondItem="kh9-bI-dsS" secondAttribute="centerX" id="92w-cw-lR2"/>
|
||||
<constraint firstItem="2fi-mo-0CV" firstAttribute="top" secondItem="Uyt-0M-CR7" secondAttribute="bottom" constant="20" id="Bfs-p5-IBM"/>
|
||||
<constraint firstItem="o6f-cL-1PF" firstAttribute="centerY" secondItem="kh9-bI-dsS" secondAttribute="centerY" priority="750" id="NMD-ir-PXe"/>
|
||||
<constraint firstItem="RDW-bD-rSo" firstAttribute="top" secondItem="o6f-cL-1PF" secondAttribute="bottom" constant="30" id="TZe-z9-MZS"/>
|
||||
<constraint firstItem="jHc-GP-v1Z" firstAttribute="centerY" secondItem="kh9-bI-dsS" secondAttribute="centerY" id="VOe-WJ-FKo"/>
|
||||
<constraint firstItem="jHc-GP-v1Z" firstAttribute="centerX" secondItem="kh9-bI-dsS" secondAttribute="centerX" id="XkT-zr-eUO"/>
|
||||
<constraint firstItem="kq2-ci-l1u" firstAttribute="top" secondItem="RDW-bD-rSo" secondAttribute="bottom" constant="20" id="Y4H-6k-gDx"/>
|
||||
<constraint firstAttribute="trailing" secondItem="o6f-cL-1PF" secondAttribute="trailing" constant="20" id="c74-nm-rgi"/>
|
||||
<constraint firstItem="RDW-bD-rSo" firstAttribute="leading" secondItem="kh9-bI-dsS" secondAttribute="leading" constant="50" id="iXO-hP-XZ7"/>
|
||||
<constraint firstItem="kq2-ci-l1u" firstAttribute="centerX" secondItem="kh9-bI-dsS" secondAttribute="centerX" id="ice-pp-mVe"/>
|
||||
<constraint firstItem="Uyt-0M-CR7" firstAttribute="top" secondItem="X8E-G9-9IV" secondAttribute="bottom" constant="20" id="nIE-QT-RpQ"/>
|
||||
<constraint firstItem="Uyt-0M-CR7" firstAttribute="centerX" secondItem="kh9-bI-dsS" secondAttribute="centerX" id="qfG-68-ySO"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<connections>
|
||||
<outlet property="endpointSegmentedControl" destination="X8E-G9-9IV" id="jAb-fU-Yu5"/>
|
||||
<outlet property="label" destination="o6f-cL-1PF" id="KQV-3X-RKr"/>
|
||||
<outlet property="localeSegmentedControl" destination="kq2-ci-l1u" id="gL7-du-K6l"/>
|
||||
<outlet property="spinner" destination="jHc-GP-v1Z" id="gRn-JW-FIK"/>
|
||||
<outlet property="visibleChallengeSwitch" destination="mGh-Ox-cFf" id="R13-nD-EXL"/>
|
||||
</connections>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="x5A-6p-PRh" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="117.59999999999999" y="117.39130434782609"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
</document>
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "20x20",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "20x20",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "29x29",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "29x29",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "40x40",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "40x40",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "60x60",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "60x60",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ios-marketing",
|
||||
"size" : "1024x1024",
|
||||
"scale" : "1x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>LSApplicationCategoryType</key>
|
||||
<string></string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>ReCaptchaDomain</key>
|
||||
<string>http://localhost</string>
|
||||
<key>ReCaptchaKey</key>
|
||||
<string>6LdE-hkUAAAAAKWfpXjXrsLMwDc0psCcjvpBgGr6</string>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
<key>UIMainStoryboardFile</key>
|
||||
<string>Main</string>
|
||||
<key>UIRequiredDeviceCapabilities</key>
|
||||
<array>
|
||||
<string>armv7</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
@ -0,0 +1,126 @@
|
|||
//
|
||||
// ViewController.swift
|
||||
// ReCaptcha
|
||||
//
|
||||
// Created by Flávio Caetano on 03/22/17.
|
||||
// Copyright © 2018 ReCaptcha. All rights reserved.
|
||||
//
|
||||
|
||||
import ReCaptcha
|
||||
import RxCocoa
|
||||
import RxSwift
|
||||
import UIKit
|
||||
|
||||
|
||||
class ViewController: UIViewController {
|
||||
private struct Constants {
|
||||
static let webViewTag = 123
|
||||
static let testLabelTag = 321
|
||||
}
|
||||
|
||||
private var recaptcha: ReCaptcha!
|
||||
private var disposeBag = DisposeBag()
|
||||
|
||||
private var locale: Locale?
|
||||
private var endpoint = ReCaptcha.Endpoint.default
|
||||
|
||||
@IBOutlet private weak var label: UILabel!
|
||||
@IBOutlet private weak var spinner: UIActivityIndicatorView!
|
||||
@IBOutlet private weak var localeSegmentedControl: UISegmentedControl!
|
||||
@IBOutlet private weak var endpointSegmentedControl: UISegmentedControl!
|
||||
@IBOutlet private weak var visibleChallengeSwitch: UISwitch!
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
setupReCaptcha()
|
||||
}
|
||||
|
||||
@IBAction func didPressEndpointSegmentedControl(_ sender: UISegmentedControl) {
|
||||
label.text = ""
|
||||
switch sender.selectedSegmentIndex {
|
||||
case 0: endpoint = .default
|
||||
case 1: endpoint = .alternate
|
||||
default: assertionFailure("invalid index")
|
||||
}
|
||||
|
||||
setupReCaptcha()
|
||||
}
|
||||
|
||||
@IBAction func didPressLocaleSegmentedControl(_ sender: UISegmentedControl) {
|
||||
label.text = ""
|
||||
switch sender.selectedSegmentIndex {
|
||||
case 0: locale = nil
|
||||
case 1: locale = Locale(identifier: "zh-CN")
|
||||
default: assertionFailure("invalid index")
|
||||
}
|
||||
|
||||
setupReCaptcha()
|
||||
}
|
||||
|
||||
@IBAction private func didPressButton(button: UIButton) {
|
||||
disposeBag = DisposeBag()
|
||||
|
||||
let validate = recaptcha.rx.validate(on: view)
|
||||
.debug("validate")
|
||||
.share()
|
||||
|
||||
let isLoading = validate
|
||||
.map { _ in false }
|
||||
.startWith(true)
|
||||
.share(replay: 1)
|
||||
|
||||
isLoading
|
||||
.bind(to: spinner.rx.isAnimating)
|
||||
.disposed(by: disposeBag)
|
||||
|
||||
let isEnabled = isLoading
|
||||
.map { !$0 }
|
||||
.catchErrorJustReturn(false)
|
||||
.share(replay: 1)
|
||||
|
||||
isEnabled
|
||||
.bind(to: button.rx.isEnabled)
|
||||
.disposed(by: disposeBag)
|
||||
|
||||
isEnabled
|
||||
.bind(to: endpointSegmentedControl.rx.isEnabled)
|
||||
.disposed(by: disposeBag)
|
||||
|
||||
validate
|
||||
.map { [weak self] _ in
|
||||
self?.view.viewWithTag(Constants.webViewTag)
|
||||
}
|
||||
.subscribe(onNext: { subview in
|
||||
subview?.removeFromSuperview()
|
||||
})
|
||||
.disposed(by: disposeBag)
|
||||
|
||||
validate
|
||||
.bind(to: label.rx.text)
|
||||
.disposed(by: disposeBag)
|
||||
|
||||
visibleChallengeSwitch.rx.value
|
||||
.subscribe(onNext: { [weak recaptcha] value in
|
||||
recaptcha?.forceVisibleChallenge = value
|
||||
})
|
||||
.disposed(by: disposeBag)
|
||||
}
|
||||
|
||||
private func setupReCaptcha() {
|
||||
// swiftlint:disable:next force_try
|
||||
recaptcha = try! ReCaptcha(endpoint: endpoint, locale: locale)
|
||||
|
||||
recaptcha.configureWebView { [weak self] webview in
|
||||
webview.frame = self?.view.bounds ?? CGRect.zero
|
||||
webview.tag = Constants.webViewTag
|
||||
|
||||
// For testing purposes
|
||||
// If the webview requires presentation, this should work as a way of detecting the webview in UI tests
|
||||
self?.view.viewWithTag(Constants.testLabelTag)?.removeFromSuperview()
|
||||
let label = UILabel(frame: CGRect(x: 0, y: 0, width: 1, height: 1))
|
||||
label.tag = Constants.testLabelTag
|
||||
label.accessibilityLabel = "webview"
|
||||
self?.view.addSubview(label)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
disabled_rules:
|
||||
- type_name
|
||||
- nesting
|
||||
- force_unwrapping
|
||||
- explicit_top_level_acl
|
||||
- function_body_length
|
||||
- identifier_name
|
||||
- file_length
|
||||
- type_body_length
|
||||
|
|
@ -0,0 +1,197 @@
|
|||
//
|
||||
// DispatchQueue__Tests.swift
|
||||
// ReCaptcha
|
||||
//
|
||||
// Created by Flávio Caetano on 21/12/17.
|
||||
// Copyright © 2018 ReCaptcha. All rights reserved.
|
||||
//
|
||||
|
||||
@testable import ReCaptcha
|
||||
import XCTest
|
||||
|
||||
class DispatchQueue__Tests: XCTestCase {
|
||||
override func setUp() {
|
||||
super.setUp()
|
||||
// Put setup code here. This method is called before the invocation of each test method in the class.
|
||||
}
|
||||
|
||||
override func tearDown() {
|
||||
// Put teardown code here. This method is called after the invocation of each test method in the class.
|
||||
super.tearDown()
|
||||
}
|
||||
|
||||
// MARK: Throttle
|
||||
|
||||
func test__Throttle_Nil_Context() {
|
||||
// Execute closure called once
|
||||
let exp0 = expectation(description: "did call single closure")
|
||||
|
||||
DispatchQueue.main.throttle(deadline: .now() + 0.1) {
|
||||
exp0.fulfill()
|
||||
}
|
||||
|
||||
waitForExpectations(timeout: 1)
|
||||
|
||||
// Does not execute first closure
|
||||
let exp1 = expectation(description: "did call last closure")
|
||||
DispatchQueue.main.throttle(deadline: .now() + 0.1) {
|
||||
XCTFail("Shouldn't be called")
|
||||
}
|
||||
|
||||
DispatchQueue.main.throttle(
|
||||
deadline: .now() + 0.1,
|
||||
action: exp1.fulfill
|
||||
)
|
||||
|
||||
waitForExpectations(timeout: 1)
|
||||
}
|
||||
|
||||
func test__Throttle_Context() {
|
||||
// Execute closure called once
|
||||
let exp0 = expectation(description: "did call single closure")
|
||||
let c0 = UUID()
|
||||
|
||||
DispatchQueue.main.throttle(
|
||||
deadline: .now() + 0.1,
|
||||
context: c0,
|
||||
action: exp0.fulfill
|
||||
)
|
||||
|
||||
waitForExpectations(timeout: 1)
|
||||
|
||||
// Does not execute first closure
|
||||
let exp1 = expectation(description: "execute on valid context")
|
||||
let c1 = UUID()
|
||||
DispatchQueue.main.throttle(deadline: .now() + 0.1, context: c1) {
|
||||
XCTFail("Shouldn't be called")
|
||||
}
|
||||
|
||||
DispatchQueue.main.throttle(
|
||||
deadline: .now() + 0.1,
|
||||
context: c1,
|
||||
action: exp1.fulfill
|
||||
)
|
||||
|
||||
// Execute in a different context
|
||||
let exp2 = expectation(description: "execute on different context")
|
||||
let c2 = UUID()
|
||||
DispatchQueue.main.throttle(
|
||||
deadline: .now() + 0.1,
|
||||
context: c2,
|
||||
action: exp2.fulfill
|
||||
)
|
||||
|
||||
waitForExpectations(timeout: 1)
|
||||
}
|
||||
|
||||
// MARK: Debounce
|
||||
|
||||
func test__Debounce_Nil_Context() {
|
||||
// Does not execute sequenced closures
|
||||
let exp0 = expectation(description: "did call first closure")
|
||||
|
||||
DispatchQueue.main.debounce(
|
||||
interval: 0.1,
|
||||
action: exp0.fulfill
|
||||
)
|
||||
|
||||
DispatchQueue.main.debounce(interval: 0) {
|
||||
XCTFail("Shouldn't be called")
|
||||
}
|
||||
|
||||
waitForExpectations(timeout: 1)
|
||||
|
||||
// Executes closure after previous has timed out
|
||||
let exp1 = expectation(description: "did call closure")
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
|
||||
DispatchQueue.main.debounce(
|
||||
interval: 0.1,
|
||||
action: exp1.fulfill
|
||||
)
|
||||
}
|
||||
|
||||
waitForExpectations(timeout: 3)
|
||||
}
|
||||
|
||||
func test__Debounce_Context() {
|
||||
// Does not execute sequenced closures
|
||||
let exp0 = expectation(description: "did call first closure")
|
||||
let c0 = UUID()
|
||||
|
||||
DispatchQueue.main.debounce(
|
||||
interval: 0.1,
|
||||
context: c0,
|
||||
action: exp0.fulfill
|
||||
)
|
||||
|
||||
DispatchQueue.main.debounce(interval: 0, context: c0) {
|
||||
XCTFail("Shouldn't be called")
|
||||
}
|
||||
|
||||
// Execute in a different context
|
||||
let c1 = UUID()
|
||||
let exp1 = expectation(description: "executes in different context")
|
||||
DispatchQueue.main.debounce(
|
||||
interval: 0,
|
||||
context: c1,
|
||||
action: exp1.fulfill
|
||||
)
|
||||
|
||||
waitForExpectations(timeout: 1)
|
||||
|
||||
// Executes closure after previous has timed out
|
||||
let exp2 = expectation(description: "did call closure")
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.2) {
|
||||
DispatchQueue.main.debounce(
|
||||
interval: 0.1,
|
||||
context: c0,
|
||||
action: exp2.fulfill
|
||||
)
|
||||
}
|
||||
|
||||
waitForExpectations(timeout: 5)
|
||||
}
|
||||
|
||||
// MARK: Once
|
||||
|
||||
func test__Once__Single_Dispatch() {
|
||||
let token = 3
|
||||
var dispatchCount = 0
|
||||
|
||||
// Does dispatch the given action
|
||||
DispatchQueue.once(token: token) {
|
||||
dispatchCount = 1
|
||||
}
|
||||
|
||||
XCTAssertEqual(dispatchCount, 1)
|
||||
|
||||
// Does not dispatch again for the same token
|
||||
DispatchQueue.once(token: token) {
|
||||
dispatchCount = 2
|
||||
}
|
||||
|
||||
XCTAssertEqual(dispatchCount, 1)
|
||||
}
|
||||
|
||||
func test__Once__Multiple_Dispatches() {
|
||||
let token1 = 4
|
||||
var didDispatch1 = false
|
||||
|
||||
// Does dispatch the given action
|
||||
DispatchQueue.once(token: token1) {
|
||||
didDispatch1 = true
|
||||
}
|
||||
|
||||
XCTAssertTrue(didDispatch1)
|
||||
|
||||
// Dispatch for a different token
|
||||
let token2 = 6
|
||||
var didDispatch2 = false
|
||||
|
||||
DispatchQueue.once(token: token2) {
|
||||
didDispatch2 = true
|
||||
}
|
||||
|
||||
XCTAssertTrue(didDispatch2)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,167 @@
|
|||
//
|
||||
// ReCaptchaDecoder__Tests.swift
|
||||
// ReCaptcha
|
||||
//
|
||||
// Created by Flávio Caetano on 13/04/17.
|
||||
// Copyright © 2018 ReCaptcha. All rights reserved.
|
||||
//
|
||||
|
||||
@testable import ReCaptcha
|
||||
|
||||
import WebKit
|
||||
import XCTest
|
||||
|
||||
|
||||
class ReCaptchaDecoder__Tests: XCTestCase {
|
||||
fileprivate typealias Result = ReCaptchaDecoder.Result
|
||||
|
||||
fileprivate var assertResult: ((Result) -> Void)?
|
||||
fileprivate var decoder: ReCaptchaDecoder!
|
||||
|
||||
override func setUp() {
|
||||
super.setUp()
|
||||
|
||||
decoder = ReCaptchaDecoder { [weak self] result in
|
||||
self?.assertResult?(result)
|
||||
}
|
||||
}
|
||||
|
||||
override func tearDown() {
|
||||
// Put teardown code here. This method is called after the invocation of each test method in the class.
|
||||
super.tearDown()
|
||||
}
|
||||
|
||||
|
||||
func test__Send_Error() {
|
||||
let exp = expectation(description: "send error message")
|
||||
var result: Result?
|
||||
|
||||
assertResult = { res in
|
||||
result = res
|
||||
exp.fulfill()
|
||||
}
|
||||
|
||||
|
||||
// Send
|
||||
let err = ReCaptchaError.random()
|
||||
decoder.send(error: err)
|
||||
|
||||
waitForExpectations(timeout: 1)
|
||||
|
||||
|
||||
// Check
|
||||
XCTAssertNotNil(result)
|
||||
XCTAssertEqual(result, .error(err))
|
||||
}
|
||||
|
||||
|
||||
func test__Decode__Wrong_Format() {
|
||||
let exp = expectation(description: "send unsupported message")
|
||||
var result: Result?
|
||||
|
||||
assertResult = { res in
|
||||
result = res
|
||||
exp.fulfill()
|
||||
}
|
||||
|
||||
|
||||
// Send
|
||||
let message = MockMessage(message: "foobar")
|
||||
decoder.send(message: message)
|
||||
|
||||
waitForExpectations(timeout: 1)
|
||||
|
||||
|
||||
// Check
|
||||
XCTAssertEqual(result, .error(ReCaptchaError.wrongMessageFormat))
|
||||
}
|
||||
|
||||
|
||||
func test__Decode__Unexpected_Action() {
|
||||
let exp = expectation(description: "send message with unexpected action")
|
||||
var result: Result?
|
||||
|
||||
assertResult = { res in
|
||||
result = res
|
||||
exp.fulfill()
|
||||
}
|
||||
|
||||
|
||||
// Send
|
||||
let message = MockMessage(message: ["action": "bar"])
|
||||
decoder.send(message: message)
|
||||
|
||||
waitForExpectations(timeout: 1)
|
||||
|
||||
|
||||
// Check
|
||||
XCTAssertEqual(result, .error(ReCaptchaError.wrongMessageFormat))
|
||||
}
|
||||
|
||||
|
||||
func test__Decode__ShowReCaptcha() {
|
||||
let exp = expectation(description: "send showReCaptcha message")
|
||||
var result: Result?
|
||||
|
||||
assertResult = { res in
|
||||
result = res
|
||||
exp.fulfill()
|
||||
}
|
||||
|
||||
|
||||
// Send
|
||||
let message = MockMessage(message: ["action": "showReCaptcha"])
|
||||
decoder.send(message: message)
|
||||
|
||||
waitForExpectations(timeout: 1)
|
||||
|
||||
|
||||
// Check
|
||||
XCTAssertEqual(result, .showReCaptcha)
|
||||
}
|
||||
|
||||
|
||||
func test__Decode__Token() {
|
||||
let exp = expectation(description: "send token message")
|
||||
var result: Result?
|
||||
|
||||
assertResult = { res in
|
||||
result = res
|
||||
exp.fulfill()
|
||||
}
|
||||
|
||||
|
||||
// Send
|
||||
let token = String(arc4random())
|
||||
let message = MockMessage(message: ["token": token])
|
||||
decoder.send(message: message)
|
||||
|
||||
waitForExpectations(timeout: 1)
|
||||
|
||||
|
||||
// Check
|
||||
XCTAssertEqual(result, .token(token))
|
||||
}
|
||||
|
||||
|
||||
func test__Decode__DidLoad() {
|
||||
let exp = expectation(description: "send did load message")
|
||||
var result: Result?
|
||||
|
||||
assertResult = { res in
|
||||
result = res
|
||||
exp.fulfill()
|
||||
}
|
||||
|
||||
|
||||
// Send
|
||||
let message = MockMessage(message: ["action": "didLoad"])
|
||||
decoder.send(message: message)
|
||||
|
||||
waitForExpectations(timeout: 1)
|
||||
|
||||
|
||||
// Check
|
||||
XCTAssertEqual(result, .didLoad)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
//
|
||||
// ReCaptchaResult__Tests.swift
|
||||
// ReCaptcha
|
||||
//
|
||||
// Created by Flávio Caetano on 06/03/18.
|
||||
// Copyright © 2018 ReCaptcha. All rights reserved.
|
||||
//
|
||||
|
||||
@testable import ReCaptcha
|
||||
import XCTest
|
||||
|
||||
|
||||
class ReCaptchaResult__Tests: XCTestCase {
|
||||
func test__Get_Token() {
|
||||
let token = UUID().uuidString
|
||||
let result = ReCaptchaResult.token(token)
|
||||
|
||||
do {
|
||||
let value = try result.dematerialize()
|
||||
XCTAssertEqual(value, token)
|
||||
}
|
||||
catch let err {
|
||||
XCTFail(err.localizedDescription)
|
||||
}
|
||||
}
|
||||
|
||||
func test__Get_Token__Error() {
|
||||
let error = ReCaptchaError.random()
|
||||
let result = ReCaptchaResult.error(error)
|
||||
|
||||
do {
|
||||
_ = try result.dematerialize()
|
||||
XCTFail("Shouldn't have completed")
|
||||
}
|
||||
catch let err {
|
||||
XCTAssertEqual(err as? ReCaptchaError, error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,401 @@
|
|||
//
|
||||
// ReCaptchaWebViewManager__Tests.swift
|
||||
// ReCaptcha
|
||||
//
|
||||
// Created by Flávio Caetano on 13/04/17.
|
||||
// Copyright © 2018 ReCaptcha. All rights reserved.
|
||||
//
|
||||
|
||||
@testable import ReCaptcha
|
||||
|
||||
import WebKit
|
||||
import XCTest
|
||||
|
||||
|
||||
class ReCaptchaWebViewManager__Tests: XCTestCase {
|
||||
|
||||
fileprivate var apiKey: String!
|
||||
fileprivate var presenterView: UIView!
|
||||
|
||||
override func setUp() {
|
||||
super.setUp()
|
||||
|
||||
presenterView = UIApplication.shared.keyWindow!
|
||||
apiKey = String(arc4random())
|
||||
}
|
||||
|
||||
override func tearDown() {
|
||||
presenterView = nil
|
||||
apiKey = nil
|
||||
|
||||
super.tearDown()
|
||||
}
|
||||
|
||||
// MARK: Validate
|
||||
|
||||
func test__Validate__Token() {
|
||||
let exp1 = expectation(description: "load token")
|
||||
var result1: ReCaptchaResult?
|
||||
|
||||
// Validate
|
||||
let manager = ReCaptchaWebViewManager(messageBody: "{token: key}", apiKey: apiKey)
|
||||
manager.configureWebView { _ in
|
||||
XCTFail("should not ask to configure the webview")
|
||||
}
|
||||
|
||||
manager.validate(on: presenterView) { response in
|
||||
result1 = response
|
||||
exp1.fulfill()
|
||||
}
|
||||
|
||||
waitForExpectations(timeout: 10)
|
||||
|
||||
|
||||
// Verify
|
||||
XCTAssertNotNil(result1)
|
||||
XCTAssertNil(result1?.error)
|
||||
XCTAssertEqual(result1?.token, apiKey)
|
||||
|
||||
|
||||
// Validate again
|
||||
let exp2 = expectation(description: "reload token")
|
||||
var result2: ReCaptchaResult?
|
||||
|
||||
// Validate
|
||||
manager.validate(on: presenterView) { response in
|
||||
result2 = response
|
||||
exp2.fulfill()
|
||||
}
|
||||
|
||||
waitForExpectations(timeout: 10)
|
||||
|
||||
|
||||
// Verify
|
||||
XCTAssertNotNil(result2)
|
||||
XCTAssertNil(result2?.error)
|
||||
XCTAssertEqual(result2?.token, apiKey)
|
||||
}
|
||||
|
||||
|
||||
func test__Validate__Show_ReCaptcha() {
|
||||
let exp = expectation(description: "show recaptcha")
|
||||
|
||||
// Validate
|
||||
let manager = ReCaptchaWebViewManager(messageBody: "{action: \"showReCaptcha\"}")
|
||||
manager.configureWebView { _ in
|
||||
exp.fulfill()
|
||||
}
|
||||
|
||||
manager.validate(on: presenterView) { _ in
|
||||
XCTFail("should not call completion")
|
||||
}
|
||||
|
||||
waitForExpectations(timeout: 10)
|
||||
}
|
||||
|
||||
|
||||
func test__Validate__Message_Error() {
|
||||
var result: ReCaptchaResult?
|
||||
let exp = expectation(description: "message error")
|
||||
|
||||
// Validate
|
||||
let manager = ReCaptchaWebViewManager(messageBody: "\"foobar\"")
|
||||
manager.configureWebView { _ in
|
||||
XCTFail("should not ask to configure the webview")
|
||||
}
|
||||
|
||||
manager.validate(on: presenterView, resetOnError: false) { response in
|
||||
result = response
|
||||
exp.fulfill()
|
||||
}
|
||||
|
||||
waitForExpectations(timeout: 10)
|
||||
|
||||
// Verify
|
||||
XCTAssertNotNil(result)
|
||||
XCTAssertEqual(result?.error, .wrongMessageFormat)
|
||||
XCTAssertNil(result?.token)
|
||||
}
|
||||
|
||||
func test__Validate__JS_Error() {
|
||||
var result: ReCaptchaResult?
|
||||
let exp = expectation(description: "js error")
|
||||
|
||||
// Validate
|
||||
let manager = ReCaptchaWebViewManager(messageBody: "foobar")
|
||||
manager.configureWebView { _ in
|
||||
XCTFail("should not ask to configure the webview")
|
||||
}
|
||||
|
||||
manager.validate(on: presenterView, resetOnError: false) { response in
|
||||
result = response
|
||||
exp.fulfill()
|
||||
}
|
||||
|
||||
waitForExpectations(timeout: 10)
|
||||
|
||||
// Verify
|
||||
XCTAssertNotNil(result)
|
||||
XCTAssertNotNil(result?.error)
|
||||
XCTAssertNil(result?.token)
|
||||
|
||||
switch result!.error! {
|
||||
case .unexpected(let error as NSError):
|
||||
XCTAssertEqual(error.code, WKError.javaScriptExceptionOccurred.rawValue)
|
||||
default:
|
||||
XCTFail("Unexpected error received")
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: Configure WebView
|
||||
|
||||
func test__Configure_Web_View__Empty() {
|
||||
let exp = expectation(description: "configure webview")
|
||||
|
||||
// Configure WebView
|
||||
let manager = ReCaptchaWebViewManager(messageBody: "{action: \"showReCaptcha\"}")
|
||||
manager.validate(on: presenterView) { _ in
|
||||
XCTFail("should not call completion")
|
||||
}
|
||||
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 2) {
|
||||
exp.fulfill()
|
||||
}
|
||||
|
||||
waitForExpectations(timeout: 10)
|
||||
}
|
||||
|
||||
func test__Configure_Web_View() {
|
||||
let exp = expectation(description: "configure webview")
|
||||
|
||||
// Configure WebView
|
||||
let manager = ReCaptchaWebViewManager(messageBody: "{action: \"showReCaptcha\"}")
|
||||
manager.configureWebView { [unowned self] webView in
|
||||
XCTAssertEqual(webView.superview, self.presenterView)
|
||||
exp.fulfill()
|
||||
}
|
||||
|
||||
manager.validate(on: presenterView) { _ in
|
||||
XCTFail("should not call completion")
|
||||
}
|
||||
|
||||
waitForExpectations(timeout: 10)
|
||||
}
|
||||
|
||||
func test__Configure_Web_View__Called_Once() {
|
||||
var count = 0
|
||||
let exp0 = expectation(description: "configure webview")
|
||||
|
||||
// Configure WebView
|
||||
let manager = ReCaptchaWebViewManager(messageBody: "{action: \"showReCaptcha\"}")
|
||||
manager.configureWebView { _ in
|
||||
if count < 3 {
|
||||
manager.webView.evaluateJavaScript("execute();") { XCTAssertNil($1) }
|
||||
}
|
||||
|
||||
count += 1
|
||||
exp0.fulfill()
|
||||
}
|
||||
|
||||
manager.validate(on: presenterView) { _ in
|
||||
XCTFail("should not call completion")
|
||||
}
|
||||
|
||||
waitForExpectations(timeout: 10)
|
||||
|
||||
let exp1 = expectation(description: "waiting for extra calls")
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 1, execute: exp1.fulfill)
|
||||
waitForExpectations(timeout: 2)
|
||||
|
||||
XCTAssertEqual(count, 1)
|
||||
}
|
||||
|
||||
func test__Configure_Web_View__Called_Again_With_Reset() {
|
||||
let exp0 = expectation(description: "configure webview 0")
|
||||
|
||||
let manager = ReCaptchaWebViewManager(messageBody: "{action: \"showReCaptcha\"}")
|
||||
manager.validate(on: presenterView) { _ in
|
||||
XCTFail("should not call completion")
|
||||
}
|
||||
|
||||
// Configure Webview
|
||||
manager.configureWebView { _ in
|
||||
manager.webView.evaluateJavaScript("execute();") { XCTAssertNil($1) }
|
||||
exp0.fulfill()
|
||||
}
|
||||
|
||||
waitForExpectations(timeout: 10)
|
||||
|
||||
// Reset and ensure it calls again
|
||||
let exp1 = expectation(description: "configure webview 1")
|
||||
|
||||
manager.configureWebView { _ in
|
||||
manager.webView.evaluateJavaScript("execute();") { XCTAssertNil($1) }
|
||||
exp1.fulfill()
|
||||
}
|
||||
|
||||
manager.reset()
|
||||
waitForExpectations(timeout: 10)
|
||||
}
|
||||
|
||||
// MARK: Stop
|
||||
|
||||
func test__Stop() {
|
||||
let exp = expectation(description: "stop loading")
|
||||
|
||||
// Stop
|
||||
let manager = ReCaptchaWebViewManager(messageBody: "{action: \"showReCaptcha\"}")
|
||||
manager.stop()
|
||||
manager.configureWebView { _ in
|
||||
XCTFail("should not ask to configure the webview")
|
||||
}
|
||||
|
||||
manager.validate(on: presenterView) { _ in
|
||||
XCTFail("should not validate")
|
||||
}
|
||||
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 2) {
|
||||
exp.fulfill()
|
||||
}
|
||||
|
||||
waitForExpectations(timeout: 10)
|
||||
}
|
||||
|
||||
// MARK: Setup
|
||||
|
||||
func test__Key_Setup() {
|
||||
let exp = expectation(description: "setup key")
|
||||
var result: ReCaptchaResult?
|
||||
|
||||
// Validate
|
||||
let manager = ReCaptchaWebViewManager(messageBody: "{token: key}", apiKey: apiKey)
|
||||
manager.configureWebView { _ in
|
||||
XCTFail("should not ask to configure the webview")
|
||||
}
|
||||
|
||||
manager.validate(on: presenterView) { response in
|
||||
result = response
|
||||
exp.fulfill()
|
||||
}
|
||||
|
||||
waitForExpectations(timeout: 10)
|
||||
|
||||
XCTAssertNotNil(result)
|
||||
XCTAssertNil(result?.error)
|
||||
XCTAssertEqual(result?.token, apiKey)
|
||||
}
|
||||
|
||||
func test__Endpoint_Setup() {
|
||||
let exp = expectation(description: "setup endpoint")
|
||||
let endpoint = ReCaptcha.Endpoint.alternate.getURL(locale: nil)
|
||||
var result: ReCaptchaResult?
|
||||
|
||||
let manager = ReCaptchaWebViewManager(messageBody: "{token: endpoint}", endpoint: endpoint)
|
||||
manager.configureWebView { _ in
|
||||
XCTFail("should not ask to configure the webview")
|
||||
}
|
||||
|
||||
manager.validate(on: presenterView) { response in
|
||||
result = response
|
||||
exp.fulfill()
|
||||
}
|
||||
|
||||
waitForExpectations(timeout: 10)
|
||||
|
||||
XCTAssertNotNil(result)
|
||||
XCTAssertNil(result?.error)
|
||||
XCTAssertEqual(result?.token, endpoint)
|
||||
}
|
||||
|
||||
// MARK: Reset
|
||||
|
||||
func test__Reset() {
|
||||
let exp1 = expectation(description: "fail on first execution")
|
||||
var result1: ReCaptchaResult?
|
||||
|
||||
// Validate
|
||||
let manager = ReCaptchaWebViewManager(messageBody: "{token: key}", apiKey: apiKey, shouldFail: true)
|
||||
manager.configureWebView { _ in
|
||||
XCTFail("should not ask to configure the webview")
|
||||
}
|
||||
|
||||
// Error
|
||||
manager.validate(on: presenterView, resetOnError: false) { result in
|
||||
result1 = result
|
||||
exp1.fulfill()
|
||||
}
|
||||
|
||||
waitForExpectations(timeout: 10)
|
||||
XCTAssertEqual(result1?.error, .wrongMessageFormat)
|
||||
|
||||
// Resets and tries again
|
||||
let exp2 = expectation(description: "validates after reset")
|
||||
var result2: ReCaptchaResult?
|
||||
|
||||
manager.reset()
|
||||
manager.validate(on: presenterView, resetOnError: false) { result in
|
||||
result2 = result
|
||||
exp2.fulfill()
|
||||
}
|
||||
|
||||
waitForExpectations(timeout: 10)
|
||||
|
||||
XCTAssertNil(result2?.error)
|
||||
XCTAssertEqual(result2?.token, apiKey)
|
||||
}
|
||||
|
||||
func test__Validate__Reset_On_Error() {
|
||||
let exp = expectation(description: "fail on first execution")
|
||||
var result: ReCaptchaResult?
|
||||
|
||||
// Validate
|
||||
let manager = ReCaptchaWebViewManager(messageBody: "{token: key}", apiKey: apiKey, shouldFail: true)
|
||||
manager.configureWebView { _ in
|
||||
XCTFail("should not ask to configure the webview")
|
||||
}
|
||||
|
||||
// Error
|
||||
manager.validate(on: presenterView, resetOnError: true) { response in
|
||||
result = response
|
||||
exp.fulfill()
|
||||
}
|
||||
|
||||
waitForExpectations(timeout: 10)
|
||||
|
||||
XCTAssertNil(result?.error)
|
||||
XCTAssertEqual(result?.token, apiKey)
|
||||
}
|
||||
|
||||
func test__Validate__Should_Skip_For_Tests() {
|
||||
let exp = expectation(description: "did skip validation")
|
||||
|
||||
let manager = ReCaptchaWebViewManager()
|
||||
manager.shouldSkipForTests = true
|
||||
|
||||
manager.completion = { result in
|
||||
XCTAssertEqual(result.token, "")
|
||||
exp.fulfill()
|
||||
}
|
||||
|
||||
manager.validate(on: presenterView)
|
||||
|
||||
waitForExpectations(timeout: 1)
|
||||
}
|
||||
|
||||
// MARK: Force Challenge Visible
|
||||
|
||||
func test__Force_Visible_Challenge() {
|
||||
let manager = ReCaptchaWebViewManager()
|
||||
|
||||
// Initial value
|
||||
XCTAssertFalse(manager.forceVisibleChallenge)
|
||||
|
||||
// Set True
|
||||
manager.forceVisibleChallenge = true
|
||||
XCTAssertEqual(manager.webView.customUserAgent, "Googlebot/2.1")
|
||||
|
||||
// Set False
|
||||
manager.forceVisibleChallenge = false
|
||||
XCTAssertNotEqual(manager.webView.customUserAgent?.isEmpty, false)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
//
|
||||
// ReCaptcha_Endpoint__.swift
|
||||
// ReCaptcha
|
||||
//
|
||||
// Created by Flávio Caetano on 12/07/18.
|
||||
// Copyright © 2018 ReCaptcha. All rights reserved.
|
||||
//
|
||||
|
||||
@testable import ReCaptcha
|
||||
import XCTest
|
||||
|
||||
class ReCaptcha_Endpoint__Tests: XCTestCase {
|
||||
|
||||
private let endpoint = ReCaptcha.Endpoint.default
|
||||
private let endpointURL = "https://www.google.com/recaptcha/api.js?onload=onloadCallback&render=explicit"
|
||||
|
||||
// MARK: - Locale
|
||||
|
||||
func test__Locale__Nil() {
|
||||
XCTAssertEqual(endpoint.getURL(locale: nil), endpointURL)
|
||||
}
|
||||
|
||||
func test__Locale__Valid() {
|
||||
let locale = Locale(identifier: "pt-BR")
|
||||
XCTAssertEqual(endpoint.getURL(locale: locale), "\(endpointURL)&hl=pt-BR")
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,135 @@
|
|||
//
|
||||
// ReCaptcha__Tests.swift
|
||||
// ReCaptcha
|
||||
//
|
||||
// Created by Flávio Caetano on 26/09/17.
|
||||
// Copyright © 2018 ReCaptcha. All rights reserved.
|
||||
//
|
||||
|
||||
import AppSwizzle
|
||||
@testable import ReCaptcha
|
||||
import RxSwift
|
||||
import XCTest
|
||||
|
||||
|
||||
class ReCaptcha__Tests: XCTestCase {
|
||||
fileprivate struct Constants {
|
||||
struct InfoDictKeys {
|
||||
static let APIKey = "ReCaptchaKey"
|
||||
static let Domain = "ReCaptchaDomain"
|
||||
}
|
||||
}
|
||||
|
||||
func test__Fails_Without_HTML_File() {
|
||||
_ = Bundle.swizzleInstanceMethod(
|
||||
origSelector: #selector(Bundle.path(forResource:ofType:)),
|
||||
toAlterSelector: #selector(Bundle.failHTMLLoad(_:type:))
|
||||
)
|
||||
|
||||
do {
|
||||
_ = try ReCaptcha()
|
||||
XCTFail("Should have failed")
|
||||
} catch let e as ReCaptchaError {
|
||||
print(e)
|
||||
XCTAssertEqual(e, ReCaptchaError.htmlLoadError)
|
||||
} catch let e {
|
||||
XCTFail("Unexpected error: \(e)")
|
||||
}
|
||||
|
||||
// Unswizzle
|
||||
_ = Bundle.swizzleInstanceMethod(
|
||||
origSelector: #selector(Bundle.path(forResource:ofType:)),
|
||||
toAlterSelector: #selector(Bundle.failHTMLLoad(_:type:))
|
||||
)
|
||||
}
|
||||
|
||||
func test__Base_URL() {
|
||||
// Ensures baseURL failure when nil
|
||||
do {
|
||||
_ = try ReCaptcha.Config(apiKey: "", infoPlistKey: nil, baseURL: nil, infoPlistURL: nil)
|
||||
XCTFail("Should have failed")
|
||||
} catch let e as ReCaptchaError {
|
||||
print(e)
|
||||
XCTAssertEqual(e, ReCaptchaError.baseURLNotFound)
|
||||
} catch let e {
|
||||
XCTFail("Unexpected error: \(e)")
|
||||
}
|
||||
|
||||
// Ensures plist url if nil key
|
||||
let plistURL = URL(string: "https://bar")!
|
||||
let config1 = try? ReCaptcha.Config(apiKey: "", infoPlistKey: nil, baseURL: nil, infoPlistURL: plistURL)
|
||||
XCTAssertEqual(config1?.baseURL, plistURL)
|
||||
|
||||
// Ensures preference of given url over plist entry
|
||||
let url = URL(string: "ftp://foo")!
|
||||
let config2 = try? ReCaptcha.Config(apiKey: "", infoPlistKey: nil, baseURL: url, infoPlistURL: plistURL)
|
||||
XCTAssertEqual(config2?.baseURL, url)
|
||||
}
|
||||
|
||||
func test__Base_URL_Without_Scheme() {
|
||||
// Ignores URL with scheme
|
||||
let goodURL = URL(string: "https://foo.bar")!
|
||||
let config0 = try? ReCaptcha.Config(apiKey: "", infoPlistKey: nil, baseURL: goodURL, infoPlistURL: nil)
|
||||
XCTAssertEqual(config0?.baseURL, goodURL)
|
||||
|
||||
// Fixes URL without scheme
|
||||
let badURL = URL(string: "foo")!
|
||||
let config = try? ReCaptcha.Config(apiKey: "", infoPlistKey: nil, baseURL: badURL, infoPlistURL: nil)
|
||||
XCTAssertEqual(config?.baseURL.absoluteString, "http://" + badURL.absoluteString)
|
||||
}
|
||||
|
||||
func test__API_Key() {
|
||||
// Ensures key failure when nil
|
||||
do {
|
||||
_ = try ReCaptcha.Config(apiKey: nil, infoPlistKey: nil, baseURL: nil, infoPlistURL: nil)
|
||||
XCTFail("Should have failed")
|
||||
} catch let e as ReCaptchaError {
|
||||
print(e)
|
||||
XCTAssertEqual(e, ReCaptchaError.apiKeyNotFound)
|
||||
} catch let e {
|
||||
XCTFail("Unexpected error: \(e)")
|
||||
}
|
||||
|
||||
// Ensures plist key if nil key
|
||||
let plistKey = "bar"
|
||||
let config1 = try? ReCaptcha.Config(
|
||||
apiKey: nil,
|
||||
infoPlistKey: plistKey,
|
||||
baseURL: URL(string: "foo"),
|
||||
infoPlistURL: nil
|
||||
)
|
||||
XCTAssertEqual(config1?.apiKey, plistKey)
|
||||
|
||||
// Ensures preference of given key over plist entry
|
||||
let key = "foo"
|
||||
let config2 = try? ReCaptcha.Config(
|
||||
apiKey: key,
|
||||
infoPlistKey: plistKey,
|
||||
baseURL: URL(string: "foo"),
|
||||
infoPlistURL: nil
|
||||
)
|
||||
XCTAssertEqual(config2?.apiKey, key)
|
||||
}
|
||||
|
||||
func test__Force_Visible_Challenge() {
|
||||
let recaptcha = ReCaptcha(manager: ReCaptchaWebViewManager())
|
||||
|
||||
// Initial value
|
||||
XCTAssertFalse(recaptcha.forceVisibleChallenge)
|
||||
|
||||
// Set true
|
||||
recaptcha.forceVisibleChallenge = true
|
||||
XCTAssertTrue(recaptcha.forceVisibleChallenge)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private extension Bundle {
|
||||
@objc func failHTMLLoad(_ resource: String, type: String) -> String? {
|
||||
guard resource == "recaptcha" && type == "html" else {
|
||||
return failHTMLLoad(resource, type: type)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
//
|
||||
// ReCaptchaDecoder+Helper.swift
|
||||
// ReCaptcha
|
||||
//
|
||||
// Created by Flávio Caetano on 22/12/17.
|
||||
// Copyright © 2018 ReCaptcha. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
@testable import ReCaptcha
|
||||
import WebKit
|
||||
|
||||
class MockMessage: WKScriptMessage {
|
||||
override var body: Any {
|
||||
return storedBody
|
||||
}
|
||||
|
||||
fileprivate let storedBody: Any
|
||||
|
||||
init(message: Any) {
|
||||
storedBody = message
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Decoder Helpers
|
||||
extension ReCaptchaDecoder {
|
||||
func send(message: MockMessage) {
|
||||
userContentController(WKUserContentController(), didReceive: message)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Result Helpers
|
||||
extension ReCaptchaDecoder.Result: Equatable {
|
||||
var error: ReCaptchaError? {
|
||||
guard case .error(let error) = self else { return nil }
|
||||
return error
|
||||
}
|
||||
|
||||
public static func == (lhs: ReCaptchaDecoder.Result, rhs: ReCaptchaDecoder.Result) -> Bool {
|
||||
switch (lhs, rhs) {
|
||||
case (.showReCaptcha, .showReCaptcha),
|
||||
(.didLoad, .didLoad):
|
||||
return true
|
||||
|
||||
case (.token(let lht), .token(let rht)):
|
||||
return lht == rht
|
||||
|
||||
case (.error(let lhe), .error(let rhe)):
|
||||
return lhe == rhe
|
||||
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
//
|
||||
// ReCaptchaError+Equatable.swift
|
||||
// ReCaptcha
|
||||
//
|
||||
// Created by Flávio Caetano on 16/10/17.
|
||||
// Copyright © 2018 ReCaptcha. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
@testable import ReCaptcha
|
||||
|
||||
extension ReCaptchaError: Equatable {
|
||||
public static func == (lhs: ReCaptchaError, rhs: ReCaptchaError) -> Bool {
|
||||
switch (lhs, rhs) {
|
||||
case (.htmlLoadError, .htmlLoadError),
|
||||
(.apiKeyNotFound, .apiKeyNotFound),
|
||||
(.baseURLNotFound, .baseURLNotFound),
|
||||
(.wrongMessageFormat, .wrongMessageFormat):
|
||||
return true
|
||||
case (.unexpected(let lhe as NSError), .unexpected(let rhe as NSError)):
|
||||
return lhe == rhe
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
static func random() -> ReCaptchaError {
|
||||
switch arc4random_uniform(4) {
|
||||
case 0: return .htmlLoadError
|
||||
case 1: return .apiKeyNotFound
|
||||
case 2: return .baseURLNotFound
|
||||
case 3: return .wrongMessageFormat
|
||||
default: return .unexpected(NSError())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
//
|
||||
// ReCaptchaWebViewManager+Helpers.swift
|
||||
// ReCaptcha
|
||||
//
|
||||
// Created by Flávio Caetano on 13/04/17.
|
||||
// Copyright © 2018 ReCaptcha. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
@testable import ReCaptcha
|
||||
import WebKit
|
||||
|
||||
extension ReCaptchaWebViewManager {
|
||||
private static let unformattedHTML: String! = {
|
||||
Bundle(for: ReCaptchaWebViewManager__Tests.self)
|
||||
.path(forResource: "mock", ofType: "html")
|
||||
.flatMap { try? String(contentsOfFile: $0) }
|
||||
}()
|
||||
|
||||
convenience init(
|
||||
messageBody: String = "",
|
||||
apiKey: String? = nil,
|
||||
endpoint: String? = nil,
|
||||
shouldFail: Bool = false
|
||||
) {
|
||||
let localhost = URL(string: "http://localhost")!
|
||||
let html = String(format: ReCaptchaWebViewManager.unformattedHTML, arguments: [
|
||||
"message": messageBody,
|
||||
"shouldFail": shouldFail.description
|
||||
])
|
||||
|
||||
self.init(
|
||||
html: html,
|
||||
apiKey: apiKey ?? String(arc4random()),
|
||||
baseURL: localhost,
|
||||
endpoint: endpoint ?? localhost.absoluteString
|
||||
)
|
||||
}
|
||||
|
||||
func configureWebView(_ configure: @escaping (WKWebView) -> Void) {
|
||||
configureWebView = configure
|
||||
}
|
||||
|
||||
func validate(on view: UIView, resetOnError: Bool = true, completion: @escaping (ReCaptchaResult) -> Void) {
|
||||
self.shouldResetOnError = resetOnError
|
||||
self.completion = completion
|
||||
|
||||
validate(on: view)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
//
|
||||
// Result+Helpers.swift
|
||||
// ReCaptcha
|
||||
//
|
||||
// Created by Flávio Caetano on 13/04/17.
|
||||
// Copyright © 2018 ReCaptcha. All rights reserved.
|
||||
//
|
||||
|
||||
@testable import ReCaptcha
|
||||
|
||||
|
||||
extension ReCaptchaResult {
|
||||
var token: String? {
|
||||
guard case .token(let value) = self else { return nil }
|
||||
return value
|
||||
}
|
||||
|
||||
var error: ReCaptchaError? {
|
||||
guard case .error(let error) = self else { return nil }
|
||||
return error
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>BNDL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
@ -0,0 +1,189 @@
|
|||
//
|
||||
// ReCaptcha+Rx__Tests.swift
|
||||
// ReCaptcha
|
||||
//
|
||||
// Created by Flávio Caetano on 13/04/17.
|
||||
// Copyright © 2018 ReCaptcha. All rights reserved.
|
||||
//
|
||||
|
||||
@testable import ReCaptcha
|
||||
|
||||
import RxBlocking
|
||||
import RxCocoa
|
||||
import RxSwift
|
||||
import XCTest
|
||||
|
||||
|
||||
class ReCaptcha_Rx__Tests: XCTestCase {
|
||||
|
||||
fileprivate var apiKey: String!
|
||||
fileprivate var presenterView: UIView!
|
||||
|
||||
override func setUp() {
|
||||
super.setUp()
|
||||
|
||||
presenterView = UIApplication.shared.keyWindow!
|
||||
apiKey = String(arc4random())
|
||||
}
|
||||
|
||||
override func tearDown() {
|
||||
presenterView = nil
|
||||
apiKey = nil
|
||||
|
||||
super.tearDown()
|
||||
}
|
||||
|
||||
|
||||
func test__Validate__Token() {
|
||||
let recaptcha = ReCaptcha(manager: ReCaptchaWebViewManager(messageBody: "{token: key}", apiKey: apiKey))
|
||||
recaptcha.configureWebView { _ in
|
||||
XCTFail("should not ask to configure the webview")
|
||||
}
|
||||
|
||||
do {
|
||||
// Validate
|
||||
let result = try recaptcha.rx.validate(on: presenterView)
|
||||
.toBlocking()
|
||||
.single()
|
||||
|
||||
// Verify
|
||||
XCTAssertEqual(result, apiKey)
|
||||
}
|
||||
catch let error {
|
||||
XCTFail(error.localizedDescription)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
func test__Validate__Show_ReCaptcha() {
|
||||
let recaptcha = ReCaptcha(
|
||||
manager: ReCaptchaWebViewManager(messageBody: "{action: \"showReCaptcha\"}", apiKey: apiKey)
|
||||
)
|
||||
|
||||
var didConfigureWebView = false
|
||||
|
||||
recaptcha.configureWebView { _ in
|
||||
didConfigureWebView = true
|
||||
}
|
||||
|
||||
do {
|
||||
// Validate
|
||||
_ = try recaptcha.rx.validate(on: presenterView)
|
||||
.timeout(2, scheduler: MainScheduler.instance)
|
||||
.toBlocking()
|
||||
.single()
|
||||
|
||||
XCTFail("should have thrown exception")
|
||||
}
|
||||
catch let error {
|
||||
XCTAssertEqual(String(describing: error), RxError.timeout.debugDescription)
|
||||
XCTAssertTrue(didConfigureWebView)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
func test__Validate__Error() {
|
||||
let recaptcha = ReCaptcha(manager: ReCaptchaWebViewManager(messageBody: "\"foobar\"", apiKey: apiKey))
|
||||
recaptcha.configureWebView { _ in
|
||||
XCTFail("should not ask to configure the webview")
|
||||
}
|
||||
|
||||
do {
|
||||
// Validate
|
||||
_ = try recaptcha.rx.validate(on: presenterView, resetOnError: false)
|
||||
.toBlocking()
|
||||
.single()
|
||||
|
||||
XCTFail("should have thrown exception")
|
||||
}
|
||||
catch let error {
|
||||
XCTAssertEqual(error as? ReCaptchaError, .wrongMessageFormat)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: Dispose
|
||||
|
||||
func test__Dispose() {
|
||||
let exp = expectation(description: "stop loading")
|
||||
|
||||
// Stop
|
||||
let recaptcha = ReCaptcha(manager: ReCaptchaWebViewManager(messageBody: "{log: \"foo\"}"))
|
||||
recaptcha.configureWebView { _ in
|
||||
XCTFail("should not ask to configure the webview")
|
||||
}
|
||||
|
||||
let disposable = recaptcha.rx.validate(on: presenterView)
|
||||
.do(onDispose: exp.fulfill)
|
||||
.subscribe { _ in
|
||||
XCTFail("should not validate")
|
||||
}
|
||||
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
|
||||
disposable.dispose()
|
||||
}
|
||||
|
||||
waitForExpectations(timeout: 10)
|
||||
}
|
||||
|
||||
// MARK: Reset
|
||||
|
||||
func test__Reset() {
|
||||
// Validate
|
||||
let recaptcha = ReCaptcha(
|
||||
manager: ReCaptchaWebViewManager(messageBody: "{token: key}", apiKey: apiKey, shouldFail: true)
|
||||
)
|
||||
|
||||
recaptcha.configureWebView { _ in
|
||||
XCTFail("should not ask to configure the webview")
|
||||
}
|
||||
|
||||
do {
|
||||
// Error
|
||||
_ = try recaptcha.rx.validate(on: presenterView, resetOnError: false)
|
||||
.toBlocking()
|
||||
.single()
|
||||
}
|
||||
catch let error {
|
||||
XCTAssertEqual(error as? ReCaptchaError, .wrongMessageFormat)
|
||||
|
||||
// Resets after failure
|
||||
_ = Observable<Void>.just(())
|
||||
.bind(to: recaptcha.rx.reset)
|
||||
}
|
||||
|
||||
do {
|
||||
// Resets and tries again
|
||||
let result = try recaptcha.rx.validate(on: presenterView, resetOnError: false)
|
||||
.toBlocking()
|
||||
.single()
|
||||
|
||||
XCTAssertEqual(result, apiKey)
|
||||
}
|
||||
catch let error {
|
||||
XCTFail(error.localizedDescription)
|
||||
}
|
||||
}
|
||||
|
||||
func test__Validate__Reset_On_Error() {
|
||||
// Validate
|
||||
let recaptcha = ReCaptcha(
|
||||
manager: ReCaptchaWebViewManager(messageBody: "{token: key}", apiKey: apiKey, shouldFail: true)
|
||||
)
|
||||
|
||||
recaptcha.configureWebView { _ in
|
||||
XCTFail("should not ask to configure the webview")
|
||||
}
|
||||
|
||||
do {
|
||||
// Error
|
||||
let result = try recaptcha.rx.validate(on: presenterView, resetOnError: true)
|
||||
.toBlocking()
|
||||
.single()
|
||||
|
||||
XCTAssertEqual(result, apiKey)
|
||||
}
|
||||
catch let error {
|
||||
XCTFail(error.localizedDescription)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
<script type="text/javascript">
|
||||
var key = "${apiKey}";
|
||||
var endpoint = "${endpoint}";
|
||||
var shouldFail = ${shouldFail};
|
||||
|
||||
var post = function(value) {
|
||||
window.webkit.messageHandlers.recaptcha.postMessage(value);
|
||||
};
|
||||
|
||||
var execute = function() {
|
||||
if (shouldFail) {
|
||||
post("error");
|
||||
}
|
||||
else {
|
||||
post(${message});
|
||||
}
|
||||
};
|
||||
|
||||
var reset = function() {
|
||||
shouldFail = false;
|
||||
post({action: "didLoad"});
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<span id="submit" style="visibility: hidden;"></span>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
disabled_rules:
|
||||
- type_name
|
||||
- nesting
|
||||
- force_unwrapping
|
||||
- explicit_top_level_acl
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>BNDL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
//
|
||||
// ReCaptcha_UITests.swift
|
||||
// ReCaptcha
|
||||
//
|
||||
// Created by Flávio Caetano on 16/01/18.
|
||||
// Copyright © 2018 ReCaptcha. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
@testable import ReCaptcha
|
||||
@testable import ReCaptcha_Example
|
||||
import XCTest
|
||||
|
||||
class ReCaptcha_UITests: XCTestCase {
|
||||
|
||||
override func setUp() {
|
||||
super.setUp()
|
||||
|
||||
// In UI tests it is usually best to stop immediately when a failure occurs.
|
||||
continueAfterFailure = false
|
||||
XCUIApplication().launch()
|
||||
}
|
||||
|
||||
func test__Validate__Default_Endpoint() {
|
||||
let app = XCUIApplication()
|
||||
app.segmentedControls.buttons["Default Endpoint"].tap()
|
||||
app.switches["Switch"].tap()
|
||||
app.buttons["Validate"].tap()
|
||||
|
||||
verifyValidation()
|
||||
}
|
||||
|
||||
func test__Validate__Alternate_Endpoint() {
|
||||
let app = XCUIApplication()
|
||||
app.segmentedControls.buttons["Alternate"].tap()
|
||||
app.switches["Switch"].tap()
|
||||
app.buttons["Validate"].tap()
|
||||
|
||||
verifyValidation()
|
||||
}
|
||||
|
||||
// MARK: Private Methods
|
||||
|
||||
private func verifyValidation() {
|
||||
let app = XCUIApplication()
|
||||
let webview = app.staticTexts.element(matching: .any, identifier: "webview")
|
||||
let webviewExists = webview.waitForExistence(timeout: 10)
|
||||
|
||||
XCTAssertTrue(webviewExists)
|
||||
}
|
||||
}
|
||||
112
Extensions.html
112
Extensions.html
|
|
@ -1,112 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Extensions Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="js/jquery.min.js" defer></script>
|
||||
<script src="js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a title="Extensions Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="index.html">ReCaptcha Docs</a> (100% documented)</p>
|
||||
<p class="header-right"><a href="https://github.com/fjcaetano/ReCaptcha"><img src="img/gh.png"/>View on GitHub</a></p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="index.html">ReCaptcha Reference</a>
|
||||
<img id="carat" src="img/carat.png" />
|
||||
Extensions Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/ReCaptcha.html">ReCaptcha</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/ReCaptcha/Endpoint.html">– Endpoint</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="Enums.html">Enumerations</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="Enums/ReCaptchaError.html">ReCaptchaError</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Enums/ReCaptchaResult.html">ReCaptchaResult</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="Extensions.html">Extensions</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="Extensions/Reactive.html">Reactive</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>Extensions</h1>
|
||||
<p>The following extensions are available globally.</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:7RxSwift8ReactiveV"></a>
|
||||
<a name="//apple_ref/swift/Extension/Reactive" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:7RxSwift8ReactiveV">Reactive</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Provides a public extension on ReCaptcha that makes it reactive.</p>
|
||||
|
||||
<a href="Extensions/Reactive.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">struct</span> <span class="kt">Reactive</span><span class="o"><</span><span class="kt">Base</span><span class="o">></span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/fjcaetano" target="_blank" rel="external">Flávio Caetano (@fjcaetano)</a>. All rights reserved. (Last updated: 2018-09-28)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
|
|
@ -1,232 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>DispatchQueue Extension Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="../js/jquery.min.js" defer></script>
|
||||
<script src="../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a name="//apple_ref/swift/Extension/DispatchQueue" class="dashAnchor"></a>
|
||||
<a title="DispatchQueue Extension Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../index.html">ReCaptcha Docs</a> (87% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../index.html">ReCaptcha Reference</a>
|
||||
<img id="carat" src="../img/carat.png" />
|
||||
DispatchQueue Extension Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ReCaptcha.html">ReCaptcha</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ReCaptcha/Constants.html">– Constants</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ReCaptcha/Endpoint.html">– Endpoint</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ReCaptcha/Config.html">– Config</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ReCaptchaDecoder.html">ReCaptchaDecoder</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ReCaptchaDecoder/Result.html">– Result</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ReCaptchaWebViewManager.html">ReCaptchaWebViewManager</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ReCaptchaWebViewManager/WebViewDelegate.html">– WebViewDelegate</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ReCaptchaWebViewManager/Constants.html">– Constants</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../Enums.html">Enumerations</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Enums/ReCaptchaError.html">ReCaptchaError</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../Extensions.html">Extensions</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Extensions/DispatchQueue.html">DispatchQueue</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Extensions/Reactive.html">Reactive</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Extensions/String.html">String</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>DispatchQueue</h1>
|
||||
<p>Adds throttling to dispatch queues</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:So13DispatchQueueC9ReCaptchaE9workItems33_A71C1F561DF67E81B642ECB4A19E19BELLs10DictionaryVys11AnyHashableV0A00A8WorkItemCGvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/workItems" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:So13DispatchQueueC9ReCaptchaE9workItems33_A71C1F561DF67E81B642ECB4A19E19BELLs10DictionaryVys11AnyHashableV0A00A8WorkItemCGvZ">workItems</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Stores a throttle DispatchWorkItem instance for a given context</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">private</span> <span class="kd">static</span> <span class="k">var</span> <span class="nv">workItems</span> <span class="o">=</span> <span class="p">[</span><span class="kt">AnyHashable</span><span class="p">:</span> <span class="kt">DispatchWorkItem</span><span class="p">]()</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:So13DispatchQueueC9ReCaptchaE10nilContext33_A71C1F561DF67E81B642ECB4A19E19BELL10Foundation4UUIDVvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/nilContext" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:So13DispatchQueueC9ReCaptchaE10nilContext33_A71C1F561DF67E81B642ECB4A19E19BELL10Foundation4UUIDVvZ">nilContext</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>An object representing a context if none is given</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">private</span> <span class="kd">static</span> <span class="k">let</span> <span class="nv">nilContext</span> <span class="o">=</span> <span class="kt">UUID</span><span class="p">()</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:So13DispatchQueueC9ReCaptchaE8throttley0A00A4TimeV8deadline_s11AnyHashableV7contextyyc6actiontF"></a>
|
||||
<a name="//apple_ref/swift/Method/throttle(deadline:context:action:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:So13DispatchQueueC9ReCaptchaE8throttley0A00A4TimeV8deadline_s11AnyHashableV7contextyyc6actiontF">throttle(deadline:context:action:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Delays a closure execution and ensures no other executions are made during deadline for that context</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">func</span> <span class="nf">throttle</span><span class="p">(</span><span class="nv">deadline</span><span class="p">:</span> <span class="kt">DispatchTime</span><span class="p">,</span> <span class="nv">context</span><span class="p">:</span> <span class="kt">AnyHashable</span> <span class="o">=</span> <span class="n"><a href="../Extensions/DispatchQueue.html#/s:So13DispatchQueueC9ReCaptchaE10nilContext33_A71C1F561DF67E81B642ECB4A19E19BELL10Foundation4UUIDVvZ">nilContext</a></span><span class="p">,</span> <span class="nv">action</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">()</span> <span class="o">-></span> <span class="kt">Void</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>deadline</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The timespan to delay a closure execution</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>context</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The context in which the throttle should be executed</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>action</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The closure to be executed</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/fjcaetano/ReCaptcha" target="_blank" rel="external">Flávio Caetano</a>. All rights reserved. (Last updated: 2018-03-06)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
|
|
@ -1,197 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Reactive Extension Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="../js/jquery.min.js" defer></script>
|
||||
<script src="../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a name="//apple_ref/swift/Extension/Reactive" class="dashAnchor"></a>
|
||||
<a title="Reactive Extension Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../index.html">ReCaptcha Docs</a> (100% documented)</p>
|
||||
<p class="header-right"><a href="https://github.com/fjcaetano/ReCaptcha"><img src="../img/gh.png"/>View on GitHub</a></p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../index.html">ReCaptcha Reference</a>
|
||||
<img id="carat" src="../img/carat.png" />
|
||||
Reactive Extension Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ReCaptcha.html">ReCaptcha</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ReCaptcha/Endpoint.html">– Endpoint</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../Enums.html">Enumerations</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Enums/ReCaptchaError.html">ReCaptchaError</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Enums/ReCaptchaResult.html">ReCaptchaResult</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../Extensions.html">Extensions</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Extensions/Reactive.html">Reactive</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>Reactive</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">struct</span> <span class="kt">Reactive</span><span class="o"><</span><span class="kt">Base</span><span class="o">></span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p>Provides a public extension on ReCaptcha that makes it reactive.</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:7RxSwift8ReactiveV9ReCaptchaA2DCRbzlE8validate2on12resetOnErrorAA10ObservableCySSGSo6UIViewC_SbtF"></a>
|
||||
<a name="//apple_ref/swift/Method/validate(on:resetOnError:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:7RxSwift8ReactiveV9ReCaptchaA2DCRbzlE8validate2on12resetOnErrorAA10ObservableCySSGSo6UIViewC_SbtF">validate(on:resetOnError:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Starts the challenge validation uppon subscription.</p>
|
||||
|
||||
<p>The stream’s element is a String with the validation token.</p>
|
||||
|
||||
<p>Sends <code>stop()</code> uppon disposal.</p>
|
||||
<div class="aside aside-see">
|
||||
<p class="aside-title">See</p>
|
||||
<code><a href="../Classes/ReCaptcha.html#/s:9ReCaptchaAAC8validate2on12resetOnError10completionySo6UIViewC_SbyAA0aB6ResultOctF">ReCaptcha.validate(on:resetOnError:completion:)</a></code>
|
||||
|
||||
</div>
|
||||
<div class="aside aside-see">
|
||||
<p class="aside-title">See</p>
|
||||
<code><a href="../Classes/ReCaptcha.html#/s:9ReCaptchaAAC4stopyyF">ReCaptcha.stop()</a></code>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">func</span> <span class="nf">validate</span><span class="p">(</span><span class="n">on</span> <span class="nv">view</span><span class="p">:</span> <span class="kt">UIView</span><span class="p">,</span> <span class="nv">resetOnError</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">true</span><span class="p">)</span> <span class="o">-></span> <span class="kt">Observable</span><span class="o"><</span><span class="kt">String</span><span class="o">></span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>view</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The view that should present the webview.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>resetOnError</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>If ReCaptcha should be reset if it errors. Defaults to <code>true</code></p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:7RxSwift8ReactiveV9ReCaptchaA2DCRbzlE5resetAA11AnyObserverVyytGvp"></a>
|
||||
<a name="//apple_ref/swift/Property/reset" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:7RxSwift8ReactiveV9ReCaptchaA2DCRbzlE5resetAA11AnyObserverVyytGvp">reset</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Resets the ReCaptcha.</p>
|
||||
|
||||
<p>The reset is achieved by calling <code>grecaptcha.reset()</code> on the JS API.</p>
|
||||
<div class="aside aside-see">
|
||||
<p class="aside-title">See</p>
|
||||
<code><a href="../Classes/ReCaptcha.html#/s:9ReCaptchaAAC5resetyyF">ReCaptcha.reset()</a></code>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">var</span> <span class="nv">reset</span><span class="p">:</span> <span class="kt">AnyObserver</span><span class="o"><</span><span class="kt">Void</span><span class="o">></span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/fjcaetano" target="_blank" rel="external">Flávio Caetano (@fjcaetano)</a>. All rights reserved. (Last updated: 2018-09-28)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
|
|
@ -1,179 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>String Extension Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="../js/jquery.min.js" defer></script>
|
||||
<script src="../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a name="//apple_ref/swift/Extension/String" class="dashAnchor"></a>
|
||||
<a title="String Extension Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../index.html">ReCaptcha Docs</a> (87% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../index.html">ReCaptcha Reference</a>
|
||||
<img id="carat" src="../img/carat.png" />
|
||||
String Extension Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ReCaptcha.html">ReCaptcha</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ReCaptcha/Constants.html">– Constants</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ReCaptcha/Endpoint.html">– Endpoint</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ReCaptcha/Config.html">– Config</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ReCaptchaDecoder.html">ReCaptchaDecoder</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ReCaptchaDecoder/Result.html">– Result</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ReCaptchaWebViewManager.html">ReCaptchaWebViewManager</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ReCaptchaWebViewManager/WebViewDelegate.html">– WebViewDelegate</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ReCaptchaWebViewManager/Constants.html">– Constants</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../Enums.html">Enumerations</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Enums/ReCaptchaError.html">ReCaptchaError</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../Extensions.html">Extensions</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Extensions/DispatchQueue.html">DispatchQueue</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Extensions/Reactive.html">Reactive</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Extensions/String.html">String</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>String</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">struct</span> <span class="kt">String</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:SS9ReCaptchaES2S6format_s10DictionaryVySSs23CustomStringConvertible_pG9argumentstcfc"></a>
|
||||
<a name="//apple_ref/swift/Method/init(format:arguments:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:SS9ReCaptchaES2S6format_s10DictionaryVySSs23CustomStringConvertible_pG9argumentstcfc">init(format:arguments:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Parses a format string using a dictionary of arguments</p>
|
||||
|
||||
<p>Replaces occurrences of <code>"${key}"</code> with their respective values.</p>
|
||||
<pre class="highlight plaintext"><code>String(format: "Hello, ${user}", ["user": "Flavio"]) // Hello, Flavio
|
||||
</code></pre>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="nf">init</span><span class="p">(</span><span class="nv">format</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span> <span class="nv">arguments</span><span class="p">:</span> <span class="p">[</span><span class="kt">String</span><span class="p">:</span> <span class="kt">CustomStringConvertible</span><span class="p">])</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>format</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The string to be formatted.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>arguments</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>A dictionary containing the which keys should be replaced by which values.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>A formatted string</p>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/fjcaetano/ReCaptcha" target="_blank" rel="external">Flávio Caetano</a>. All rights reserved. (Last updated: 2018-03-06)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
source 'https://rubygems.org'
|
||||
|
||||
gem 'fastlane', '~> 2.105.2'
|
||||
gem 'cocoapods', '~> 1.5.3'
|
||||
|
|
@ -0,0 +1,201 @@
|
|||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
CFPropertyList (3.0.0)
|
||||
activesupport (4.2.10)
|
||||
i18n (~> 0.7)
|
||||
minitest (~> 5.1)
|
||||
thread_safe (~> 0.3, >= 0.3.4)
|
||||
tzinfo (~> 1.1)
|
||||
addressable (2.5.2)
|
||||
public_suffix (>= 2.0.2, < 4.0)
|
||||
atomos (0.1.3)
|
||||
babosa (1.0.2)
|
||||
claide (1.0.2)
|
||||
cocoapods (1.5.3)
|
||||
activesupport (>= 4.0.2, < 5)
|
||||
claide (>= 1.0.2, < 2.0)
|
||||
cocoapods-core (= 1.5.3)
|
||||
cocoapods-deintegrate (>= 1.0.2, < 2.0)
|
||||
cocoapods-downloader (>= 1.2.0, < 2.0)
|
||||
cocoapods-plugins (>= 1.0.0, < 2.0)
|
||||
cocoapods-search (>= 1.0.0, < 2.0)
|
||||
cocoapods-stats (>= 1.0.0, < 2.0)
|
||||
cocoapods-trunk (>= 1.3.0, < 2.0)
|
||||
cocoapods-try (>= 1.1.0, < 2.0)
|
||||
colored2 (~> 3.1)
|
||||
escape (~> 0.0.4)
|
||||
fourflusher (~> 2.0.1)
|
||||
gh_inspector (~> 1.0)
|
||||
molinillo (~> 0.6.5)
|
||||
nap (~> 1.0)
|
||||
ruby-macho (~> 1.1)
|
||||
xcodeproj (>= 1.5.7, < 2.0)
|
||||
cocoapods-core (1.5.3)
|
||||
activesupport (>= 4.0.2, < 6)
|
||||
fuzzy_match (~> 2.0.4)
|
||||
nap (~> 1.0)
|
||||
cocoapods-deintegrate (1.0.2)
|
||||
cocoapods-downloader (1.2.1)
|
||||
cocoapods-plugins (1.0.0)
|
||||
nap
|
||||
cocoapods-search (1.0.0)
|
||||
cocoapods-stats (1.0.0)
|
||||
cocoapods-trunk (1.3.1)
|
||||
nap (>= 0.8, < 2.0)
|
||||
netrc (~> 0.11)
|
||||
cocoapods-try (1.1.0)
|
||||
colored (1.2)
|
||||
colored2 (3.1.2)
|
||||
commander-fastlane (4.4.6)
|
||||
highline (~> 1.7.2)
|
||||
concurrent-ruby (1.0.5)
|
||||
declarative (0.0.10)
|
||||
declarative-option (0.1.0)
|
||||
domain_name (0.5.20180417)
|
||||
unf (>= 0.0.5, < 1.0.0)
|
||||
dotenv (2.5.0)
|
||||
emoji_regex (0.1.1)
|
||||
escape (0.0.4)
|
||||
excon (0.62.0)
|
||||
faraday (0.15.3)
|
||||
multipart-post (>= 1.2, < 3)
|
||||
faraday-cookie_jar (0.0.6)
|
||||
faraday (>= 0.7.4)
|
||||
http-cookie (~> 1.0.0)
|
||||
faraday_middleware (0.12.2)
|
||||
faraday (>= 0.7.4, < 1.0)
|
||||
fastimage (2.1.4)
|
||||
fastlane (2.105.2)
|
||||
CFPropertyList (>= 2.3, < 4.0.0)
|
||||
addressable (>= 2.3, < 3.0.0)
|
||||
babosa (>= 1.0.2, < 2.0.0)
|
||||
bundler (>= 1.12.0, < 2.0.0)
|
||||
colored
|
||||
commander-fastlane (>= 4.4.6, < 5.0.0)
|
||||
dotenv (>= 2.1.1, < 3.0.0)
|
||||
emoji_regex (~> 0.1)
|
||||
excon (>= 0.45.0, < 1.0.0)
|
||||
faraday (~> 0.9)
|
||||
faraday-cookie_jar (~> 0.0.6)
|
||||
faraday_middleware (~> 0.9)
|
||||
fastimage (>= 2.1.0, < 3.0.0)
|
||||
gh_inspector (>= 1.1.2, < 2.0.0)
|
||||
google-api-client (>= 0.21.2, < 0.24.0)
|
||||
highline (>= 1.7.2, < 2.0.0)
|
||||
json (< 3.0.0)
|
||||
mini_magick (~> 4.5.1)
|
||||
multi_json
|
||||
multi_xml (~> 0.5)
|
||||
multipart-post (~> 2.0.0)
|
||||
plist (>= 3.1.0, < 4.0.0)
|
||||
public_suffix (~> 2.0.0)
|
||||
rubyzip (>= 1.2.2, < 2.0.0)
|
||||
security (= 0.1.3)
|
||||
simctl (~> 1.6.3)
|
||||
slack-notifier (>= 2.0.0, < 3.0.0)
|
||||
terminal-notifier (>= 1.6.2, < 2.0.0)
|
||||
terminal-table (>= 1.4.5, < 2.0.0)
|
||||
tty-screen (>= 0.6.3, < 1.0.0)
|
||||
tty-spinner (>= 0.8.0, < 1.0.0)
|
||||
word_wrap (~> 1.0.0)
|
||||
xcodeproj (>= 1.6.0, < 2.0.0)
|
||||
xcpretty (~> 0.3.0)
|
||||
xcpretty-travis-formatter (>= 0.0.3)
|
||||
fourflusher (2.0.1)
|
||||
fuzzy_match (2.0.4)
|
||||
gh_inspector (1.1.3)
|
||||
google-api-client (0.23.9)
|
||||
addressable (~> 2.5, >= 2.5.1)
|
||||
googleauth (>= 0.5, < 0.7.0)
|
||||
httpclient (>= 2.8.1, < 3.0)
|
||||
mime-types (~> 3.0)
|
||||
representable (~> 3.0)
|
||||
retriable (>= 2.0, < 4.0)
|
||||
signet (~> 0.9)
|
||||
googleauth (0.6.6)
|
||||
faraday (~> 0.12)
|
||||
jwt (>= 1.4, < 3.0)
|
||||
memoist (~> 0.12)
|
||||
multi_json (~> 1.11)
|
||||
os (>= 0.9, < 2.0)
|
||||
signet (~> 0.7)
|
||||
highline (1.7.10)
|
||||
http-cookie (1.0.3)
|
||||
domain_name (~> 0.5)
|
||||
httpclient (2.8.3)
|
||||
i18n (0.9.5)
|
||||
concurrent-ruby (~> 1.0)
|
||||
json (2.1.0)
|
||||
jwt (2.1.0)
|
||||
memoist (0.16.0)
|
||||
mime-types (3.2.2)
|
||||
mime-types-data (~> 3.2015)
|
||||
mime-types-data (3.2018.0812)
|
||||
mini_magick (4.5.1)
|
||||
minitest (5.11.3)
|
||||
molinillo (0.6.6)
|
||||
multi_json (1.13.1)
|
||||
multi_xml (0.6.0)
|
||||
multipart-post (2.0.0)
|
||||
nanaimo (0.2.6)
|
||||
nap (1.1.0)
|
||||
naturally (2.2.0)
|
||||
netrc (0.11.0)
|
||||
os (1.0.0)
|
||||
plist (3.4.0)
|
||||
public_suffix (2.0.5)
|
||||
representable (3.0.4)
|
||||
declarative (< 0.1.0)
|
||||
declarative-option (< 0.2.0)
|
||||
uber (< 0.2.0)
|
||||
retriable (3.1.2)
|
||||
rouge (2.0.7)
|
||||
ruby-macho (1.2.0)
|
||||
rubyzip (1.2.2)
|
||||
security (0.1.3)
|
||||
signet (0.10.0)
|
||||
addressable (~> 2.3)
|
||||
faraday (~> 0.9)
|
||||
jwt (>= 1.5, < 3.0)
|
||||
multi_json (~> 1.10)
|
||||
simctl (1.6.5)
|
||||
CFPropertyList
|
||||
naturally
|
||||
slack-notifier (2.3.2)
|
||||
terminal-notifier (1.8.0)
|
||||
terminal-table (1.8.0)
|
||||
unicode-display_width (~> 1.1, >= 1.1.1)
|
||||
thread_safe (0.3.6)
|
||||
tty-cursor (0.6.0)
|
||||
tty-screen (0.6.5)
|
||||
tty-spinner (0.8.0)
|
||||
tty-cursor (>= 0.5.0)
|
||||
tzinfo (1.2.5)
|
||||
thread_safe (~> 0.1)
|
||||
uber (0.1.0)
|
||||
unf (0.1.4)
|
||||
unf_ext
|
||||
unf_ext (0.0.7.5)
|
||||
unicode-display_width (1.4.0)
|
||||
word_wrap (1.0.0)
|
||||
xcodeproj (1.6.0)
|
||||
CFPropertyList (>= 2.3.3, < 4.0)
|
||||
atomos (~> 0.1.3)
|
||||
claide (>= 1.0.2, < 2.0)
|
||||
colored2 (~> 3.1)
|
||||
nanaimo (~> 0.2.6)
|
||||
xcpretty (0.3.0)
|
||||
rouge (~> 2.0.7)
|
||||
xcpretty-travis-formatter (1.0.0)
|
||||
xcpretty (~> 0.2, >= 0.0.7)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
cocoapods (~> 1.5.3)
|
||||
fastlane (~> 2.105.2)
|
||||
|
||||
BUNDLED WITH
|
||||
1.16.1
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
Copyright © 2018 Flávio Caetano <flavio@vieiracaetano.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
105
README.md
105
README.md
|
|
@ -1 +1,104 @@
|
|||
# [ReCaptcha Docs](http://fjcaetano.github.io/ReCaptcha)
|
||||
# ReCaptcha
|
||||
|
||||
[](https://travis-ci.org/fjcaetano/ReCaptcha)
|
||||
[](http://cocoapods.org/pods/ReCaptcha)
|
||||
[](http://cocoapods.org/pods/ReCaptcha)
|
||||
[](http://cocoapods.org/pods/ReCaptcha)
|
||||
[](https://codecov.io/gh/fjcaetano/ReCaptcha)
|
||||
[](https://github.com/Carthage/Carthage)
|
||||
|
||||
-----
|
||||
|
||||
Add Google's [Invisible ReCaptcha v2](https://developers.google.com/recaptcha/docs/invisible) 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.
|
||||
|
||||
 
|
||||
|
||||
#### _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](https://www.google.com/recaptcha/admin/create).
|
||||
|
||||

|
||||
|
||||
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](http://cocoapods.org) and [Carthage](https://github.com/Carthage/Carthage).
|
||||
To install it, simply add the following line to your dependencies file:
|
||||
|
||||
#### Cocoapods
|
||||
``` ruby
|
||||
pod "ReCaptcha"
|
||||
# or
|
||||
pod "ReCaptcha/RxSwift"
|
||||
```
|
||||
|
||||
#### Carthage
|
||||
``` ruby
|
||||
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
|
||||
|
||||
Simply add `ReCaptchaKey` and `ReCaptchaDomain` (with a protocol ex. http:// or https://) to your Info.plist and run:
|
||||
|
||||
``` swift
|
||||
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())
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
You can also install the reactive subpod and use it with RxSwift:
|
||||
|
||||
``` swift
|
||||
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`:
|
||||
|
||||
``` swift
|
||||
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](http://fjcaetano.github.io/ReCaptcha)
|
||||
|
||||
## License
|
||||
|
||||
ReCaptcha is available under the MIT license. See the LICENSE file for more info.
|
||||
|
|
|
|||
|
|
@ -0,0 +1,556 @@
|
|||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 46;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
F206BAB51F8D3DE900A25807 /* ReCaptcha-Carthage.h in Headers */ = {isa = PBXBuildFile; fileRef = F206BAB31F8D3DE900A25807 /* ReCaptcha-Carthage.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
F206BB1D1F8D4DBC00A25807 /* ReCaptcha_RxSwift.h in Headers */ = {isa = PBXBuildFile; fileRef = F206BB1B1F8D4DBC00A25807 /* ReCaptcha_RxSwift.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
F206BB221F8D4DDF00A25807 /* RxSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F206BB121F8D4D1400A25807 /* RxSwift.framework */; };
|
||||
F231B39A1FEC51C800F82943 /* DispatchQueue+Throttle.swift in Sources */ = {isa = PBXBuildFile; fileRef = F231B3991FEC51C800F82943 /* DispatchQueue+Throttle.swift */; };
|
||||
F24EA1E11F9683FB001DEC17 /* ReCaptcha+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = F24EA1DD1F9683F5001DEC17 /* ReCaptcha+Rx.swift */; };
|
||||
F24EA1E21F968403001DEC17 /* ReCaptchaDecoder.swift in Sources */ = {isa = PBXBuildFile; fileRef = F24EA1D81F9683F5001DEC17 /* ReCaptchaDecoder.swift */; };
|
||||
F24EA1E31F968403001DEC17 /* ReCaptchaWebViewManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = F24EA1D91F9683F5001DEC17 /* ReCaptchaWebViewManager.swift */; };
|
||||
F24EA1E41F968403001DEC17 /* String+Dict.swift in Sources */ = {isa = PBXBuildFile; fileRef = F24EA1DA1F9683F5001DEC17 /* String+Dict.swift */; };
|
||||
F24EA1E51F968403001DEC17 /* ReCaptchaError.swift in Sources */ = {isa = PBXBuildFile; fileRef = F24EA1DB1F9683F5001DEC17 /* ReCaptchaError.swift */; };
|
||||
F24EA1E61F968403001DEC17 /* ReCaptcha.swift in Sources */ = {isa = PBXBuildFile; fileRef = F24EA1DE1F9683F5001DEC17 /* ReCaptcha.swift */; };
|
||||
F24EA1E71F968406001DEC17 /* recaptcha.html in Resources */ = {isa = PBXBuildFile; fileRef = F24EA1E01F9683F5001DEC17 /* recaptcha.html */; };
|
||||
F2AE8614204F3B42002E28D7 /* ReCaptchaResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2AE8613204F3B41002E28D7 /* ReCaptchaResult.swift */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
F206BB231F8D4DF800A25807 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = F206BAA71F8D3DE900A25807 /* Project object */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = F206BAAF1F8D3DE900A25807;
|
||||
remoteInfo = ReCaptcha;
|
||||
};
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
F206BAB01F8D3DE900A25807 /* ReCaptcha.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ReCaptcha.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
F206BAB31F8D3DE900A25807 /* ReCaptcha-Carthage.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ReCaptcha-Carthage.h"; sourceTree = "<group>"; };
|
||||
F206BAB41F8D3DE900A25807 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
F206BACF1F8D3E2800A25807 /* Cartfile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Cartfile; sourceTree = "<group>"; };
|
||||
F206BB121F8D4D1400A25807 /* RxSwift.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = RxSwift.framework; path = Carthage/Build/iOS/RxSwift.framework; sourceTree = "<group>"; };
|
||||
F206BB191F8D4DBC00A25807 /* ReCaptcha_RxSwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ReCaptcha_RxSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
F206BB1B1F8D4DBC00A25807 /* ReCaptcha_RxSwift.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ReCaptcha_RxSwift.h; sourceTree = "<group>"; };
|
||||
F206BB1C1F8D4DBC00A25807 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
F231B3991FEC51C800F82943 /* DispatchQueue+Throttle.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "DispatchQueue+Throttle.swift"; sourceTree = "<group>"; };
|
||||
F24EA1D81F9683F5001DEC17 /* ReCaptchaDecoder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReCaptchaDecoder.swift; sourceTree = "<group>"; };
|
||||
F24EA1D91F9683F5001DEC17 /* ReCaptchaWebViewManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReCaptchaWebViewManager.swift; sourceTree = "<group>"; };
|
||||
F24EA1DA1F9683F5001DEC17 /* String+Dict.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String+Dict.swift"; sourceTree = "<group>"; };
|
||||
F24EA1DB1F9683F5001DEC17 /* ReCaptchaError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReCaptchaError.swift; sourceTree = "<group>"; };
|
||||
F24EA1DD1F9683F5001DEC17 /* ReCaptcha+Rx.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ReCaptcha+Rx.swift"; sourceTree = "<group>"; };
|
||||
F24EA1DE1F9683F5001DEC17 /* ReCaptcha.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReCaptcha.swift; sourceTree = "<group>"; };
|
||||
F24EA1E01F9683F5001DEC17 /* recaptcha.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = recaptcha.html; sourceTree = "<group>"; };
|
||||
F2AE8613204F3B41002E28D7 /* ReCaptchaResult.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ReCaptchaResult.swift; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
F206BAAC1F8D3DE900A25807 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
F206BB151F8D4DBC00A25807 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
F206BB221F8D4DDF00A25807 /* RxSwift.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
F206BAA61F8D3DE900A25807 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F206BACF1F8D3E2800A25807 /* Cartfile */,
|
||||
F206BAB21F8D3DE900A25807 /* ReCaptcha-Carthage */,
|
||||
F206BB1A1F8D4DBC00A25807 /* ReCaptcha_RxSwift */,
|
||||
F206BAB11F8D3DE900A25807 /* Products */,
|
||||
F206BAD11F8D3E7600A25807 /* Frameworks */,
|
||||
F24EA1D41F967F21001DEC17 /* Recovered References */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F206BAB11F8D3DE900A25807 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F206BAB01F8D3DE900A25807 /* ReCaptcha.framework */,
|
||||
F206BB191F8D4DBC00A25807 /* ReCaptcha_RxSwift.framework */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F206BAB21F8D3DE900A25807 /* ReCaptcha-Carthage */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F24EA1D61F9683F5001DEC17 /* ReCaptcha */,
|
||||
F206BAB31F8D3DE900A25807 /* ReCaptcha-Carthage.h */,
|
||||
F206BAB41F8D3DE900A25807 /* Info.plist */,
|
||||
);
|
||||
path = "ReCaptcha-Carthage";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F206BAD11F8D3E7600A25807 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F206BB121F8D4D1400A25807 /* RxSwift.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F206BB1A1F8D4DBC00A25807 /* ReCaptcha_RxSwift */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F206BB1B1F8D4DBC00A25807 /* ReCaptcha_RxSwift.h */,
|
||||
F206BB1C1F8D4DBC00A25807 /* Info.plist */,
|
||||
);
|
||||
path = ReCaptcha_RxSwift;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F24EA1D41F967F21001DEC17 /* Recovered References */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
);
|
||||
name = "Recovered References";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F24EA1D61F9683F5001DEC17 /* ReCaptcha */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F24EA1D71F9683F5001DEC17 /* Classes */,
|
||||
F24EA1DF1F9683F5001DEC17 /* Assets */,
|
||||
);
|
||||
path = ReCaptcha;
|
||||
sourceTree = SOURCE_ROOT;
|
||||
};
|
||||
F24EA1D71F9683F5001DEC17 /* Classes */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F24EA1D81F9683F5001DEC17 /* ReCaptchaDecoder.swift */,
|
||||
F24EA1D91F9683F5001DEC17 /* ReCaptchaWebViewManager.swift */,
|
||||
F24EA1DA1F9683F5001DEC17 /* String+Dict.swift */,
|
||||
F24EA1DB1F9683F5001DEC17 /* ReCaptchaError.swift */,
|
||||
F2AE8613204F3B41002E28D7 /* ReCaptchaResult.swift */,
|
||||
F231B3991FEC51C800F82943 /* DispatchQueue+Throttle.swift */,
|
||||
F24EA1DC1F9683F5001DEC17 /* Rx */,
|
||||
F24EA1DE1F9683F5001DEC17 /* ReCaptcha.swift */,
|
||||
);
|
||||
path = Classes;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F24EA1DC1F9683F5001DEC17 /* Rx */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F24EA1DD1F9683F5001DEC17 /* ReCaptcha+Rx.swift */,
|
||||
);
|
||||
path = Rx;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F24EA1DF1F9683F5001DEC17 /* Assets */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F24EA1E01F9683F5001DEC17 /* recaptcha.html */,
|
||||
);
|
||||
path = Assets;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXHeadersBuildPhase section */
|
||||
F206BAAD1F8D3DE900A25807 /* Headers */ = {
|
||||
isa = PBXHeadersBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
F206BAB51F8D3DE900A25807 /* ReCaptcha-Carthage.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
F206BB161F8D4DBC00A25807 /* Headers */ = {
|
||||
isa = PBXHeadersBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
F206BB1D1F8D4DBC00A25807 /* ReCaptcha_RxSwift.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXHeadersBuildPhase section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
F206BAAF1F8D3DE900A25807 /* ReCaptcha */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = F206BAB81F8D3DE900A25807 /* Build configuration list for PBXNativeTarget "ReCaptcha" */;
|
||||
buildPhases = (
|
||||
F206BAAB1F8D3DE900A25807 /* Sources */,
|
||||
F206BAAC1F8D3DE900A25807 /* Frameworks */,
|
||||
F206BAAD1F8D3DE900A25807 /* Headers */,
|
||||
F206BAAE1F8D3DE900A25807 /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = ReCaptcha;
|
||||
productName = "ReCaptcha-Carthage";
|
||||
productReference = F206BAB01F8D3DE900A25807 /* ReCaptcha.framework */;
|
||||
productType = "com.apple.product-type.framework";
|
||||
};
|
||||
F206BB181F8D4DBC00A25807 /* ReCaptcha_RxSwift */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = F206BB1E1F8D4DBC00A25807 /* Build configuration list for PBXNativeTarget "ReCaptcha_RxSwift" */;
|
||||
buildPhases = (
|
||||
F206BB141F8D4DBC00A25807 /* Sources */,
|
||||
F206BB151F8D4DBC00A25807 /* Frameworks */,
|
||||
F206BB161F8D4DBC00A25807 /* Headers */,
|
||||
F206BB171F8D4DBC00A25807 /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
F206BB241F8D4DF800A25807 /* PBXTargetDependency */,
|
||||
);
|
||||
name = ReCaptcha_RxSwift;
|
||||
productName = ReCaptcha_RxSwift;
|
||||
productReference = F206BB191F8D4DBC00A25807 /* ReCaptcha_RxSwift.framework */;
|
||||
productType = "com.apple.product-type.framework";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
F206BAA71F8D3DE900A25807 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0900;
|
||||
ORGANIZATIONNAME = "Flávio Caetano";
|
||||
TargetAttributes = {
|
||||
F206BAAF1F8D3DE900A25807 = {
|
||||
CreatedOnToolsVersion = 8.3.2;
|
||||
ProvisioningStyle = Automatic;
|
||||
};
|
||||
F206BB181F8D4DBC00A25807 = {
|
||||
CreatedOnToolsVersion = 8.3.2;
|
||||
ProvisioningStyle = Automatic;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = F206BAAA1F8D3DE900A25807 /* Build configuration list for PBXProject "ReCaptcha-Carthage" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
);
|
||||
mainGroup = F206BAA61F8D3DE900A25807;
|
||||
productRefGroup = F206BAB11F8D3DE900A25807 /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
F206BAAF1F8D3DE900A25807 /* ReCaptcha */,
|
||||
F206BB181F8D4DBC00A25807 /* ReCaptcha_RxSwift */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
F206BAAE1F8D3DE900A25807 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
F24EA1E71F968406001DEC17 /* recaptcha.html in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
F206BB171F8D4DBC00A25807 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
F206BAAB1F8D3DE900A25807 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
F24EA1E51F968403001DEC17 /* ReCaptchaError.swift in Sources */,
|
||||
F24EA1E21F968403001DEC17 /* ReCaptchaDecoder.swift in Sources */,
|
||||
F2AE8614204F3B42002E28D7 /* ReCaptchaResult.swift in Sources */,
|
||||
F24EA1E61F968403001DEC17 /* ReCaptcha.swift in Sources */,
|
||||
F24EA1E31F968403001DEC17 /* ReCaptchaWebViewManager.swift in Sources */,
|
||||
F24EA1E41F968403001DEC17 /* String+Dict.swift in Sources */,
|
||||
F231B39A1FEC51C800F82943 /* DispatchQueue+Throttle.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
F206BB141F8D4DBC00A25807 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
F24EA1E11F9683FB001DEC17 /* ReCaptcha+Rx.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXTargetDependency section */
|
||||
F206BB241F8D4DF800A25807 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = F206BAAF1F8D3DE900A25807 /* ReCaptcha */;
|
||||
targetProxy = F206BB231F8D4DF800A25807 /* PBXContainerItemProxy */;
|
||||
};
|
||||
/* End PBXTargetDependency section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
F206BAB61F8D3DE900A25807 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 4.2;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
F206BAB71F8D3DE900A25807 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||
SWIFT_VERSION = 4.2;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
F206BAB91F8D3DE900A25807 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CODE_SIGN_IDENTITY = "";
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)/Carthage/Build/iOS",
|
||||
);
|
||||
INFOPLIST_FILE = "ReCaptcha-Carthage/Info.plist";
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.flaviocaetano.ReCaptcha;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_VERSION = 4.2;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
F206BABA1F8D3DE900A25807 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CODE_SIGN_IDENTITY = "";
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)/Carthage/Build/iOS",
|
||||
);
|
||||
INFOPLIST_FILE = "ReCaptcha-Carthage/Info.plist";
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.flaviocaetano.ReCaptcha;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_VERSION = 4.2;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
F206BB1F1F8D4DBC00A25807 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CODE_SIGN_IDENTITY = "";
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)/Carthage/Build/iOS",
|
||||
"$(PROJECT_DIR)\\ Carthage\\ Test/Carthage/Build/iOS",
|
||||
);
|
||||
INFOPLIST_FILE = ReCaptcha_RxSwift/Info.plist;
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
OTHER_SWIFT_FLAGS = "-D IMPORT_RECAPTCHA";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.flaviocaetano.ReCaptcha-RxSwift";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_VERSION = 4.2;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
F206BB201F8D4DBC00A25807 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CODE_SIGN_IDENTITY = "";
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)/Carthage/Build/iOS",
|
||||
"$(PROJECT_DIR)\\ Carthage\\ Test/Carthage/Build/iOS",
|
||||
);
|
||||
INFOPLIST_FILE = ReCaptcha_RxSwift/Info.plist;
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
OTHER_SWIFT_FLAGS = "-D IMPORT_RECAPTCHA";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.flaviocaetano.ReCaptcha-RxSwift";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_VERSION = 4.2;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
F206BAAA1F8D3DE900A25807 /* Build configuration list for PBXProject "ReCaptcha-Carthage" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
F206BAB61F8D3DE900A25807 /* Debug */,
|
||||
F206BAB71F8D3DE900A25807 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
F206BAB81F8D3DE900A25807 /* Build configuration list for PBXNativeTarget "ReCaptcha" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
F206BAB91F8D3DE900A25807 /* Debug */,
|
||||
F206BABA1F8D3DE900A25807 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
F206BB1E1F8D4DBC00A25807 /* Build configuration list for PBXNativeTarget "ReCaptcha_RxSwift" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
F206BB1F1F8D4DBC00A25807 /* Debug */,
|
||||
F206BB201F8D4DBC00A25807 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = F206BAA71F8D3DE900A25807 /* Project object */;
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:ReCaptcha-Carthage.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
|
|
@ -0,0 +1,73 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0830"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "F206BAAF1F8D3DE900A25807"
|
||||
BuildableName = "ReCaptcha.framework"
|
||||
BlueprintName = "ReCaptcha"
|
||||
ReferencedContainer = "container:ReCaptcha-Carthage.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "F206BB181F8D4DBC00A25807"
|
||||
BuildableName = "ReCaptcha_RxSwift.framework"
|
||||
BlueprintName = "ReCaptcha_RxSwift"
|
||||
ReferencedContainer = "container:ReCaptcha-Carthage.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
|
|
@ -0,0 +1,82 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0900"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "F206BB181F8D4DBC00A25807"
|
||||
BuildableName = "ReCaptcha_RxSwift.framework"
|
||||
BlueprintName = "ReCaptcha_RxSwift"
|
||||
ReferencedContainer = "container:ReCaptcha-Carthage.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "F206BB181F8D4DBC00A25807"
|
||||
BuildableName = "ReCaptcha_RxSwift.framework"
|
||||
BlueprintName = "ReCaptcha_RxSwift"
|
||||
ReferencedContainer = "container:ReCaptcha-Carthage.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "F206BB181F8D4DBC00A25807"
|
||||
BuildableName = "ReCaptcha_RxSwift.framework"
|
||||
BlueprintName = "ReCaptcha_RxSwift"
|
||||
ReferencedContainer = "container:ReCaptcha-Carthage.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
|
|
@ -0,0 +1,82 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0900"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "F206BB181F8D4DBC00A25807"
|
||||
BuildableName = "ReCaptcha_RxSwift.framework"
|
||||
BlueprintName = "ReCaptcha_RxSwift"
|
||||
ReferencedContainer = "container:ReCaptcha-Carthage.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "F206BB181F8D4DBC00A25807"
|
||||
BuildableName = "ReCaptcha_RxSwift.framework"
|
||||
BlueprintName = "ReCaptcha_RxSwift"
|
||||
ReferencedContainer = "container:ReCaptcha-Carthage.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "F206BB181F8D4DBC00A25807"
|
||||
BuildableName = "ReCaptcha_RxSwift.framework"
|
||||
BlueprintName = "ReCaptcha_RxSwift"
|
||||
ReferencedContainer = "container:ReCaptcha-Carthage.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>$(CURRENT_PROJECT_VERSION)</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string></string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
//
|
||||
// ReCaptcha-Carthage.h
|
||||
// ReCaptcha-Carthage
|
||||
//
|
||||
// Created by Flávio Caetano on 10/10/17.
|
||||
// Copyright © 2017 Flávio Caetano. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
//! Project version number for ReCaptcha-Carthage.
|
||||
FOUNDATION_EXPORT double ReCaptcha_CarthageVersionNumber;
|
||||
|
||||
//! Project version string for ReCaptcha-Carthage.
|
||||
FOUNDATION_EXPORT const unsigned char ReCaptcha_CarthageVersionString[];
|
||||
|
||||
// In this header, you should import all the public headers of your framework using statements like #import <ReCaptcha_Carthage/PublicHeader.h>
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
|
||||
Pod::Spec.new do |s|
|
||||
s.name = 'ReCaptcha'
|
||||
s.version = '1.4.2'
|
||||
s.summary = 'ReCaptcha for iOS'
|
||||
s.swift_version = '4.2'
|
||||
|
||||
s.description = <<-DESC
|
||||
Add Google's [Invisible ReCaptcha](https://developers.google.com/recaptcha/docs/invisible) 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.
|
||||
DESC
|
||||
|
||||
s.homepage = 'https://github.com/fjcaetano/ReCaptcha'
|
||||
s.license = { :type => 'MIT', :file => 'LICENSE' }
|
||||
s.author = { 'Flávio Caetano' => 'flavio@vieiracaetano.com' }
|
||||
s.source = { :git => 'https://github.com/fjcaetano/ReCaptcha.git', :tag => s.version.to_s }
|
||||
s.social_media_url = 'https://twitter.com/flavio_caetano'
|
||||
s.documentation_url = 'http://fjcaetano.github.io/ReCaptcha'
|
||||
|
||||
s.ios.deployment_target = '8.0'
|
||||
s.default_subspecs = 'Core'
|
||||
|
||||
s.subspec 'Core' do |core|
|
||||
core.source_files = 'ReCaptcha/Classes/*'
|
||||
core.frameworks = 'WebKit'
|
||||
|
||||
core.resource_bundles = {
|
||||
'ReCaptcha' => ['ReCaptcha/Assets/**/*']
|
||||
}
|
||||
end
|
||||
|
||||
s.subspec 'RxSwift' do |rx|
|
||||
rx.source_files = 'ReCaptcha/Classes/Rx/**/*'
|
||||
rx.dependency 'ReCaptcha/Core'
|
||||
rx.dependency 'RxSwift', '~> 4.3'
|
||||
end
|
||||
end
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
<script type="text/javascript">
|
||||
var post = function(value) {
|
||||
window.webkit.messageHandlers.recaptcha.postMessage(value);
|
||||
};
|
||||
|
||||
console.log = function(message) {
|
||||
post({log: message});
|
||||
};
|
||||
|
||||
var showReCaptcha = function() {
|
||||
console.log("showReCaptcha");
|
||||
post({action: "showReCaptcha"});
|
||||
};
|
||||
|
||||
var observeDOM = function(element, completion) {
|
||||
new MutationObserver(function(mutations) {
|
||||
mutations.forEach(function(mutationRecord) {
|
||||
completion();
|
||||
});
|
||||
})
|
||||
.observe(element, {attributes: true, attributeFilter: ['style']})
|
||||
};
|
||||
|
||||
var execute = function() {
|
||||
console.log("executing");
|
||||
|
||||
// Removes ReCaptcha dismissal when clicking outside div area
|
||||
try {
|
||||
document.getElementsByTagName("div")[4].outerHTML = ""
|
||||
}
|
||||
catch(e) {
|
||||
}
|
||||
|
||||
// Listens to changes on the div element that presents the ReCaptcha challenge
|
||||
observeDOM(document.getElementsByTagName("div")[3], showReCaptcha);
|
||||
|
||||
grecaptcha.execute();
|
||||
};
|
||||
|
||||
var onSubmit = function(token) {
|
||||
console.log(token);
|
||||
post({token: token});
|
||||
};
|
||||
|
||||
var onloadCallback = function() {
|
||||
console.log("did load");
|
||||
grecaptcha.render('submit', {
|
||||
'sitekey' : '${apiKey}',
|
||||
'callback' : onSubmit,
|
||||
'size': 'invisible'
|
||||
});
|
||||
};
|
||||
|
||||
var reset = function() {
|
||||
console.log("resetting");
|
||||
grecaptcha.reset();
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<span id="submit" style="visibility: hidden;"></span>
|
||||
<script src="${endpoint}" async defer></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
//
|
||||
// DispatchQueue+Throttle.swift
|
||||
// ReCaptcha
|
||||
//
|
||||
// Created by Flávio Caetano on 21/12/17.
|
||||
// Copyright © 2018 ReCaptcha. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
/// Adds throttling to dispatch queues
|
||||
extension DispatchQueue {
|
||||
/// Stores a throttle DispatchWorkItem instance for a given context
|
||||
private static var workItems = [AnyHashable: DispatchWorkItem]()
|
||||
|
||||
/// Stores the last call times for a given context
|
||||
private static var lastDebounceCallTimes = [AnyHashable: DispatchTime]()
|
||||
|
||||
/// Dispatched actions' token storage
|
||||
private static var onceTokenStorage = Set<AnyHashable>()
|
||||
|
||||
/// An object representing a context if none is given
|
||||
private static let nilContext = UUID()
|
||||
|
||||
/**
|
||||
- parameters:
|
||||
- deadline: The timespan to delay a closure execution
|
||||
- context: The context in which the throttle should be executed
|
||||
- action: The closure to be executed
|
||||
|
||||
Delays a closure execution and ensures no other executions are made during deadline for that context
|
||||
*/
|
||||
func throttle(deadline: DispatchTime, context: AnyHashable = nilContext, action: @escaping () -> Void) {
|
||||
let worker = DispatchWorkItem {
|
||||
defer { DispatchQueue.workItems.removeValue(forKey: context) }
|
||||
action()
|
||||
}
|
||||
|
||||
asyncAfter(deadline: deadline, execute: worker)
|
||||
|
||||
DispatchQueue.workItems[context]?.cancel()
|
||||
DispatchQueue.workItems[context] = worker
|
||||
}
|
||||
|
||||
/**
|
||||
- parameters:
|
||||
- interval: The interval in which new calls will be ignored
|
||||
- context: The context in which the debounce should be executed
|
||||
- action: The closure to be executed
|
||||
|
||||
Executes a closure and ensures no other executions will be made during the interval.
|
||||
*/
|
||||
func debounce(interval: Double, context: AnyHashable = nilContext, action: @escaping () -> Void) {
|
||||
let now = DispatchTime.now()
|
||||
if let last = DispatchQueue.lastDebounceCallTimes[context], last + interval > now {
|
||||
return
|
||||
}
|
||||
|
||||
DispatchQueue.lastDebounceCallTimes[context] = now + interval
|
||||
async(execute: action)
|
||||
|
||||
// Cleanup & release context
|
||||
throttle(deadline: now + interval) {
|
||||
DispatchQueue.lastDebounceCallTimes.removeValue(forKey: context)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
- parameters:
|
||||
- token: The control token for each dispatched action
|
||||
- action: The closure to be executed
|
||||
|
||||
Dispatch the action only once for each given token
|
||||
*/
|
||||
static func once(token: AnyHashable, action: () -> Void) {
|
||||
guard !onceTokenStorage.contains(token) else { return }
|
||||
|
||||
defer { objc_sync_exit(self) }
|
||||
objc_sync_enter(self)
|
||||
|
||||
onceTokenStorage.insert(token)
|
||||
action()
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,257 @@
|
|||
//
|
||||
// ReCaptcha.swift
|
||||
// ReCaptcha
|
||||
//
|
||||
// Created by Flávio Caetano on 22/03/17.
|
||||
// Copyright © 2018 ReCaptcha. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import WebKit
|
||||
|
||||
|
||||
/**
|
||||
*/
|
||||
public class ReCaptcha {
|
||||
public typealias BoolParameterClosure = (Bool) -> ()
|
||||
|
||||
fileprivate struct Constants {
|
||||
struct InfoDictKeys {
|
||||
static let APIKey = "ReCaptchaKey"
|
||||
static let Domain = "ReCaptchaDomain"
|
||||
}
|
||||
}
|
||||
|
||||
/// The JS API endpoint to be loaded onto the HTML file.
|
||||
public enum Endpoint {
|
||||
/** Google's default endpoint. Points to
|
||||
https://www.google.com/recaptcha/api.js
|
||||
*/
|
||||
case `default`
|
||||
|
||||
/// Alternate endpoint. Points to https://www.recaptcha.net/recaptcha/api.js
|
||||
case alternate
|
||||
|
||||
internal func getURL(locale: Locale?) -> String {
|
||||
let localeAppendix = locale.map { "&hl=\($0.identifier)" } ?? ""
|
||||
switch self {
|
||||
case .default:
|
||||
return "https://www.google.com/recaptcha/api.js?onload=onloadCallback&render=explicit" + localeAppendix
|
||||
case .alternate:
|
||||
return "https://www.recaptcha.net/recaptcha/api.js?onload=onloadCallback&render=explicit"
|
||||
+ localeAppendix
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** Internal data model for CI in unit tests
|
||||
*/
|
||||
struct Config {
|
||||
/// The raw unformated HTML file content
|
||||
let html: String
|
||||
|
||||
/// The API key that will be sent to the ReCaptcha API
|
||||
let apiKey: String
|
||||
|
||||
/// The base url to be used to resolve relative URLs in the webview
|
||||
let baseURL: URL
|
||||
|
||||
/// The Bundle that holds ReCaptcha's assets
|
||||
private static let bundle: Bundle = {
|
||||
let bundle = Bundle(for: ReCaptcha.self)
|
||||
guard let cocoapodsBundle = bundle
|
||||
.path(forResource: "ReCaptcha", ofType: "bundle")
|
||||
.flatMap(Bundle.init(path:)) else {
|
||||
return bundle
|
||||
}
|
||||
|
||||
return cocoapodsBundle
|
||||
}()
|
||||
|
||||
/**
|
||||
- parameters:
|
||||
- apiKey: The API key sent to the ReCaptcha init
|
||||
- infoPlistKey: The API key retrived from the application's Info.plist
|
||||
- baseURL: The base URL sent to the ReCaptcha init
|
||||
- infoPlistURL: The base URL retrieved from the application's Info.plist
|
||||
|
||||
- Throws: `ReCaptchaError.htmlLoadError`: if is unable to load the HTML embedded in the bundle.
|
||||
- Throws: `ReCaptchaError.apiKeyNotFound`: if an `apiKey` is not provided and can't find one in the project's
|
||||
Info.plist.
|
||||
- Throws: `ReCaptchaError.baseURLNotFound`: if a `baseURL` is not provided and can't find one in the project's
|
||||
Info.plist.
|
||||
- Throws: Rethrows any exceptions thrown by `String(contentsOfFile:)`
|
||||
*/
|
||||
public init(apiKey: String?, infoPlistKey: String?, baseURL: URL?, infoPlistURL: URL?) throws {
|
||||
guard let filePath = Config.bundle.path(forResource: "recaptcha", ofType: "html") else {
|
||||
throw ReCaptchaError.htmlLoadError
|
||||
}
|
||||
|
||||
guard let apiKey = apiKey ?? infoPlistKey else {
|
||||
throw ReCaptchaError.apiKeyNotFound
|
||||
}
|
||||
|
||||
guard let domain = baseURL ?? infoPlistURL else {
|
||||
throw ReCaptchaError.baseURLNotFound
|
||||
}
|
||||
|
||||
let rawHTML = try String(contentsOfFile: filePath)
|
||||
|
||||
self.html = rawHTML
|
||||
self.apiKey = apiKey
|
||||
self.baseURL = Config.fixSchemeIfNeeded(for: domain)
|
||||
}
|
||||
}
|
||||
|
||||
/// Callback for WebView loading state changing
|
||||
public var onLoadingChanged: BoolParameterClosure? {
|
||||
get { return manager.onLoadingChanged }
|
||||
set { manager.onLoadingChanged = newValue }
|
||||
}
|
||||
|
||||
/// The worker that handles webview events and communication
|
||||
let manager: ReCaptchaWebViewManager
|
||||
|
||||
/**
|
||||
- parameters:
|
||||
- apiKey: The API key sent to the ReCaptcha init
|
||||
- infoPlistKey: The API key retrived from the application's Info.plist
|
||||
- baseURL: The base URL sent to the ReCaptcha init
|
||||
- infoPlistURL: The base URL retrieved from the application's Info.plist
|
||||
- locale: A locale value to translate ReCaptcha into a different language
|
||||
|
||||
Initializes a ReCaptcha object
|
||||
|
||||
Both `apiKey` and `baseURL` may be nil, in which case the lib will look for entries of `ReCaptchaKey` and
|
||||
`ReCaptchaDomain`, respectively, in the project's Info.plist
|
||||
|
||||
A key may be aquired here: https://www.google.com/recaptcha/admin#list
|
||||
|
||||
- Throws: `ReCaptchaError.htmlLoadError`: if is unable to load the HTML embedded in the bundle.
|
||||
- Throws: `ReCaptchaError.apiKeyNotFound`: if an `apiKey` is not provided and can't find one in the project's
|
||||
Info.plist.
|
||||
- Throws: `ReCaptchaError.baseURLNotFound`: if a `baseURL` is not provided and can't find one in the project's
|
||||
Info.plist.
|
||||
- Throws: Rethrows any exceptions thrown by `String(contentsOfFile:)`
|
||||
*/
|
||||
public convenience init(
|
||||
apiKey: String? = nil,
|
||||
baseURL: URL? = nil,
|
||||
endpoint: Endpoint = .default,
|
||||
locale: Locale? = nil
|
||||
) throws {
|
||||
let infoDict = Bundle.main.infoDictionary
|
||||
|
||||
let plistApiKey = infoDict?[Constants.InfoDictKeys.APIKey] as? String
|
||||
let plistDomain = (infoDict?[Constants.InfoDictKeys.Domain] as? String).flatMap(URL.init(string:))
|
||||
|
||||
let config = try Config(apiKey: apiKey, infoPlistKey: plistApiKey, baseURL: baseURL, infoPlistURL: plistDomain)
|
||||
|
||||
self.init(manager: ReCaptchaWebViewManager(
|
||||
html: config.html,
|
||||
apiKey: config.apiKey,
|
||||
baseURL: config.baseURL,
|
||||
endpoint: endpoint.getURL(locale: locale)
|
||||
))
|
||||
}
|
||||
|
||||
/**
|
||||
- parameter manager: A ReCaptchaWebViewManager instance.
|
||||
|
||||
Initializes ReCaptcha with the given manager
|
||||
*/
|
||||
init(manager: ReCaptchaWebViewManager) {
|
||||
self.manager = manager
|
||||
}
|
||||
|
||||
/**
|
||||
- parameters:
|
||||
- view: The view that should present the webview.
|
||||
- resetOnError: If ReCaptcha should be reset if it errors. Defaults to `true`.
|
||||
- completion: A closure that receives a ReCaptchaResult which may contain a valid result token.
|
||||
|
||||
Starts the challenge validation
|
||||
*/
|
||||
public func validate(on view: UIView, resetOnError: Bool = true, completion: @escaping (ReCaptchaResult) -> Void) {
|
||||
manager.shouldResetOnError = resetOnError
|
||||
manager.completion = completion
|
||||
|
||||
manager.validate(on: view)
|
||||
}
|
||||
|
||||
|
||||
/// Stops the execution of the webview
|
||||
public func stop() {
|
||||
manager.stop()
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
- parameter configure: A closure that receives an instance of `WKWebView` for configuration.
|
||||
|
||||
Provides a closure to configure the webview for presentation if necessary.
|
||||
|
||||
If presentation is required, the webview will already be a subview of `presenterView` if one is provided. Otherwise
|
||||
it might need to be added in a view currently visible.
|
||||
*/
|
||||
public func configureWebView(_ configure: @escaping (WKWebView) -> Void) {
|
||||
manager.configureWebView = configure
|
||||
}
|
||||
|
||||
/**
|
||||
Resets the ReCaptcha.
|
||||
|
||||
The reset is achieved by calling `grecaptcha.reset()` on the JS API.
|
||||
*/
|
||||
public func reset() {
|
||||
manager.reset()
|
||||
}
|
||||
|
||||
// MARK: - Development
|
||||
|
||||
#if DEBUG
|
||||
/// Forces the challenge widget to be explicitly displayed.
|
||||
public var forceVisibleChallenge: Bool {
|
||||
get { return manager.forceVisibleChallenge }
|
||||
set { manager.forceVisibleChallenge = newValue }
|
||||
}
|
||||
|
||||
/**
|
||||
Allows validation stubbing for testing
|
||||
|
||||
When this property is set to `true`, every call to `validate()` will immediately be resolved with `.token("")`.
|
||||
|
||||
Use only when testing your application.
|
||||
*/
|
||||
public var shouldSkipForTests: Bool {
|
||||
get { return manager.shouldSkipForTests }
|
||||
set { manager.shouldSkipForTests = newValue }
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// MARK: - Private Methods
|
||||
|
||||
private extension ReCaptcha.Config {
|
||||
/**
|
||||
- parameter url: The URL to be fixed
|
||||
- returns: An URL with scheme
|
||||
|
||||
If the given URL has no scheme, prepends `http://` to it and return the fixed URL.
|
||||
*/
|
||||
static func fixSchemeIfNeeded(for url: URL) -> URL {
|
||||
guard url.scheme?.isEmpty != false else {
|
||||
return url
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
print("⚠️ WARNING! Protocol not found for ReCaptcha domain (\(url))! You should add http:// or https:// to it!")
|
||||
#endif
|
||||
|
||||
if let fixedURL = URL(string: "http://" + url.absoluteString) {
|
||||
return fixedURL
|
||||
}
|
||||
|
||||
return url
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,112 @@
|
|||
//
|
||||
// ReCaptchaDecoder.swift
|
||||
// ReCaptcha
|
||||
//
|
||||
// Created by Flávio Caetano on 22/03/17.
|
||||
// Copyright © 2018 ReCaptcha. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import WebKit
|
||||
|
||||
|
||||
/** The Decoder of javascript messages from the webview
|
||||
*/
|
||||
internal class ReCaptchaDecoder: NSObject {
|
||||
/** The decoder result.
|
||||
*/
|
||||
enum Result {
|
||||
/// A result token, if any
|
||||
case token(String)
|
||||
|
||||
/// Indicates that the webview containing the challenge should be displayed.
|
||||
case showReCaptcha
|
||||
|
||||
/// Any errors
|
||||
case error(ReCaptchaError)
|
||||
|
||||
/// Did finish loading resources
|
||||
case didLoad
|
||||
|
||||
/// Logs a string onto the console
|
||||
case log(String)
|
||||
}
|
||||
|
||||
/// The closure that receives messages
|
||||
fileprivate let sendMessage: ((Result) -> Void)
|
||||
|
||||
/**
|
||||
- parameter didReceiveMessage: A closure that receives a ReCaptchaDecoder.Result
|
||||
|
||||
Initializes a decoder with a completion closure.
|
||||
*/
|
||||
init(didReceiveMessage: @escaping (Result) -> Void) {
|
||||
sendMessage = didReceiveMessage
|
||||
|
||||
super.init()
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
- parameter error: The error to be sent.
|
||||
|
||||
Sends an error to the completion closure
|
||||
*/
|
||||
func send(error: ReCaptchaError) {
|
||||
sendMessage(.error(error))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// MARK: Script Handler
|
||||
|
||||
/** Makes ReCaptchaDecoder conform to `WKScriptMessageHandler`
|
||||
*/
|
||||
extension ReCaptchaDecoder: WKScriptMessageHandler {
|
||||
func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) {
|
||||
guard let dict = message.body as? [String: Any] else {
|
||||
return sendMessage(.error(.wrongMessageFormat))
|
||||
}
|
||||
|
||||
sendMessage(Result.from(response: dict))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// MARK: - Result
|
||||
|
||||
/** Private methods on `ReCaptchaDecoder.Result`
|
||||
*/
|
||||
fileprivate extension ReCaptchaDecoder.Result {
|
||||
|
||||
/**
|
||||
- parameter response: A dictionary containing the message to be parsed
|
||||
- returns: A decoded ReCaptchaDecoder.Result
|
||||
|
||||
Parses a dict received from the webview onto a `ReCaptchaDecoder.Result`
|
||||
*/
|
||||
static func from(response: [String: Any]) -> ReCaptchaDecoder.Result {
|
||||
if let token = response["token"] as? String {
|
||||
return .token(token)
|
||||
}
|
||||
|
||||
if let action = response["action"] as? String {
|
||||
switch action {
|
||||
case "showReCaptcha":
|
||||
return .showReCaptcha
|
||||
|
||||
case "didLoad":
|
||||
return .didLoad
|
||||
|
||||
default:
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if let message = response["log"] as? String {
|
||||
return .log(message)
|
||||
}
|
||||
|
||||
return .error(.wrongMessageFormat)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
//
|
||||
// ReCaptchaError.swift
|
||||
// ReCaptcha
|
||||
//
|
||||
// Created by Flávio Caetano on 22/03/17.
|
||||
// Copyright © 2018 ReCaptcha. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
/// The codes of possible errors thrown by ReCaptcha
|
||||
public enum ReCaptchaError: Error, CustomStringConvertible {
|
||||
/// Unexpected error
|
||||
case unexpected(Error)
|
||||
|
||||
/// Could not load the HTML embedded in the bundle
|
||||
case htmlLoadError
|
||||
|
||||
/// ReCaptchaKey was not provided
|
||||
case apiKeyNotFound
|
||||
|
||||
/// ReCaptchaDomain was not provided
|
||||
case baseURLNotFound
|
||||
|
||||
/// Received an unexpected message from javascript
|
||||
case wrongMessageFormat
|
||||
|
||||
|
||||
/// A human-readable description for each error
|
||||
public var description: String {
|
||||
switch self {
|
||||
case .unexpected(let error):
|
||||
return "Unexpected Error: \(error)"
|
||||
|
||||
case .htmlLoadError:
|
||||
return "Could not load embedded HTML"
|
||||
|
||||
case .apiKeyNotFound:
|
||||
return "ReCaptchaKey not provided"
|
||||
|
||||
case .baseURLNotFound:
|
||||
return "ReCaptchaDomain not provided"
|
||||
|
||||
case .wrongMessageFormat:
|
||||
return "Unexpected message from javascript"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
//
|
||||
// ReCaptchaWebViewManager.swift
|
||||
// ReCaptcha
|
||||
//
|
||||
// Created by Flávio Caetano on 06/03/17.
|
||||
// Copyright © 2018 ReCaptcha. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
/** The ReCaptcha result.
|
||||
|
||||
This may contain the validation token on success, or an error that may have occurred.
|
||||
*/
|
||||
public enum ReCaptchaResult {
|
||||
/// The validation token.
|
||||
case token(String)
|
||||
|
||||
/// An error that may have occurred.
|
||||
case error(ReCaptchaError)
|
||||
|
||||
/**
|
||||
- returns: The validation token uppon success.
|
||||
|
||||
Tries to unwrap the Result and retrieve the token if it's successful.
|
||||
|
||||
- Throws: `ReCaptchaError`
|
||||
*/
|
||||
public func dematerialize() throws -> String {
|
||||
switch self {
|
||||
case .token(let token):
|
||||
return token
|
||||
|
||||
case .error(let error):
|
||||
throw error
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,319 @@
|
|||
//
|
||||
// ReCaptchaWebViewManager.swift
|
||||
// ReCaptcha
|
||||
//
|
||||
// Created by Flávio Caetano on 22/03/17.
|
||||
// Copyright © 2018 ReCaptcha. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import WebKit
|
||||
|
||||
|
||||
/** Handles comunications with the webview containing the ReCaptcha challenge.
|
||||
*/
|
||||
internal class ReCaptchaWebViewManager {
|
||||
|
||||
fileprivate struct Constants {
|
||||
static let ExecuteJSCommand = "execute();"
|
||||
static let ResetCommand = "reset();"
|
||||
static let BotUserAgent = "Googlebot/2.1"
|
||||
static let NumberOfDivsCommand = "document.getElementsByTagName(\"div\").length"
|
||||
|
||||
static let MinNumberOfDivs = 5
|
||||
static let NumberOfDivsFinishedLoadingAttempts = 10
|
||||
|
||||
// A page doesn't have enough time to load on old devices
|
||||
static let NumberOfDivsLoadingDelay = 0.5
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
/// Forces the challenge to be explicitly displayed.
|
||||
var forceVisibleChallenge = false {
|
||||
didSet {
|
||||
// Also works on iOS < 9
|
||||
webView.performSelector(
|
||||
onMainThread: "_setCustomUserAgent:",
|
||||
with: forceVisibleChallenge ? Constants.BotUserAgent : nil,
|
||||
waitUntilDone: true
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/// Allows validation stubbing for testing
|
||||
public var shouldSkipForTests = false
|
||||
#endif
|
||||
|
||||
/// Callback for loading state changing
|
||||
var onLoadingChanged: ReCaptcha.BoolParameterClosure?
|
||||
|
||||
/// Sends the result message
|
||||
var completion: ((ReCaptchaResult) -> Void)?
|
||||
|
||||
/// Configures the webview for display when required
|
||||
var configureWebView: ((WKWebView) -> Void)?
|
||||
|
||||
/// The dispatch token used to ensure `configureWebView` is only called once.
|
||||
var configureWebViewDispatchToken = UUID()
|
||||
|
||||
/// If the ReCaptcha should be reset when it errors
|
||||
var shouldResetOnError = true
|
||||
|
||||
/// The JS message recoder
|
||||
fileprivate var decoder: ReCaptchaDecoder!
|
||||
|
||||
/// Indicates if the script has already been loaded by the `webView`
|
||||
fileprivate var didFinishLoading = false { // webView.isLoading does not work for WKWebview.loadHTMLString
|
||||
didSet {
|
||||
if didFinishLoading && completion != nil {
|
||||
// User has requested for validation
|
||||
// A small delay is necessary to allow JS to wrap its operations and avoid errors.
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.05) { [weak self] in
|
||||
self?.execute()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// The observer for `.UIWindowDidBecomeVisible`
|
||||
fileprivate var observer: NSObjectProtocol?
|
||||
|
||||
/// The observer for `\WKWebView.estimatedProgress`
|
||||
fileprivate var loadingObservation: NSKeyValueObservation?
|
||||
|
||||
/// The endpoint url being used
|
||||
fileprivate var endpoint: String
|
||||
|
||||
/// The webview that executes JS code
|
||||
lazy var webView: WKWebView = {
|
||||
let webview = WKWebView(
|
||||
frame: CGRect(x: 0, y: 0, width: 1, height: 1),
|
||||
configuration: self.buildConfiguration()
|
||||
)
|
||||
webview.accessibilityIdentifier = "webview"
|
||||
webview.accessibilityTraits = UIAccessibilityTraits.link
|
||||
webview.isHidden = true
|
||||
self.loadingObservation = webview.observe(\.estimatedProgress, options: [.new]) { [weak self] _, change in
|
||||
self?.didFinishLoading = change.newValue == 1
|
||||
}
|
||||
|
||||
return webview
|
||||
}()
|
||||
|
||||
/**
|
||||
- parameters:
|
||||
- html: The HTML string to be loaded onto the webview
|
||||
- apiKey: The Google's ReCaptcha API Key
|
||||
- baseURL: The URL configured with the API Key
|
||||
- endpoint: The JS API endpoint to be loaded onto the HTML file.
|
||||
*/
|
||||
init(html: String, apiKey: String, baseURL: URL, endpoint: String) {
|
||||
self.endpoint = endpoint
|
||||
|
||||
self.decoder = ReCaptchaDecoder { [weak self] result in
|
||||
self?.handle(result: result)
|
||||
}
|
||||
|
||||
let formattedHTML = String(format: html, arguments: ["apiKey": apiKey, "endpoint": endpoint])
|
||||
|
||||
if let window = UIApplication.shared.keyWindow {
|
||||
setupWebview(on: window, html: formattedHTML, url: baseURL)
|
||||
}
|
||||
else {
|
||||
observer = NotificationCenter.default.addObserver(
|
||||
forName: UIWindow.didBecomeVisibleNotification,
|
||||
object: nil,
|
||||
queue: nil
|
||||
) { [weak self] notification in
|
||||
guard let window = notification.object as? UIWindow else { return }
|
||||
self?.setupWebview(on: window, html: formattedHTML, url: baseURL)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
- parameter view: The view that should present the webview.
|
||||
|
||||
Starts the challenge validation
|
||||
*/
|
||||
func validate(on view: UIView) {
|
||||
onLoadingChanged?(true)
|
||||
#if DEBUG
|
||||
guard !shouldSkipForTests else {
|
||||
completion?(.token(""))
|
||||
return
|
||||
}
|
||||
#endif
|
||||
webView.isHidden = false
|
||||
view.addSubview(webView)
|
||||
|
||||
execute()
|
||||
}
|
||||
|
||||
|
||||
/// Stops the execution of the webview
|
||||
func stop() {
|
||||
webView.stopLoading()
|
||||
}
|
||||
|
||||
/**
|
||||
Resets the ReCaptcha.
|
||||
|
||||
The reset is achieved by calling `grecaptcha.reset()` on the JS API.
|
||||
*/
|
||||
func reset() {
|
||||
didFinishLoading = false
|
||||
configureWebViewDispatchToken = UUID()
|
||||
|
||||
webView.evaluateJavaScript(Constants.ResetCommand) { [weak self] _, error in
|
||||
if let error = error {
|
||||
self?.decoder.send(error: .unexpected(error))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Private Methods
|
||||
|
||||
/** Private methods for ReCaptchaWebViewManager
|
||||
*/
|
||||
fileprivate extension ReCaptchaWebViewManager {
|
||||
/** Executes the JS command that loads the ReCaptcha challenge after a page finished loading.
|
||||
This method has no effect if the webview hasn't finished loading.
|
||||
*/
|
||||
func execute() {
|
||||
guard didFinishLoading else {
|
||||
// Hasn't finished loading the HTML yet
|
||||
return
|
||||
}
|
||||
|
||||
evaluateExecuteWhenLoadingFinished(count: 0)
|
||||
}
|
||||
|
||||
/**
|
||||
- parameter count: Number of checks of number of divs
|
||||
|
||||
Executes the JS command that returns number of divs.
|
||||
*/
|
||||
func evaluateExecuteWhenLoadingFinished(count: Int) {
|
||||
webView.evaluateJavaScript(Constants.NumberOfDivsCommand) { [weak self] (result, error) -> Void in
|
||||
if let error = error {
|
||||
self?.decoder.send(error: .unexpected(error))
|
||||
self?.onLoadingChanged?(false)
|
||||
} else {
|
||||
self?.handleNumberOfDivs(result: result, count: count)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
- parameters:
|
||||
- result: Result of number of divs command evaluation
|
||||
- count: Number of checks of divs count
|
||||
|
||||
Handles number of divs command result.
|
||||
*/
|
||||
func handleNumberOfDivs(result: Any?, count: Int) {
|
||||
if let result = result as? Int, result >= Constants.MinNumberOfDivs {
|
||||
evaluateExecute()
|
||||
} else {
|
||||
handleInvalidNumberOfDivsResult(count: count)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
- parameter count: Number of checks of number of divs
|
||||
|
||||
Handles invalid number of divs.
|
||||
*/
|
||||
func handleInvalidNumberOfDivsResult(count: Int) {
|
||||
if count < Constants.NumberOfDivsFinishedLoadingAttempts {
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + Constants.NumberOfDivsLoadingDelay) { [weak self] in
|
||||
self?.evaluateExecuteWhenLoadingFinished(count: count + 1)
|
||||
}
|
||||
} else {
|
||||
decoder.send(error: .htmlLoadError)
|
||||
onLoadingChanged?(false)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Executes the JS command that loads the ReCaptcha challenge.
|
||||
*/
|
||||
func evaluateExecute() {
|
||||
webView.evaluateJavaScript(Constants.ExecuteJSCommand) { [weak self] _, error in
|
||||
if let error = error {
|
||||
self?.decoder.send(error: .unexpected(error))
|
||||
}
|
||||
self?.onLoadingChanged?(false)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
- returns: An instance of `WKWebViewConfiguration`
|
||||
|
||||
Creates a `WKWebViewConfiguration` to be added to the `WKWebView` instance.
|
||||
*/
|
||||
func buildConfiguration() -> WKWebViewConfiguration {
|
||||
let controller = WKUserContentController()
|
||||
controller.add(decoder, name: "recaptcha")
|
||||
|
||||
let conf = WKWebViewConfiguration()
|
||||
conf.userContentController = controller
|
||||
|
||||
return conf
|
||||
}
|
||||
|
||||
/**
|
||||
- parameter result: A `ReCaptchaDecoder.Result` with the decoded message.
|
||||
|
||||
Handles the decoder results received from the webview
|
||||
*/
|
||||
func handle(result: ReCaptchaDecoder.Result) {
|
||||
switch result {
|
||||
case .token(let token):
|
||||
completion?(.token(token))
|
||||
|
||||
case .error(let error):
|
||||
if shouldResetOnError, let view = webView.superview {
|
||||
reset()
|
||||
validate(on: view)
|
||||
}
|
||||
else {
|
||||
completion?(.error(error))
|
||||
}
|
||||
|
||||
case .showReCaptcha:
|
||||
DispatchQueue.once(token: configureWebViewDispatchToken) { [weak self] in
|
||||
guard let `self` = self else { return }
|
||||
self.configureWebView?(self.webView)
|
||||
}
|
||||
|
||||
case .didLoad:
|
||||
// For testing purposes
|
||||
didFinishLoading = true
|
||||
|
||||
case .log(let message):
|
||||
#if DEBUG
|
||||
print("[JS LOG]:", message)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
- parameters:
|
||||
- window: The window in which to add the webview
|
||||
- html: The embedded HTML file
|
||||
- url: The base URL given to the webview
|
||||
|
||||
Adds the webview to a valid UIView and loads the initial HTML file
|
||||
*/
|
||||
func setupWebview(on window: UIWindow, html: String, url: URL) {
|
||||
window.addSubview(webView)
|
||||
webView.loadHTMLString(html, baseURL: url)
|
||||
|
||||
if let observer = observer {
|
||||
NotificationCenter.default.removeObserver(observer)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,87 @@
|
|||
//
|
||||
// ReCaptcha+Rx.swift
|
||||
// ReCaptcha
|
||||
//
|
||||
// Created by Flávio Caetano on 11/04/17.
|
||||
// Copyright © 2018 ReCaptcha. All rights reserved.
|
||||
//
|
||||
|
||||
import RxSwift
|
||||
import UIKit
|
||||
|
||||
public enum ReCaptchaRxError: Error {
|
||||
case baseWasReleased
|
||||
}
|
||||
|
||||
/// Makes ReCaptcha compatible with RxSwift extensions
|
||||
extension ReCaptcha: ReactiveCompatible {}
|
||||
|
||||
/// Provides a public extension on ReCaptcha that makes it reactive.
|
||||
public extension Reactive where Base: ReCaptcha {
|
||||
|
||||
/**
|
||||
- parameters:
|
||||
- view: The view that should present the webview.
|
||||
- resetOnError: If ReCaptcha should be reset if it errors. Defaults to `true`
|
||||
|
||||
Starts the challenge validation uppon subscription.
|
||||
|
||||
The stream's element is a String with the validation token.
|
||||
|
||||
Sends `stop()` uppon disposal.
|
||||
|
||||
- See: `ReCaptcha.validate(on:resetOnError:completion:)`
|
||||
- See: `ReCaptcha.stop()`
|
||||
*/
|
||||
func validate(on view: UIView, resetOnError: Bool = true) -> Observable<String> {
|
||||
return Single<String>.create { [weak base] single in
|
||||
base?.validate(on: view, resetOnError: resetOnError) { result in
|
||||
switch result {
|
||||
case .token(let token):
|
||||
single(.success(token))
|
||||
|
||||
case .error(let error):
|
||||
single(.error(error))
|
||||
}
|
||||
}
|
||||
|
||||
return Disposables.create { [weak base] in
|
||||
base?.stop()
|
||||
}
|
||||
}
|
||||
.asObservable()
|
||||
}
|
||||
|
||||
/**
|
||||
Resets the ReCaptcha.
|
||||
|
||||
The reset is achieved by calling `grecaptcha.reset()` on the JS API.
|
||||
|
||||
- See: `ReCaptcha.reset()`
|
||||
*/
|
||||
var reset: AnyObserver<Void> {
|
||||
return AnyObserver { [weak base] event in
|
||||
guard case .next = event else {
|
||||
return
|
||||
}
|
||||
|
||||
base?.reset()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Observable of loading state
|
||||
(will not work if someone changes onLoadingChanged variable; current onLodinglChanged will not work after subscription)
|
||||
*/
|
||||
var loadingObservable: Observable<Bool> {
|
||||
return .create { [weak base] observer -> Disposable in
|
||||
guard let base = base else {
|
||||
observer.onError(ReCaptchaRxError.baseWasReleased)
|
||||
return Disposables.create()
|
||||
}
|
||||
|
||||
base.onLoadingChanged = { observer.onNext($0) }
|
||||
return Disposables.create { [weak base] in base?.onLoadingChanged = nil }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
//
|
||||
// String+Dict.swift
|
||||
// ReCaptcha
|
||||
//
|
||||
// Created by Flávio Caetano on 10/10/17.
|
||||
// Copyright © 2018 ReCaptcha. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
extension String {
|
||||
/**
|
||||
- parameters:
|
||||
- format: The string to be formatted.
|
||||
- arguments: A dictionary containing the which keys should be replaced by which values.
|
||||
- returns: A formatted string
|
||||
|
||||
Parses a format string using a dictionary of arguments
|
||||
|
||||
Replaces occurrences of `"${key}"` with their respective values.
|
||||
|
||||
```
|
||||
String(format: "Hello, ${user}", ["user": "Flavio"]) // Hello, Flavio
|
||||
```
|
||||
*/
|
||||
init(format: String, arguments: [String: CustomStringConvertible]) {
|
||||
self.init(describing: arguments.reduce(format)
|
||||
{ (format: String, args: (key: String, value: CustomStringConvertible)) -> String in
|
||||
format.replacingOccurrences(of: "${\(args.key)}", with: args.value.description)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>$(CURRENT_PROJECT_VERSION)</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string></string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
//
|
||||
// ReCaptcha_RxSwift.h
|
||||
// ReCaptcha_RxSwift
|
||||
//
|
||||
// Created by Flávio Caetano on 10/10/17.
|
||||
// Copyright © 2017 Flávio Caetano. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@import ReCaptcha;
|
||||
|
||||
//! Project version number for ReCaptcha_RxSwift.
|
||||
FOUNDATION_EXPORT double ReCaptcha_RxSwiftVersionNumber;
|
||||
|
||||
//! Project version string for ReCaptcha_RxSwift.
|
||||
FOUNDATION_EXPORT const unsigned char ReCaptcha_RxSwiftVersionString[];
|
||||
|
||||
// In this header, you should import all the public headers of your framework using statements like #import <ReCaptcha_RxSwift/PublicHeader.h>
|
||||
|
||||
|
||||
|
|
@ -0,0 +1 @@
|
|||
Example/Pods/Pods.xcodeproj
|
||||
|
|
@ -1 +0,0 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="136" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="a"><rect width="136" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#a)"><path fill="#555" d="M0 0h93v20H0z"/><path fill="#4c1" d="M93 0h43v20H93z"/><path fill="url(#b)" d="M0 0h136v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="110"> <text x="475" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="830">documentation</text><text x="475" y="140" transform="scale(.1)" textLength="830">documentation</text><text x="1135" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="330">100%</text><text x="1135" y="140" transform="scale(.1)" textLength="330">100%</text></g> </svg>
|
||||
|
Before Width: | Height: | Size: 966 B |
|
|
@ -0,0 +1,26 @@
|
|||
codecov:
|
||||
branch: master
|
||||
|
||||
coverage:
|
||||
precision: 2
|
||||
round: down
|
||||
range: "75...95"
|
||||
|
||||
status:
|
||||
project:
|
||||
default:
|
||||
target: auto
|
||||
threshold: null
|
||||
branches: null
|
||||
|
||||
patch:
|
||||
default:
|
||||
target: auto
|
||||
branches: null
|
||||
|
||||
changes:
|
||||
default:
|
||||
branches: null
|
||||
|
||||
ignore:
|
||||
- "Example/"
|
||||
|
|
@ -1,200 +0,0 @@
|
|||
/* Credit to https://gist.github.com/wataru420/2048287 */
|
||||
.highlight {
|
||||
/* Comment */
|
||||
/* Error */
|
||||
/* Keyword */
|
||||
/* Operator */
|
||||
/* Comment.Multiline */
|
||||
/* Comment.Preproc */
|
||||
/* Comment.Single */
|
||||
/* Comment.Special */
|
||||
/* Generic.Deleted */
|
||||
/* Generic.Deleted.Specific */
|
||||
/* Generic.Emph */
|
||||
/* Generic.Error */
|
||||
/* Generic.Heading */
|
||||
/* Generic.Inserted */
|
||||
/* Generic.Inserted.Specific */
|
||||
/* Generic.Output */
|
||||
/* Generic.Prompt */
|
||||
/* Generic.Strong */
|
||||
/* Generic.Subheading */
|
||||
/* Generic.Traceback */
|
||||
/* Keyword.Constant */
|
||||
/* Keyword.Declaration */
|
||||
/* Keyword.Pseudo */
|
||||
/* Keyword.Reserved */
|
||||
/* Keyword.Type */
|
||||
/* Literal.Number */
|
||||
/* Literal.String */
|
||||
/* Name.Attribute */
|
||||
/* Name.Builtin */
|
||||
/* Name.Class */
|
||||
/* Name.Constant */
|
||||
/* Name.Entity */
|
||||
/* Name.Exception */
|
||||
/* Name.Function */
|
||||
/* Name.Namespace */
|
||||
/* Name.Tag */
|
||||
/* Name.Variable */
|
||||
/* Operator.Word */
|
||||
/* Text.Whitespace */
|
||||
/* Literal.Number.Float */
|
||||
/* Literal.Number.Hex */
|
||||
/* Literal.Number.Integer */
|
||||
/* Literal.Number.Oct */
|
||||
/* Literal.String.Backtick */
|
||||
/* Literal.String.Char */
|
||||
/* Literal.String.Doc */
|
||||
/* Literal.String.Double */
|
||||
/* Literal.String.Escape */
|
||||
/* Literal.String.Heredoc */
|
||||
/* Literal.String.Interpol */
|
||||
/* Literal.String.Other */
|
||||
/* Literal.String.Regex */
|
||||
/* Literal.String.Single */
|
||||
/* Literal.String.Symbol */
|
||||
/* Name.Builtin.Pseudo */
|
||||
/* Name.Variable.Class */
|
||||
/* Name.Variable.Global */
|
||||
/* Name.Variable.Instance */
|
||||
/* Literal.Number.Integer.Long */ }
|
||||
.highlight .c {
|
||||
color: #999988;
|
||||
font-style: italic; }
|
||||
.highlight .err {
|
||||
color: #a61717;
|
||||
background-color: #e3d2d2; }
|
||||
.highlight .k {
|
||||
color: #000000;
|
||||
font-weight: bold; }
|
||||
.highlight .o {
|
||||
color: #000000;
|
||||
font-weight: bold; }
|
||||
.highlight .cm {
|
||||
color: #999988;
|
||||
font-style: italic; }
|
||||
.highlight .cp {
|
||||
color: #999999;
|
||||
font-weight: bold; }
|
||||
.highlight .c1 {
|
||||
color: #999988;
|
||||
font-style: italic; }
|
||||
.highlight .cs {
|
||||
color: #999999;
|
||||
font-weight: bold;
|
||||
font-style: italic; }
|
||||
.highlight .gd {
|
||||
color: #000000;
|
||||
background-color: #ffdddd; }
|
||||
.highlight .gd .x {
|
||||
color: #000000;
|
||||
background-color: #ffaaaa; }
|
||||
.highlight .ge {
|
||||
color: #000000;
|
||||
font-style: italic; }
|
||||
.highlight .gr {
|
||||
color: #aa0000; }
|
||||
.highlight .gh {
|
||||
color: #999999; }
|
||||
.highlight .gi {
|
||||
color: #000000;
|
||||
background-color: #ddffdd; }
|
||||
.highlight .gi .x {
|
||||
color: #000000;
|
||||
background-color: #aaffaa; }
|
||||
.highlight .go {
|
||||
color: #888888; }
|
||||
.highlight .gp {
|
||||
color: #555555; }
|
||||
.highlight .gs {
|
||||
font-weight: bold; }
|
||||
.highlight .gu {
|
||||
color: #aaaaaa; }
|
||||
.highlight .gt {
|
||||
color: #aa0000; }
|
||||
.highlight .kc {
|
||||
color: #000000;
|
||||
font-weight: bold; }
|
||||
.highlight .kd {
|
||||
color: #000000;
|
||||
font-weight: bold; }
|
||||
.highlight .kp {
|
||||
color: #000000;
|
||||
font-weight: bold; }
|
||||
.highlight .kr {
|
||||
color: #000000;
|
||||
font-weight: bold; }
|
||||
.highlight .kt {
|
||||
color: #445588; }
|
||||
.highlight .m {
|
||||
color: #009999; }
|
||||
.highlight .s {
|
||||
color: #d14; }
|
||||
.highlight .na {
|
||||
color: #008080; }
|
||||
.highlight .nb {
|
||||
color: #0086B3; }
|
||||
.highlight .nc {
|
||||
color: #445588;
|
||||
font-weight: bold; }
|
||||
.highlight .no {
|
||||
color: #008080; }
|
||||
.highlight .ni {
|
||||
color: #800080; }
|
||||
.highlight .ne {
|
||||
color: #990000;
|
||||
font-weight: bold; }
|
||||
.highlight .nf {
|
||||
color: #990000; }
|
||||
.highlight .nn {
|
||||
color: #555555; }
|
||||
.highlight .nt {
|
||||
color: #000080; }
|
||||
.highlight .nv {
|
||||
color: #008080; }
|
||||
.highlight .ow {
|
||||
color: #000000;
|
||||
font-weight: bold; }
|
||||
.highlight .w {
|
||||
color: #bbbbbb; }
|
||||
.highlight .mf {
|
||||
color: #009999; }
|
||||
.highlight .mh {
|
||||
color: #009999; }
|
||||
.highlight .mi {
|
||||
color: #009999; }
|
||||
.highlight .mo {
|
||||
color: #009999; }
|
||||
.highlight .sb {
|
||||
color: #d14; }
|
||||
.highlight .sc {
|
||||
color: #d14; }
|
||||
.highlight .sd {
|
||||
color: #d14; }
|
||||
.highlight .s2 {
|
||||
color: #d14; }
|
||||
.highlight .se {
|
||||
color: #d14; }
|
||||
.highlight .sh {
|
||||
color: #d14; }
|
||||
.highlight .si {
|
||||
color: #d14; }
|
||||
.highlight .sx {
|
||||
color: #d14; }
|
||||
.highlight .sr {
|
||||
color: #009926; }
|
||||
.highlight .s1 {
|
||||
color: #d14; }
|
||||
.highlight .ss {
|
||||
color: #990073; }
|
||||
.highlight .bp {
|
||||
color: #999999; }
|
||||
.highlight .vc {
|
||||
color: #008080; }
|
||||
.highlight .vg {
|
||||
color: #008080; }
|
||||
.highlight .vi {
|
||||
color: #008080; }
|
||||
.highlight .il {
|
||||
color: #009999; }
|
||||
337
css/jazzy.css
337
css/jazzy.css
|
|
@ -1,337 +0,0 @@
|
|||
html, body, div, span, h1, h3, h4, p, a, code, em, img, ul, li, table, tbody, tr, td {
|
||||
background: transparent;
|
||||
border: 0;
|
||||
margin: 0;
|
||||
outline: 0;
|
||||
padding: 0;
|
||||
vertical-align: baseline; }
|
||||
|
||||
body {
|
||||
background-color: #f2f2f2;
|
||||
font-family: Helvetica, freesans, Arial, sans-serif;
|
||||
font-size: 14px;
|
||||
-webkit-font-smoothing: subpixel-antialiased;
|
||||
word-wrap: break-word; }
|
||||
|
||||
h1, h2, h3 {
|
||||
margin-top: 0.8em;
|
||||
margin-bottom: 0.3em;
|
||||
font-weight: 100;
|
||||
color: black; }
|
||||
|
||||
h1 {
|
||||
font-size: 2.5em; }
|
||||
|
||||
h2 {
|
||||
font-size: 2em;
|
||||
border-bottom: 1px solid #e2e2e2; }
|
||||
|
||||
h4 {
|
||||
font-size: 13px;
|
||||
line-height: 1.5;
|
||||
margin-top: 21px; }
|
||||
|
||||
h5 {
|
||||
font-size: 1.1em; }
|
||||
|
||||
h6 {
|
||||
font-size: 1.1em;
|
||||
color: #777; }
|
||||
|
||||
.section-name {
|
||||
color: gray;
|
||||
display: block;
|
||||
font-family: Helvetica;
|
||||
font-size: 22px;
|
||||
font-weight: 100;
|
||||
margin-bottom: 15px; }
|
||||
|
||||
pre, code {
|
||||
font: 0.95em Menlo, monospace;
|
||||
color: #777;
|
||||
word-wrap: normal; }
|
||||
|
||||
p code, li code {
|
||||
background-color: #eee;
|
||||
padding: 2px 4px;
|
||||
border-radius: 4px; }
|
||||
|
||||
a {
|
||||
color: #0088cc;
|
||||
text-decoration: none; }
|
||||
|
||||
ul {
|
||||
padding-left: 15px; }
|
||||
|
||||
li {
|
||||
line-height: 1.8em; }
|
||||
|
||||
img {
|
||||
max-width: 100%; }
|
||||
|
||||
blockquote {
|
||||
margin-left: 0;
|
||||
padding: 0 10px;
|
||||
border-left: 4px solid #ccc; }
|
||||
|
||||
.content-wrapper {
|
||||
margin: 0 auto;
|
||||
width: 980px; }
|
||||
|
||||
header {
|
||||
font-size: 0.85em;
|
||||
line-height: 26px;
|
||||
background-color: #414141;
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
z-index: 1; }
|
||||
header img {
|
||||
padding-right: 6px;
|
||||
vertical-align: -4px;
|
||||
height: 16px; }
|
||||
header a {
|
||||
color: #fff; }
|
||||
header p {
|
||||
float: left;
|
||||
color: #999; }
|
||||
header .header-right {
|
||||
float: right;
|
||||
margin-left: 16px; }
|
||||
|
||||
#breadcrumbs {
|
||||
background-color: #f2f2f2;
|
||||
height: 27px;
|
||||
padding-top: 17px;
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
z-index: 1;
|
||||
margin-top: 26px; }
|
||||
#breadcrumbs #carat {
|
||||
height: 10px;
|
||||
margin: 0 5px; }
|
||||
|
||||
.sidebar {
|
||||
background-color: #f9f9f9;
|
||||
border: 1px solid #e2e2e2;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
position: fixed;
|
||||
top: 70px;
|
||||
bottom: 0;
|
||||
width: 230px;
|
||||
word-wrap: normal; }
|
||||
|
||||
.nav-groups {
|
||||
list-style-type: none;
|
||||
background: #fff;
|
||||
padding-left: 0; }
|
||||
|
||||
.nav-group-name {
|
||||
border-bottom: 1px solid #e2e2e2;
|
||||
font-size: 1.1em;
|
||||
font-weight: 100;
|
||||
padding: 15px 0 15px 20px; }
|
||||
.nav-group-name > a {
|
||||
color: #333; }
|
||||
|
||||
.nav-group-tasks {
|
||||
margin-top: 5px; }
|
||||
|
||||
.nav-group-task {
|
||||
font-size: 0.9em;
|
||||
list-style-type: none;
|
||||
white-space: nowrap; }
|
||||
.nav-group-task a {
|
||||
color: #888; }
|
||||
|
||||
.main-content {
|
||||
background-color: #fff;
|
||||
border: 1px solid #e2e2e2;
|
||||
margin-left: 246px;
|
||||
position: absolute;
|
||||
overflow: hidden;
|
||||
padding-bottom: 60px;
|
||||
top: 70px;
|
||||
width: 734px; }
|
||||
.main-content p, .main-content a, .main-content code, .main-content em, .main-content ul, .main-content table, .main-content blockquote {
|
||||
margin-bottom: 1em; }
|
||||
.main-content p {
|
||||
line-height: 1.8em; }
|
||||
.main-content section .section:first-child {
|
||||
margin-top: 0;
|
||||
padding-top: 0; }
|
||||
.main-content section .task-group-section .task-group:first-of-type {
|
||||
padding-top: 10px; }
|
||||
.main-content section .task-group-section .task-group:first-of-type .section-name {
|
||||
padding-top: 15px; }
|
||||
.main-content section .heading:before {
|
||||
content: "";
|
||||
display: block;
|
||||
padding-top: 70px;
|
||||
margin: -70px 0 0; }
|
||||
|
||||
.section {
|
||||
padding: 0 25px; }
|
||||
|
||||
.highlight {
|
||||
background-color: #eee;
|
||||
padding: 10px 12px;
|
||||
border: 1px solid #e2e2e2;
|
||||
border-radius: 4px;
|
||||
overflow-x: auto; }
|
||||
|
||||
.declaration .highlight {
|
||||
overflow-x: initial;
|
||||
padding: 0 40px 40px 0;
|
||||
margin-bottom: -25px;
|
||||
background-color: transparent;
|
||||
border: none; }
|
||||
|
||||
.section-name {
|
||||
margin: 0;
|
||||
margin-left: 18px; }
|
||||
|
||||
.task-group-section {
|
||||
padding-left: 6px;
|
||||
border-top: 1px solid #e2e2e2; }
|
||||
|
||||
.task-group {
|
||||
padding-top: 0px; }
|
||||
|
||||
.task-name-container a[name]:before {
|
||||
content: "";
|
||||
display: block;
|
||||
padding-top: 70px;
|
||||
margin: -70px 0 0; }
|
||||
|
||||
.item {
|
||||
padding-top: 8px;
|
||||
width: 100%;
|
||||
list-style-type: none; }
|
||||
.item a[name]:before {
|
||||
content: "";
|
||||
display: block;
|
||||
padding-top: 70px;
|
||||
margin: -70px 0 0; }
|
||||
.item code {
|
||||
background-color: transparent;
|
||||
padding: 0; }
|
||||
.item .token {
|
||||
padding-left: 3px;
|
||||
margin-left: 15px;
|
||||
font-size: 11.9px; }
|
||||
.item .declaration-note {
|
||||
font-size: .85em;
|
||||
color: gray;
|
||||
font-style: italic; }
|
||||
|
||||
.pointer-container {
|
||||
border-bottom: 1px solid #e2e2e2;
|
||||
left: -23px;
|
||||
padding-bottom: 13px;
|
||||
position: relative;
|
||||
width: 110%; }
|
||||
|
||||
.pointer {
|
||||
background: #f9f9f9;
|
||||
border-left: 1px solid #e2e2e2;
|
||||
border-top: 1px solid #e2e2e2;
|
||||
height: 12px;
|
||||
left: 21px;
|
||||
top: -7px;
|
||||
-webkit-transform: rotate(45deg);
|
||||
-moz-transform: rotate(45deg);
|
||||
-o-transform: rotate(45deg);
|
||||
transform: rotate(45deg);
|
||||
position: absolute;
|
||||
width: 12px; }
|
||||
|
||||
.height-container {
|
||||
display: none;
|
||||
left: -25px;
|
||||
padding: 0 25px;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
overflow: hidden; }
|
||||
.height-container .section {
|
||||
background: #f9f9f9;
|
||||
border-bottom: 1px solid #e2e2e2;
|
||||
left: -25px;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
padding-top: 10px;
|
||||
padding-bottom: 5px; }
|
||||
|
||||
.aside, .language {
|
||||
padding: 6px 12px;
|
||||
margin: 12px 0;
|
||||
border-left: 5px solid #dddddd;
|
||||
overflow-y: hidden; }
|
||||
.aside .aside-title, .language .aside-title {
|
||||
font-size: 9px;
|
||||
letter-spacing: 2px;
|
||||
text-transform: uppercase;
|
||||
padding-bottom: 0;
|
||||
margin: 0;
|
||||
color: #aaa;
|
||||
-webkit-user-select: none; }
|
||||
.aside p:last-child, .language p:last-child {
|
||||
margin-bottom: 0; }
|
||||
|
||||
.language {
|
||||
border-left: 5px solid #cde9f4; }
|
||||
.language .aside-title {
|
||||
color: #4b8afb; }
|
||||
|
||||
.aside-warning {
|
||||
border-left: 5px solid #ff6666; }
|
||||
.aside-warning .aside-title {
|
||||
color: #ff0000; }
|
||||
|
||||
.graybox {
|
||||
border-collapse: collapse;
|
||||
width: 100%; }
|
||||
.graybox p {
|
||||
margin: 0;
|
||||
word-break: break-word;
|
||||
min-width: 50px; }
|
||||
.graybox td {
|
||||
border: 1px solid #e2e2e2;
|
||||
padding: 5px 25px 5px 10px;
|
||||
vertical-align: middle; }
|
||||
.graybox tr td:first-of-type {
|
||||
text-align: right;
|
||||
padding: 7px;
|
||||
vertical-align: top;
|
||||
word-break: normal;
|
||||
width: 40px; }
|
||||
|
||||
.slightly-smaller {
|
||||
font-size: 0.9em; }
|
||||
|
||||
#footer {
|
||||
position: absolute;
|
||||
bottom: 10px;
|
||||
margin-left: 25px; }
|
||||
#footer p {
|
||||
margin: 0;
|
||||
color: #aaa;
|
||||
font-size: 0.8em; }
|
||||
|
||||
html.dash header, html.dash #breadcrumbs, html.dash .sidebar {
|
||||
display: none; }
|
||||
html.dash .main-content {
|
||||
width: 980px;
|
||||
margin-left: 0;
|
||||
border: none;
|
||||
width: 100%;
|
||||
top: 0;
|
||||
padding-bottom: 0; }
|
||||
html.dash .height-container {
|
||||
display: block; }
|
||||
html.dash .item .token {
|
||||
margin-left: 0; }
|
||||
html.dash .content-wrapper {
|
||||
width: auto; }
|
||||
html.dash #footer {
|
||||
position: static; }
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.jazzy.recaptcha</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>ReCaptcha</string>
|
||||
<key>DocSetPlatformFamily</key>
|
||||
<string>recaptcha</string>
|
||||
<key>isDashDocset</key>
|
||||
<true/>
|
||||
<key>dashIndexFilePath</key>
|
||||
<string>index.html</string>
|
||||
<key>isJavaScriptEnabled</key>
|
||||
<true/>
|
||||
<key>DashDocSetFamily</key>
|
||||
<string>dashtoc</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
@ -1,111 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Classes Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="js/jquery.min.js" defer></script>
|
||||
<script src="js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a title="Classes Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="index.html">ReCaptcha Docs</a> (100% documented)</p>
|
||||
<p class="header-right"><a href="https://github.com/fjcaetano/ReCaptcha"><img src="img/gh.png"/>View on GitHub</a></p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="index.html">ReCaptcha Reference</a>
|
||||
<img id="carat" src="img/carat.png" />
|
||||
Classes Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/ReCaptcha.html">ReCaptcha</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Classes/ReCaptcha/Endpoint.html">– Endpoint</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="Enums.html">Enumerations</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="Enums/ReCaptchaError.html">ReCaptchaError</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="Enums/ReCaptchaResult.html">ReCaptchaResult</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="Extensions.html">Extensions</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="Extensions/Reactive.html">Reactive</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>Classes</h1>
|
||||
<p>The following classes are available globally.</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptchaAAC"></a>
|
||||
<a name="//apple_ref/swift/Class/ReCaptcha" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptchaAAC">ReCaptcha</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
|
||||
<a href="Classes/ReCaptcha.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">ReCaptcha</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/fjcaetano" target="_blank" rel="external">Flávio Caetano (@fjcaetano)</a>. All rights reserved. (Last updated: 2018-09-28)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
|
|
@ -1,488 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>ReCaptcha Class Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="../js/jquery.min.js" defer></script>
|
||||
<script src="../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a name="//apple_ref/swift/Class/ReCaptcha" class="dashAnchor"></a>
|
||||
<a title="ReCaptcha Class Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../index.html">ReCaptcha Docs</a> (100% documented)</p>
|
||||
<p class="header-right"><a href="https://github.com/fjcaetano/ReCaptcha"><img src="../img/gh.png"/>View on GitHub</a></p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../index.html">ReCaptcha Reference</a>
|
||||
<img id="carat" src="../img/carat.png" />
|
||||
ReCaptcha Class Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ReCaptcha.html">ReCaptcha</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ReCaptcha/Endpoint.html">– Endpoint</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../Enums.html">Enumerations</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Enums/ReCaptchaError.html">ReCaptchaError</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Enums/ReCaptchaResult.html">ReCaptchaResult</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../Extensions.html">Extensions</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Extensions/Reactive.html">Reactive</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>ReCaptcha</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">ReCaptcha</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptchaAAC8EndpointO"></a>
|
||||
<a name="//apple_ref/swift/Enum/Endpoint" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptchaAAC8EndpointO">Endpoint</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The JS API endpoint to be loaded onto the HTML file.</p>
|
||||
|
||||
<a href="../Classes/ReCaptcha/Endpoint.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">Endpoint</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptchaAAC6apiKey7baseURL8endpoint6localeABSSSg_10Foundation0F0VSgAB8EndpointOAH6LocaleVSgtKcfc"></a>
|
||||
<a name="//apple_ref/swift/Method/init(apiKey:baseURL:endpoint:locale:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptchaAAC6apiKey7baseURL8endpoint6localeABSSSg_10Foundation0F0VSgAB8EndpointOAH6LocaleVSgtKcfc">init(apiKey:baseURL:endpoint:locale:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Initializes a ReCaptcha object</p>
|
||||
|
||||
<p>Both <code>apiKey</code> and <code>baseURL</code> may be nil, in which case the lib will look for entries of <code>ReCaptchaKey</code> and
|
||||
<code>ReCaptchaDomain</code>, respectively, in the project’s Info.plist</p>
|
||||
|
||||
<p>A key may be aquired here: <a href="https://www.google.com/recaptcha/admin#list">https://www.google.com/recaptcha/admin#list</a></p>
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
<code><a href="../Enums/ReCaptchaError.html#/s:9ReCaptcha0aB5ErrorO08htmlLoadC0yA2CmF">ReCaptchaError.htmlLoadError</a></code>: if is unable to load the HTML embedded in the bundle.
|
||||
|
||||
</div>
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
<code><a href="../Enums/ReCaptchaError.html#/s:9ReCaptcha0aB5ErrorO14apiKeyNotFoundyA2CmF">ReCaptchaError.apiKeyNotFound</a></code>: if an <code>apiKey</code> is not provided and can’t find one in the project’s
|
||||
Info.plist.
|
||||
|
||||
</div>
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
<code><a href="../Enums/ReCaptchaError.html#/s:9ReCaptcha0aB5ErrorO15baseURLNotFoundyA2CmF">ReCaptchaError.baseURLNotFound</a></code>: if a <code>baseURL</code> is not provided and can’t find one in the project’s
|
||||
Info.plist.
|
||||
|
||||
</div>
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
Rethrows any exceptions thrown by <code>String(contentsOfFile:)</code>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="n">convenience</span> <span class="nf">init</span><span class="p">(</span>
|
||||
<span class="nv">apiKey</span><span class="p">:</span> <span class="kt">String</span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">,</span>
|
||||
<span class="nv">baseURL</span><span class="p">:</span> <span class="kt">URL</span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">,</span>
|
||||
<span class="nv">endpoint</span><span class="p">:</span> <span class="kt"><a href="../Classes/ReCaptcha/Endpoint.html">Endpoint</a></span> <span class="o">=</span> <span class="o">.</span><span class="k">default</span><span class="p">,</span>
|
||||
<span class="nv">locale</span><span class="p">:</span> <span class="kt">Locale</span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span>
|
||||
<span class="p">)</span> <span class="k">throws</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>apiKey</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The API key sent to the ReCaptcha init</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>infoPlistKey</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The API key retrived from the application’s Info.plist</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>baseURL</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The base URL sent to the ReCaptcha init</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>infoPlistURL</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The base URL retrieved from the application’s Info.plist</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>locale</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>A locale value to translate ReCaptcha into a different language</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptchaAAC8validate2on12resetOnError10completionySo6UIViewC_SbyAA0aB6ResultOctF"></a>
|
||||
<a name="//apple_ref/swift/Method/validate(on:resetOnError:completion:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptchaAAC8validate2on12resetOnError10completionySo6UIViewC_SbyAA0aB6ResultOctF">validate(on:resetOnError:completion:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Starts the challenge validation</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">validate</span><span class="p">(</span><span class="n">on</span> <span class="nv">view</span><span class="p">:</span> <span class="kt">UIView</span><span class="p">,</span> <span class="nv">resetOnError</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">true</span><span class="p">,</span> <span class="nv">completion</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">(</span><span class="kt"><a href="../Enums/ReCaptchaResult.html">ReCaptchaResult</a></span><span class="p">)</span> <span class="o">-></span> <span class="kt">Void</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>view</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The view that should present the webview.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>resetOnError</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>If ReCaptcha should be reset if it errors. Defaults to <code>true</code>.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>completion</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>A closure that receives a ReCaptchaResult which may contain a valid result token.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptchaAAC4stopyyF"></a>
|
||||
<a name="//apple_ref/swift/Method/stop()" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptchaAAC4stopyyF">stop()</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Stops the execution of the webview</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">stop</span><span class="p">()</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptchaAAC16configureWebViewyyySo05WKWebE0CcF"></a>
|
||||
<a name="//apple_ref/swift/Method/configureWebView(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptchaAAC16configureWebViewyyySo05WKWebE0CcF">configureWebView(_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Provides a closure to configure the webview for presentation if necessary.</p>
|
||||
|
||||
<p>If presentation is required, the webview will already be a subview of <code>presenterView</code> if one is provided. Otherwise
|
||||
it might need to be added in a view currently visible.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">configureWebView</span><span class="p">(</span><span class="n">_</span> <span class="nv">configure</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">(</span><span class="kt">WKWebView</span><span class="p">)</span> <span class="o">-></span> <span class="kt">Void</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>configure</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>A closure that receives an instance of <code>WKWebView</code> for configuration.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptchaAAC5resetyyF"></a>
|
||||
<a name="//apple_ref/swift/Method/reset()" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptchaAAC5resetyyF">reset()</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Resets the ReCaptcha.</p>
|
||||
|
||||
<p>The reset is achieved by calling <code>grecaptcha.reset()</code> on the JS API.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">reset</span><span class="p">()</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<div class="task-name-container">
|
||||
<a name="/Development"></a>
|
||||
<a name="//apple_ref/swift/Section/Development" class="dashAnchor"></a>
|
||||
<a href="#/Development">
|
||||
<h3 class="section-name">Development</h3>
|
||||
</a>
|
||||
</div>
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptchaAAC21forceVisibleChallengeSbvp"></a>
|
||||
<a name="//apple_ref/swift/Property/forceVisibleChallenge" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptchaAAC21forceVisibleChallengeSbvp">forceVisibleChallenge</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Forces the challenge widget to be explicitly displayed.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">forceVisibleChallenge</span><span class="p">:</span> <span class="kt">Bool</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptchaAAC18shouldSkipForTestsSbvp"></a>
|
||||
<a name="//apple_ref/swift/Property/shouldSkipForTests" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptchaAAC18shouldSkipForTestsSbvp">shouldSkipForTests</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Allows validation stubbing for testing</p>
|
||||
|
||||
<p>When this property is set to <code>true</code>, every call to <code>validate()</code> will immediately be resolved with <code>.token("")</code>.</p>
|
||||
|
||||
<p>Use only when testing your application.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">shouldSkipForTests</span><span class="p">:</span> <span class="kt">Bool</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/fjcaetano" target="_blank" rel="external">Flávio Caetano (@fjcaetano)</a>. All rights reserved. (Last updated: 2018-09-28)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
|
|
@ -1,379 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Config Structure Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="../../js/jquery.min.js" defer></script>
|
||||
<script src="../../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a name="//apple_ref/swift/Struct/Config" class="dashAnchor"></a>
|
||||
<a title="Config Structure Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../../index.html">ReCaptcha Docs</a> (87% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../../index.html">ReCaptcha Reference</a>
|
||||
<img id="carat" src="../../img/carat.png" />
|
||||
Config Structure Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="../../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptcha.html">ReCaptcha</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptcha/Constants.html">– Constants</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptcha/Endpoint.html">– Endpoint</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptcha/Config.html">– Config</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptchaDecoder.html">ReCaptchaDecoder</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptchaDecoder/Result.html">– Result</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptchaWebViewManager.html">ReCaptchaWebViewManager</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptchaWebViewManager/WebViewDelegate.html">– WebViewDelegate</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptchaWebViewManager/Constants.html">– Constants</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../../Enums.html">Enumerations</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Enums/ReCaptchaError.html">ReCaptchaError</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../../Extensions.html">Extensions</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Extensions/DispatchQueue.html">DispatchQueue</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Extensions/Reactive.html">Reactive</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Extensions/String.html">String</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>Config</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">struct</span> <span class="kt">Config</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p>Internal data model for CI in unit tests</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptchaAAC6ConfigV4htmlSSv"></a>
|
||||
<a name="//apple_ref/swift/Property/html" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptchaAAC6ConfigV4htmlSSv">html</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The raw unformated HTML file content</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">let</span> <span class="nv">html</span><span class="p">:</span> <span class="kt">String</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptchaAAC6ConfigV6apiKeySSv"></a>
|
||||
<a name="//apple_ref/swift/Property/apiKey" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptchaAAC6ConfigV6apiKeySSv">apiKey</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The API key that will be sent to the ReCaptcha API</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">let</span> <span class="nv">apiKey</span><span class="p">:</span> <span class="kt">String</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptchaAAC6ConfigV7baseURL10Foundation0E0Vv"></a>
|
||||
<a name="//apple_ref/swift/Property/baseURL" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptchaAAC6ConfigV7baseURL10Foundation0E0Vv">baseURL</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The base url to be used to resolve relative URLs in the webview</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">let</span> <span class="nv">baseURL</span><span class="p">:</span> <span class="kt">URL</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptchaAAC6ConfigV6bundle33_D88FD3D3A2EDF5CB44B90FDF7C150474LLSo6BundleCvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/bundle" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptchaAAC6ConfigV6bundle33_D88FD3D3A2EDF5CB44B90FDF7C150474LLSo6BundleCvZ">bundle</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The Bundle that holds ReCaptcha’s assets</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">private</span> <span class="kd">static</span> <span class="k">let</span> <span class="nv">bundle</span><span class="p">:</span> <span class="kt">Bundle</span> <span class="o">=</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptchaAAC6ConfigVADSSSg6apiKey_AE09infoPlistE010Foundation3URLVSg04baseI0AK0fgI0tKcfc"></a>
|
||||
<a name="//apple_ref/swift/Method/init(apiKey:infoPlistKey:baseURL:infoPlistURL:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptchaAAC6ConfigVADSSSg6apiKey_AE09infoPlistE010Foundation3URLVSg04baseI0AK0fgI0tKcfc">init(apiKey:infoPlistKey:baseURL:infoPlistURL:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
<p><code><a href="../../Enums/ReCaptchaError.html#/s:9ReCaptcha0aB5ErrorO08htmlLoadC0A2CmF">ReCaptchaError.htmlLoadError</a></code>: if is unable to load the HTML embedded in the bundle.</p>
|
||||
|
||||
</div>
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
<p><code><a href="../../Enums/ReCaptchaError.html#/s:9ReCaptcha0aB5ErrorO14apiKeyNotFoundA2CmF">ReCaptchaError.apiKeyNotFound</a></code>: if an <code><a href="../../Classes/ReCaptcha/Config.html#/s:9ReCaptchaAAC6ConfigV6apiKeySSv">apiKey</a></code> is not provided and can’t find one in the project’s
|
||||
Info.plist.</p>
|
||||
|
||||
</div>
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
<p><code><a href="../../Enums/ReCaptchaError.html#/s:9ReCaptcha0aB5ErrorO15baseURLNotFoundA2CmF">ReCaptchaError.baseURLNotFound</a></code>: if a <code><a href="../../Classes/ReCaptcha/Config.html#/s:9ReCaptchaAAC6ConfigV7baseURL10Foundation0E0Vv">baseURL</a></code> is not provided and can’t find one in the project’s
|
||||
Info.plist.</p>
|
||||
|
||||
</div>
|
||||
<div class="aside aside-throws">
|
||||
<p class="aside-title">Throws</p>
|
||||
<p>Rethrows any exceptions thrown by <code>String(contentsOfFile:)</code></p>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">apiKey</span><span class="p">:</span> <span class="kt">String</span><span class="p">?,</span> <span class="nv">infoPlistKey</span><span class="p">:</span> <span class="kt">String</span><span class="p">?,</span> <span class="nv">baseURL</span><span class="p">:</span> <span class="kt">URL</span><span class="p">?,</span> <span class="nv">infoPlistURL</span><span class="p">:</span> <span class="kt">URL</span><span class="p">?)</span> <span class="k">throws</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>apiKey</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The API key sent to the ReCaptcha init</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>infoPlistKey</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The API key retrived from the application’s Info.plist</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>baseURL</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The base URL sent to the ReCaptcha init</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>infoPlistURL</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The base URL retrieved from the application’s Info.plist</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptchaAAC6ConfigV17fixSchemeIfNeeded33_D88FD3D3A2EDF5CB44B90FDF7C150474LL10Foundation3URLVAI3for_tFZ"></a>
|
||||
<a name="//apple_ref/swift/Method/fixSchemeIfNeeded(for:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptchaAAC6ConfigV17fixSchemeIfNeeded33_D88FD3D3A2EDF5CB44B90FDF7C150474LL10Foundation3URLVAI3for_tFZ">fixSchemeIfNeeded(for:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>If the given URL has no scheme, prepends <code>http://</code> to it and return the fixed URL.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">static</span> <span class="kd">func</span> <span class="nf">fixSchemeIfNeeded</span><span class="p">(</span><span class="k">for</span> <span class="nv">url</span><span class="p">:</span> <span class="kt">URL</span><span class="p">)</span> <span class="o">-></span> <span class="kt">URL</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>url</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The URL to be fixed</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>An URL with scheme</p>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/fjcaetano/ReCaptcha" target="_blank" rel="external">Flávio Caetano</a>. All rights reserved. (Last updated: 2018-03-06)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
|
|
@ -1,128 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Constants Structure Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="../../js/jquery.min.js" defer></script>
|
||||
<script src="../../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a name="//apple_ref/swift/Struct/Constants" class="dashAnchor"></a>
|
||||
<a title="Constants Structure Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../../index.html">ReCaptcha Docs</a> (87% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../../index.html">ReCaptcha Reference</a>
|
||||
<img id="carat" src="../../img/carat.png" />
|
||||
Constants Structure Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="../../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptcha.html">ReCaptcha</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptcha/Constants.html">– Constants</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptcha/Endpoint.html">– Endpoint</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptcha/Config.html">– Config</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptchaDecoder.html">ReCaptchaDecoder</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptchaDecoder/Result.html">– Result</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptchaWebViewManager.html">ReCaptchaWebViewManager</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptchaWebViewManager/WebViewDelegate.html">– WebViewDelegate</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptchaWebViewManager/Constants.html">– Constants</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../../Enums.html">Enumerations</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Enums/ReCaptchaError.html">ReCaptchaError</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../../Extensions.html">Extensions</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Extensions/DispatchQueue.html">DispatchQueue</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Extensions/Reactive.html">Reactive</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Extensions/String.html">String</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>Constants</h1>
|
||||
<p>Undocumented</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptchaAAC9Constants33_D88FD3D3A2EDF5CB44B90FDF7C150474LLV12InfoDictKeysV"></a>
|
||||
<a name="//apple_ref/swift/Struct/InfoDictKeys" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptchaAAC9Constants33_D88FD3D3A2EDF5CB44B90FDF7C150474LLV12InfoDictKeysV">InfoDictKeys</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Undocumented</p>
|
||||
|
||||
<a href="../../Classes/ReCaptcha/Constants/InfoDictKeys.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/fjcaetano/ReCaptcha" target="_blank" rel="external">Flávio Caetano</a>. All rights reserved. (Last updated: 2018-03-06)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
|
|
@ -1,146 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>InfoDictKeys Structure Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../../css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="../../../js/jquery.min.js" defer></script>
|
||||
<script src="../../../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a name="//apple_ref/swift/Struct/InfoDictKeys" class="dashAnchor"></a>
|
||||
<a title="InfoDictKeys Structure Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../../../index.html">ReCaptcha Docs</a> (87% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../../../index.html">ReCaptcha Reference</a>
|
||||
<img id="carat" src="../../../img/carat.png" />
|
||||
InfoDictKeys Structure Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="../../../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../../../Classes/ReCaptcha.html">ReCaptcha</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../../Classes/ReCaptcha/Constants.html">– Constants</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../../Classes/ReCaptcha/Endpoint.html">– Endpoint</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../../Classes/ReCaptcha/Config.html">– Config</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../../Classes/ReCaptchaDecoder.html">ReCaptchaDecoder</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../../Classes/ReCaptchaDecoder/Result.html">– Result</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../../Classes/ReCaptchaWebViewManager.html">ReCaptchaWebViewManager</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../../Classes/ReCaptchaWebViewManager/WebViewDelegate.html">– WebViewDelegate</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../../Classes/ReCaptchaWebViewManager/Constants.html">– Constants</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../../../Enums.html">Enumerations</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../../../Enums/ReCaptchaError.html">ReCaptchaError</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../../../Extensions.html">Extensions</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../../../Extensions/DispatchQueue.html">DispatchQueue</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../../Extensions/Reactive.html">Reactive</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../../Extensions/String.html">String</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>InfoDictKeys</h1>
|
||||
<p>Undocumented</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptchaAAC9Constants33_D88FD3D3A2EDF5CB44B90FDF7C150474LLV12InfoDictKeysV6APIKeySSvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/APIKey" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptchaAAC9Constants33_D88FD3D3A2EDF5CB44B90FDF7C150474LLV12InfoDictKeysV6APIKeySSvZ">APIKey</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Undocumented</p>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptchaAAC9Constants33_D88FD3D3A2EDF5CB44B90FDF7C150474LLV12InfoDictKeysV6DomainSSvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/Domain" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptchaAAC9Constants33_D88FD3D3A2EDF5CB44B90FDF7C150474LLV12InfoDictKeysV6DomainSSvZ">Domain</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Undocumented</p>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/fjcaetano/ReCaptcha" target="_blank" rel="external">Flávio Caetano</a>. All rights reserved. (Last updated: 2018-03-06)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
|
|
@ -1,150 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Endpoint Enumeration Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="../../js/jquery.min.js" defer></script>
|
||||
<script src="../../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a name="//apple_ref/swift/Enum/Endpoint" class="dashAnchor"></a>
|
||||
<a title="Endpoint Enumeration Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../../index.html">ReCaptcha Docs</a> (100% documented)</p>
|
||||
<p class="header-right"><a href="https://github.com/fjcaetano/ReCaptcha"><img src="../../img/gh.png"/>View on GitHub</a></p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../../index.html">ReCaptcha Reference</a>
|
||||
<img id="carat" src="../../img/carat.png" />
|
||||
Endpoint Enumeration Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="../../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptcha.html">ReCaptcha</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptcha/Endpoint.html">– Endpoint</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../../Enums.html">Enumerations</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Enums/ReCaptchaError.html">ReCaptchaError</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Enums/ReCaptchaResult.html">ReCaptchaResult</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../../Extensions.html">Extensions</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Extensions/Reactive.html">Reactive</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>Endpoint</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">Endpoint</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p>The JS API endpoint to be loaded onto the HTML file.</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptchaAAC8EndpointO7defaultyA2DmF"></a>
|
||||
<a name="//apple_ref/swift/Element/default" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptchaAAC8EndpointO7defaultyA2DmF">default</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Google’s default endpoint. Points to
|
||||
<a href="https://www.google.com/recaptcha/api.js">https://www.google.com/recaptcha/api.js</a></p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="err">`</span><span class="k">default</span><span class="err">`</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptchaAAC8EndpointO9alternateyA2DmF"></a>
|
||||
<a name="//apple_ref/swift/Element/alternate" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptchaAAC8EndpointO9alternateyA2DmF">alternate</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Alternate endpoint. Points to <a href="https://www.recaptcha.net/recaptcha/api.js">https://www.recaptcha.net/recaptcha/api.js</a></p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="n">alternate</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/fjcaetano" target="_blank" rel="external">Flávio Caetano (@fjcaetano)</a>. All rights reserved. (Last updated: 2018-09-28)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
|
|
@ -1,292 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>ReCaptchaDecoder Class Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="../js/jquery.min.js" defer></script>
|
||||
<script src="../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a name="//apple_ref/swift/Class/ReCaptchaDecoder" class="dashAnchor"></a>
|
||||
<a title="ReCaptchaDecoder Class Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../index.html">ReCaptcha Docs</a> (87% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../index.html">ReCaptcha Reference</a>
|
||||
<img id="carat" src="../img/carat.png" />
|
||||
ReCaptchaDecoder Class Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ReCaptcha.html">ReCaptcha</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ReCaptcha/Constants.html">– Constants</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ReCaptcha/Endpoint.html">– Endpoint</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ReCaptcha/Config.html">– Config</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ReCaptchaDecoder.html">ReCaptchaDecoder</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ReCaptchaDecoder/Result.html">– Result</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ReCaptchaWebViewManager.html">ReCaptchaWebViewManager</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ReCaptchaWebViewManager/WebViewDelegate.html">– WebViewDelegate</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ReCaptchaWebViewManager/Constants.html">– Constants</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../Enums.html">Enumerations</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Enums/ReCaptchaError.html">ReCaptchaError</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../Extensions.html">Extensions</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Extensions/DispatchQueue.html">DispatchQueue</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Extensions/Reactive.html">Reactive</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Extensions/String.html">String</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>ReCaptchaDecoder</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">internal</span> <span class="kd">class</span> <span class="kt">ReCaptchaDecoder</span><span class="p">:</span> <span class="kt">NSObject</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p>The Decoder of javascript messages from the webview</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB7DecoderC6ResultO"></a>
|
||||
<a name="//apple_ref/swift/Enum/Result" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB7DecoderC6ResultO">Result</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The decoder result.</p>
|
||||
|
||||
<a href="../Classes/ReCaptchaDecoder/Result.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">enum</span> <span class="kt">Result</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB7DecoderC11sendMessage33_BFC5AA2DAB5901AE176B9DCF91FD1820LLyAC6ResultOcv"></a>
|
||||
<a name="//apple_ref/swift/Property/sendMessage" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB7DecoderC11sendMessage33_BFC5AA2DAB5901AE176B9DCF91FD1820LLyAC6ResultOcv">sendMessage</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The closure that receives messages</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="n">fileprivate</span> <span class="k">let</span> <span class="nv">sendMessage</span><span class="p">:</span> <span class="p">((</span><span class="kt"><a href="../Classes/ReCaptchaDecoder/Result.html">Result</a></span><span class="p">)</span> <span class="o">-></span> <span class="kt">Void</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB7DecoderCACyAC6ResultOc17didReceiveMessage_tcfc"></a>
|
||||
<a name="//apple_ref/swift/Method/init(didReceiveMessage:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB7DecoderCACyAC6ResultOc17didReceiveMessage_tcfc">init(didReceiveMessage:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Initializes a decoder with a completion closure.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="nf">init</span><span class="p">(</span><span class="nv">didReceiveMessage</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">(</span><span class="kt"><a href="../Classes/ReCaptchaDecoder/Result.html">Result</a></span><span class="p">)</span> <span class="o">-></span> <span class="kt">Void</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>didReceiveMessage</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>A closure that receives a ReCaptchaDecoder.Result</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB7DecoderC4sendyAA0aB5ErrorO5error_tF"></a>
|
||||
<a name="//apple_ref/swift/Method/send(error:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB7DecoderC4sendyAA0aB5ErrorO5error_tF">send(error:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Sends an error to the completion closure</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">func</span> <span class="nf">send</span><span class="p">(</span><span class="nv">error</span><span class="p">:</span> <span class="kt"><a href="../Enums/ReCaptchaError.html">ReCaptchaError</a></span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>error</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The error to be sent.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/c:@CM@ReCaptcha@objc(cs)ReCaptchaDecoder(im)userContentController:didReceiveScriptMessage:"></a>
|
||||
<a name="//apple_ref/swift/Method/userContentController(_:didReceive:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/c:@CM@ReCaptcha@objc(cs)ReCaptchaDecoder(im)userContentController:didReceiveScriptMessage:">userContentController(_:didReceive:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Undocumented</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">internal</span> <span class="kd">class</span> <span class="kt">ReCaptchaDecoder</span><span class="p">:</span> <span class="kt">NSObject</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/fjcaetano/ReCaptcha" target="_blank" rel="external">Flávio Caetano</a>. All rights reserved. (Last updated: 2018-03-06)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
|
|
@ -1,319 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Result Enumeration Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="../../js/jquery.min.js" defer></script>
|
||||
<script src="../../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a name="//apple_ref/swift/Enum/Result" class="dashAnchor"></a>
|
||||
<a title="Result Enumeration Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../../index.html">ReCaptcha Docs</a> (87% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../../index.html">ReCaptcha Reference</a>
|
||||
<img id="carat" src="../../img/carat.png" />
|
||||
Result Enumeration Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="../../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptcha.html">ReCaptcha</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptcha/Constants.html">– Constants</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptcha/Endpoint.html">– Endpoint</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptcha/Config.html">– Config</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptchaDecoder.html">ReCaptchaDecoder</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptchaDecoder/Result.html">– Result</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptchaWebViewManager.html">ReCaptchaWebViewManager</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptchaWebViewManager/WebViewDelegate.html">– WebViewDelegate</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptchaWebViewManager/Constants.html">– Constants</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../../Enums.html">Enumerations</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Enums/ReCaptchaError.html">ReCaptchaError</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../../Extensions.html">Extensions</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Extensions/DispatchQueue.html">DispatchQueue</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Extensions/Reactive.html">Reactive</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Extensions/String.html">String</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>Result</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="kd">enum</span> <span class="kt">Result</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p>The decoder result.</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB7DecoderC6ResultO5tokenAESScAEmF"></a>
|
||||
<a name="//apple_ref/swift/Element/token" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB7DecoderC6ResultO5tokenAESScAEmF">token</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>A result token, if any</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="nf">token</span><span class="p">(</span><span class="kt">String</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB7DecoderC6ResultO04showaB0A2EmF"></a>
|
||||
<a name="//apple_ref/swift/Element/showReCaptcha" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB7DecoderC6ResultO04showaB0A2EmF">showReCaptcha</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Indicates that the webview containing the challenge should be displayed.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="n">showReCaptcha</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB7DecoderC6ResultO5errorAeA0aB5ErrorOcAEmF"></a>
|
||||
<a name="//apple_ref/swift/Element/error" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB7DecoderC6ResultO5errorAeA0aB5ErrorOcAEmF">error</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Any errors</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="nf">error</span><span class="p">(</span><span class="kt"><a href="../../Enums/ReCaptchaError.html">ReCaptchaError</a></span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB7DecoderC6ResultO7didLoadA2EmF"></a>
|
||||
<a name="//apple_ref/swift/Element/didLoad" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB7DecoderC6ResultO7didLoadA2EmF">didLoad</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Did finish loading resources</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="n">didLoad</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB7DecoderC6ResultO3logAESScAEmF"></a>
|
||||
<a name="//apple_ref/swift/Element/log" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB7DecoderC6ResultO3logAESScAEmF">log</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Logs a string onto the console</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="k">case</span> <span class="nf">log</span><span class="p">(</span><span class="kt">String</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB7DecoderC6ResultO4from33_BFC5AA2DAB5901AE176B9DCF91FD1820LLAEs10DictionaryVySSypG8response_tFZ"></a>
|
||||
<a name="//apple_ref/swift/Method/from(response:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB7DecoderC6ResultO4from33_BFC5AA2DAB5901AE176B9DCF91FD1820LLAEs10DictionaryVySSypG8response_tFZ">from(response:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Parses a dict received from the webview onto a <code>ReCaptchaDecoder.Result</code></p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">static</span> <span class="kd">func</span> <span class="nf">from</span><span class="p">(</span><span class="nv">response</span><span class="p">:</span> <span class="p">[</span><span class="kt">String</span><span class="p">:</span> <span class="kt">Any</span><span class="p">])</span> <span class="o">-></span> <span class="kt"><a href="../../Classes/ReCaptchaDecoder.html">ReCaptchaDecoder</a></span><span class="o">.</span><span class="kt">Result</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>response</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>A dictionary containing the message to be parsed</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Return Value</h4>
|
||||
<p>A decoded ReCaptchaDecoder.Result</p>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/fjcaetano/ReCaptcha" target="_blank" rel="external">Flávio Caetano</a>. All rights reserved. (Last updated: 2018-03-06)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
|
|
@ -1,268 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>ReCaptchaWebViewManager Class Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="../js/jquery.min.js" defer></script>
|
||||
<script src="../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a name="//apple_ref/swift/Class/ReCaptchaWebViewManager" class="dashAnchor"></a>
|
||||
<a title="ReCaptchaWebViewManager Class Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../index.html">ReCaptcha Docs</a> (100% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../index.html">ReCaptcha Reference</a>
|
||||
<img id="carat" src="../img/carat.png" />
|
||||
ReCaptchaWebViewManager Class Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ReCaptcha.html">ReCaptcha</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ReCaptcha/Endpoint.html">– Endpoint</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Classes/ReCaptchaWebViewManager.html">ReCaptchaWebViewManager</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../Enums.html">Enumerations</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Enums/ReCaptchaError.html">ReCaptchaError</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../Enums/ReCaptchaResult.html">ReCaptchaResult</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../Extensions.html">Extensions</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../Extensions/Reactive.html">Reactive</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>ReCaptchaWebViewManager</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="n">open</span> <span class="kd">class</span> <span class="kt">ReCaptchaWebViewManager</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p>Handles comunications with the webview containing the ReCaptcha challenge.</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB14WebViewManagerC8validateySo6UIViewC2on_Sb12resetOnErroryAA0aB6ResultOc10completiontF"></a>
|
||||
<a name="//apple_ref/swift/Method/validate(on:resetOnError:completion:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB14WebViewManagerC8validateySo6UIViewC2on_Sb12resetOnErroryAA0aB6ResultOc10completiontF">validate(on:resetOnError:completion:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Starts the challenge validation</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="n">open</span> <span class="kd">func</span> <span class="nf">validate</span><span class="p">(</span><span class="n">on</span> <span class="nv">view</span><span class="p">:</span> <span class="kt">UIView</span><span class="p">,</span> <span class="nv">resetOnError</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">true</span><span class="p">,</span> <span class="nv">completion</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">(</span><span class="kt"><a href="../Enums/ReCaptchaResult.html">ReCaptchaResult</a></span><span class="p">)</span> <span class="o">-></span> <span class="kt">Void</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>view</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The view that should present the webview.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>resetOnError</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>If ReCaptcha should be reset if it errors. Defaults to <code>true</code>.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>completion</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>A closure that receives a ReCaptchaResult which may contain a valid result token.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB14WebViewManagerC4stopyyF"></a>
|
||||
<a name="//apple_ref/swift/Method/stop()" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB14WebViewManagerC4stopyyF">stop()</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Stops the execution of the webview</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="n">open</span> <span class="kd">func</span> <span class="nf">stop</span><span class="p">()</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB14WebViewManagerC09configurecD0yySo05WKWebD0CcF"></a>
|
||||
<a name="//apple_ref/swift/Method/configureWebView(_:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB14WebViewManagerC09configurecD0yySo05WKWebD0CcF">configureWebView(_:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Provides a closure to configure the webview for presentation if necessary.</p>
|
||||
|
||||
<p>If presentation is required, the webview will already be a subview of <code>presenterView</code> if one is provided. Otherwise
|
||||
it might need to be added in a view currently visible.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="n">open</span> <span class="kd">func</span> <span class="nf">configureWebView</span><span class="p">(</span><span class="n">_</span> <span class="nv">configure</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">(</span><span class="kt">WKWebView</span><span class="p">)</span> <span class="o">-></span> <span class="kt">Void</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>configure</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>A closure that receives an instance of <code>WKWebView</code> for configuration.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB14WebViewManagerC5resetyyF"></a>
|
||||
<a name="//apple_ref/swift/Method/reset()" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB14WebViewManagerC5resetyyF">reset()</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Resets the ReCaptcha.</p>
|
||||
|
||||
<p>The reset is achieved by calling <code>grecaptcha.reset()</code> on the JS API.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="n">open</span> <span class="kd">func</span> <span class="nf">reset</span><span class="p">()</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/fjcaetano/ReCaptcha" target="_blank" rel="external">Flávio Caetano</a>. All rights reserved. (Last updated: 2018-03-06)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
|
|
@ -1,146 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Constants Structure Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="../../js/jquery.min.js" defer></script>
|
||||
<script src="../../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a name="//apple_ref/swift/Struct/Constants" class="dashAnchor"></a>
|
||||
<a title="Constants Structure Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../../index.html">ReCaptcha Docs</a> (87% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../../index.html">ReCaptcha Reference</a>
|
||||
<img id="carat" src="../../img/carat.png" />
|
||||
Constants Structure Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="../../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptcha.html">ReCaptcha</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptcha/Constants.html">– Constants</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptcha/Endpoint.html">– Endpoint</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptcha/Config.html">– Config</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptchaDecoder.html">ReCaptchaDecoder</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptchaDecoder/Result.html">– Result</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptchaWebViewManager.html">ReCaptchaWebViewManager</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptchaWebViewManager/WebViewDelegate.html">– WebViewDelegate</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptchaWebViewManager/Constants.html">– Constants</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../../Enums.html">Enumerations</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Enums/ReCaptchaError.html">ReCaptchaError</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../../Extensions.html">Extensions</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Extensions/DispatchQueue.html">DispatchQueue</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Extensions/Reactive.html">Reactive</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Extensions/String.html">String</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>Constants</h1>
|
||||
<p>Undocumented</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB14WebViewManagerC9Constants33_C3529EC2362FD51A816C2A521FEB1AA9LLV16ExecuteJSCommandSSvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/ExecuteJSCommand" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB14WebViewManagerC9Constants33_C3529EC2362FD51A816C2A521FEB1AA9LLV16ExecuteJSCommandSSvZ">ExecuteJSCommand</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Undocumented</p>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB14WebViewManagerC9Constants33_C3529EC2362FD51A816C2A521FEB1AA9LLV12ResetCommandSSvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/ResetCommand" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB14WebViewManagerC9Constants33_C3529EC2362FD51A816C2A521FEB1AA9LLV12ResetCommandSSvZ">ResetCommand</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Undocumented</p>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/fjcaetano/ReCaptcha" target="_blank" rel="external">Flávio Caetano</a>. All rights reserved. (Last updated: 2018-03-06)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
|
|
@ -1,417 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>WebViewDelegate Class Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="../../js/jquery.min.js" defer></script>
|
||||
<script src="../../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a name="//apple_ref/swift/Class/WebViewDelegate" class="dashAnchor"></a>
|
||||
<a title="WebViewDelegate Class Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../../index.html">ReCaptcha Docs</a> (87% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../../index.html">ReCaptcha Reference</a>
|
||||
<img id="carat" src="../../img/carat.png" />
|
||||
WebViewDelegate Class Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="../../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptcha.html">ReCaptcha</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptcha/Constants.html">– Constants</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptcha/Endpoint.html">– Endpoint</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptcha/Config.html">– Config</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptchaDecoder.html">ReCaptchaDecoder</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptchaDecoder/Result.html">– Result</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptchaWebViewManager.html">ReCaptchaWebViewManager</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptchaWebViewManager/WebViewDelegate.html">– WebViewDelegate</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Classes/ReCaptchaWebViewManager/Constants.html">– Constants</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../../Enums.html">Enumerations</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Enums/ReCaptchaError.html">ReCaptchaError</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../../Extensions.html">Extensions</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Extensions/DispatchQueue.html">DispatchQueue</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Extensions/Reactive.html">Reactive</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../Extensions/String.html">String</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>WebViewDelegate</h1>
|
||||
<div class="declaration">
|
||||
<div class="language">
|
||||
<pre class="highlight"><code><span class="n">fileprivate</span> <span class="kd">class</span> <span class="kt">WebViewDelegate</span><span class="p">:</span> <span class="kt">NSObject</span><span class="p">,</span> <span class="kt">WKNavigationDelegate</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p>The <code><a href="../../Classes/ReCaptchaWebViewManager.html#/s:9ReCaptcha0aB14WebViewManagerC03webD033_C3529EC2362FD51A816C2A521FEB1AA9LLSo05WKWebD0Cv">webView</a></code> delegate object that performs execution uppon script loading</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB14WebViewManagerC0cD8Delegate33_C3529EC2362FD51A816C2A521FEB1AA9LLC9ConstantsV"></a>
|
||||
<a name="//apple_ref/swift/Struct/Constants" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB14WebViewManagerC0cD8Delegate33_C3529EC2362FD51A816C2A521FEB1AA9LLC9ConstantsV">Constants</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Undocumented</p>
|
||||
|
||||
<a href="../../Classes/ReCaptchaWebViewManager/WebViewDelegate/Constants.html" class="slightly-smaller">See more</a>
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="n">fileprivate</span> <span class="kd">class</span> <span class="kt">WebViewDelegate</span><span class="p">:</span> <span class="kt">NSObject</span><span class="p">,</span> <span class="kt">WKNavigationDelegate</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB14WebViewManagerC0cD8Delegate33_C3529EC2362FD51A816C2A521FEB1AA9LLC7managerACSgXwv"></a>
|
||||
<a name="//apple_ref/swift/Property/manager" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB14WebViewManagerC0cD8Delegate33_C3529EC2362FD51A816C2A521FEB1AA9LLC7managerACSgXwv">manager</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The parent manager</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">private</span> <span class="k">weak</span> <span class="k">var</span> <span class="nv">manager</span><span class="p">:</span> <span class="kt"><a href="../../Classes/ReCaptchaWebViewManager.html">ReCaptchaWebViewManager</a></span><span class="p">?</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB14WebViewManagerC0cD8Delegate33_C3529EC2362FD51A816C2A521FEB1AA9LLC14activeRequestss3SetVySSGv"></a>
|
||||
<a name="//apple_ref/swift/Property/activeRequests" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB14WebViewManagerC0cD8Delegate33_C3529EC2362FD51A816C2A521FEB1AA9LLC14activeRequestss3SetVySSGv">activeRequests</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The active requests’ urls</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">private</span> <span class="k">var</span> <span class="nv">activeRequests</span> <span class="o">=</span> <span class="kt">Set</span><span class="o"><</span><span class="kt">String</span><span class="o">></span><span class="p">(</span><span class="nv">minimumCapacity</span><span class="p">:</span> <span class="mi">0</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB14WebViewManagerC0cD8Delegate33_C3529EC2362FD51A816C2A521FEB1AA9LLCAfC7manager_tcfc"></a>
|
||||
<a name="//apple_ref/swift/Method/init(manager:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB14WebViewManagerC0cD8Delegate33_C3529EC2362FD51A816C2A521FEB1AA9LLCAfC7manager_tcfc">init(manager:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="nf">init</span><span class="p">(</span><span class="nv">manager</span><span class="p">:</span> <span class="kt"><a href="../../Classes/ReCaptchaWebViewManager.html">ReCaptchaWebViewManager</a></span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>manager</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The parent manager</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB14WebViewManagerC0cD8Delegate33_C3529EC2362FD51A816C2A521FEB1AA9LLC03webD0ySo05WKWebD0C_So18WKNavigationActionC15decidePolicyForySC0qrT0Oc15decisionHandlertF"></a>
|
||||
<a name="//apple_ref/swift/Method/webView(_:decidePolicyFor:decisionHandler:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB14WebViewManagerC0cD8Delegate33_C3529EC2362FD51A816C2A521FEB1AA9LLC03webD0ySo05WKWebD0C_So18WKNavigationActionC15decidePolicyForySC0qrT0Oc15decisionHandlertF">webView(_:decidePolicyFor:decisionHandler:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Decides whether to allow or cancel a navigation.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">func</span> <span class="nf">webView</span><span class="p">(</span>
|
||||
<span class="n">_</span> <span class="nv">webView</span><span class="p">:</span> <span class="kt">WKWebView</span><span class="p">,</span>
|
||||
<span class="n">decidePolicyFor</span> <span class="nv">navigationAction</span><span class="p">:</span> <span class="kt">WKNavigationAction</span><span class="p">,</span>
|
||||
<span class="nv">decisionHandler</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">(</span><span class="kt">WKNavigationActionPolicy</span>
|
||||
<span class="p">)</span> <span class="o">-></span> <span class="kt">Void</span><span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>webView</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The web view invoking the delegate method.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>navigationAction</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>Descriptive information about the action triggering the navigation request.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>decisionHandler</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The decision handler to call to allow or cancel the navigation. The argument is one of
|
||||
the constants of the enumerated type WKNavigationActionPolicy.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB14WebViewManagerC0cD8Delegate33_C3529EC2362FD51A816C2A521FEB1AA9LLC03webD0ySo05WKWebD0C_So20WKNavigationResponseC15decidePolicyForySC0qrT0Oc15decisionHandlertF"></a>
|
||||
<a name="//apple_ref/swift/Method/webView(_:decidePolicyFor:decisionHandler:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB14WebViewManagerC0cD8Delegate33_C3529EC2362FD51A816C2A521FEB1AA9LLC03webD0ySo05WKWebD0C_So20WKNavigationResponseC15decidePolicyForySC0qrT0Oc15decisionHandlertF">webView(_:decidePolicyFor:decisionHandler:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Decides whether to allow or cancel a navigation after its response is known.</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">func</span> <span class="nf">webView</span><span class="p">(</span>
|
||||
<span class="n">_</span> <span class="nv">webView</span><span class="p">:</span> <span class="kt">WKWebView</span><span class="p">,</span>
|
||||
<span class="n">decidePolicyFor</span> <span class="nv">navigationResponse</span><span class="p">:</span> <span class="kt">WKNavigationResponse</span><span class="p">,</span>
|
||||
<span class="nv">decisionHandler</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">(</span><span class="kt">WKNavigationResponsePolicy</span><span class="p">)</span> <span class="o">-></span> <span class="kt">Void</span>
|
||||
<span class="p">)</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Parameters</h4>
|
||||
<table class="graybox">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>webView</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>The web view invoking the delegate method.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>navigationResponse</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>Descriptive information about the navigation response.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>
|
||||
<em>decisionHandler</em>
|
||||
</code>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>A block to be called when your app has decided whether to allow or cancel the navigation</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB14WebViewManagerC0cD8Delegate33_C3529EC2362FD51A816C2A521FEB1AA9LLC7executeyyF"></a>
|
||||
<a name="//apple_ref/swift/Method/execute()" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB14WebViewManagerC0cD8Delegate33_C3529EC2362FD51A816C2A521FEB1AA9LLC7executeyyF">execute()</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>Flag the requests as finished and call ReCaptcha execution if necessary</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">func</span> <span class="nf">execute</span><span class="p">()</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/fjcaetano/ReCaptcha" target="_blank" rel="external">Flávio Caetano</a>. All rights reserved. (Last updated: 2018-03-06)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
|
|
@ -1,135 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Constants Structure Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../../css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../../css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
<script src="../../../js/jquery.min.js" defer></script>
|
||||
<script src="../../../js/jazzy.js" defer></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a name="//apple_ref/swift/Struct/Constants" class="dashAnchor"></a>
|
||||
<a title="Constants Structure Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../../../index.html">ReCaptcha Docs</a> (87% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../../../index.html">ReCaptcha Reference</a>
|
||||
<img id="carat" src="../../../img/carat.png" />
|
||||
Constants Structure Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<nav class="sidebar">
|
||||
<ul class="nav-groups">
|
||||
<li class="nav-group-name">
|
||||
<a href="../../../Classes.html">Classes</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../../../Classes/ReCaptcha.html">ReCaptcha</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../../Classes/ReCaptcha/Constants.html">– Constants</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../../Classes/ReCaptcha/Endpoint.html">– Endpoint</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../../Classes/ReCaptcha/Config.html">– Config</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../../Classes/ReCaptchaDecoder.html">ReCaptchaDecoder</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../../Classes/ReCaptchaDecoder/Result.html">– Result</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../../Classes/ReCaptchaWebViewManager.html">ReCaptchaWebViewManager</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../../Classes/ReCaptchaWebViewManager/WebViewDelegate.html">– WebViewDelegate</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../../Classes/ReCaptchaWebViewManager/Constants.html">– Constants</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../../../Enums.html">Enumerations</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../../../Enums/ReCaptchaError.html">ReCaptchaError</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-group-name">
|
||||
<a href="../../../Extensions.html">Extensions</a>
|
||||
<ul class="nav-group-tasks">
|
||||
<li class="nav-group-task">
|
||||
<a href="../../../Extensions/DispatchQueue.html">DispatchQueue</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../../Extensions/Reactive.html">Reactive</a>
|
||||
</li>
|
||||
<li class="nav-group-task">
|
||||
<a href="../../../Extensions/String.html">String</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article class="main-content">
|
||||
<section>
|
||||
<section class="section">
|
||||
<h1>Constants</h1>
|
||||
<p>Undocumented</p>
|
||||
|
||||
</section>
|
||||
<section class="section task-group-section">
|
||||
<div class="task-group">
|
||||
<ul>
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:9ReCaptcha0aB14WebViewManagerC0cD8Delegate33_C3529EC2362FD51A816C2A521FEB1AA9LLC9ConstantsV10apiURLHostSSvZ"></a>
|
||||
<a name="//apple_ref/swift/Variable/apiURLHost" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:9ReCaptcha0aB14WebViewManagerC0cD8Delegate33_C3529EC2362FD51A816C2A521FEB1AA9LLC9ConstantsV10apiURLHostSSvZ">apiURLHost</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
<div class="pointer-container"></div>
|
||||
<section class="section">
|
||||
<div class="pointer"></div>
|
||||
<div class="abstract">
|
||||
<p>The host that loaded requests should have</p>
|
||||
|
||||
</div>
|
||||
<div class="declaration">
|
||||
<h4>Declaration</h4>
|
||||
<div class="language">
|
||||
<p class="aside-title">Swift</p>
|
||||
<pre class="highlight"><code><span class="kd">static</span> <span class="k">let</span> <span class="nv">apiURLHost</span> <span class="o">=</span> <span class="s">"www.google.com"</span></code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2018 <a class="link" href="https://github.com/fjcaetano/ReCaptcha" target="_blank" rel="external">Flávio Caetano</a>. All rights reserved. (Last updated: 2018-03-06)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</html>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue