CaptchaFox for iOS
You can protect your native iOS apps (UIKit and SwiftUI) using the official iOS library . It requires iOS 15 or later and Xcode 16 or later.
Setup
- In the CaptchaFox portal, create a new site configuration using the iOS integration
- In Xcode, choose File > Add Package Dependencies…, enter
https://github.com/CaptchaFox/captchafox-iosand add theCaptchaFoxlibrary to your app target - Follow the usage instructions in the readme
- Enter the sitekey and domain from your site configuration
- Show the Captcha on your application screen and verify the resolved token in your backend
Example
import CaptchaFox
import SwiftUI
struct SignUpView: View {
@State private var showsCaptcha = false
private let configuration = CaptchaFoxConfiguration(
siteKey: "YOUR_SITEKEY",
baseURL: URL(string: "https://YOUR_DOMAIN")!
)
var body: some View {
Button("Sign up") { showsCaptcha = true }
.captchaFoxModal(isPresented: $showsCaptcha, configuration: configuration, onVerify: { token in
// Send the token to your backend.
})
}
}Last updated on