To run the example project, clone the repo, and run pod install
from the Example directory first.
captcha-harvester-ios is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'captcha-harvester-ios'
To begin, import captcha_harvester_ios and WebKit and create a WebKit View inside your view controller file. In your code where you would like to display the captcha harvester (Leave in view did load function if you are testing) place the following code:
self.webView.displayCaptcha(sitekey: "YourSitekey", baseUrl: "Base URL For the Captcha", googleLogin: false)
This will display captcha and keep on harvesting. If googleLogin is set to true, the user will be prompted to login to google before solving. The WebKit View stores cookies, so when you login once, it will remain auto logged in even if the app is terminated.
Once solve, the tokens are stored in an array within a struct and can be accessed as followed:
Tokens.tokens
the tokens array can be modified to your needs from anywhere in your code.
If you have any questions, feel free to email me ([email protected]).
captcha-harvester-ios is available under the MIT license. See the LICENSE file for more info.
David Krajewski, [email protected]
Thanks to Peter Soboyejo (@pxtvr) for allowing me to use a snippet of his code while creating this project!