Skip to content

FriendlyCaptcha/friendly-captcha-ios

Repository files navigation

Friendly Captcha iOS SDK

Cocoapods Version Cocoapods Platforms Carthage compatible

The Friendly Captcha iOS SDK allows you to easily integrate Friendly Captcha into your iOS applications.

This SDK is for Friendly Captcha v2.

Installation

This SDK is available via CocoaPods and Carthage. You can find the latest version number on the Releases page.

CocoaPods

Add the following line to your Podfile:

pod 'FriendlyCaptcha', '~> 1.0.0'

Carthage

Add the following line to your Cartfile:

github "FriendlyCaptcha/friendly-captcha-ios" ~> 1.0.0

Documentation

The full API reference for the SDK is available here.

Supported Platforms

This SDK has been successfully built and run targeting iOS 10. On CocoaPods, it has been successfully packaged with a minimum target of iOS 9. Theoretically, it should be fully functional as far back as iOS 8, but due to tooling constraints, support for versions earlier than iOS is offered on a "best effort" basis.

If you have trouble with the above installation methods, it should be possible to simply copy the Swift files in FriendlyCaptcha/Classes into your (>= iOS 8) project.

Usage

This repository contains 3 minimal example apps to show how to integrate Friendly Captcha. For more information, including about how to run them locally, see the README in the Example folder.

Testing

Tests for the SDK are located in the Example directory. This appears to be an artifact of how CocoaPods structures a library.

If running the tests in Xcode, make sure that the Example_UIKit scheme is selected. You can also run the tests from the command line:

xcodebuild \
  -workspace Example/FriendlyCaptcha.xcworkspace \
  -scheme Example_UIKit \
  test \
    -sdk iphonesimulator \
    -destination 'platform=iOS Simulator,name=iPhone 16,OS=18.0'

Depending on which simulators you have installed, you may need to change the version numbers in the -destination argument. You can pipe the output into xcbeautify, if it's available.

Screenshots

An example disabled login page with Friendly Captcha An example enabled login page with Friendly Captcha

License

This is free software; you can redistribute it and/or modify it under the terms of the Mozilla Public License Version 2.0.

All examples are released under the MIT license.