Sensitive Screens¶
Part of the Human Scoring use case.
Pause capture while sensitive input is on screen, such as a password, a card number or a one-time code. While paused, the SDK records nothing. The session continues, and capture picks up where it left off when you resume.
The iOS SDK never reads what is typed. It records keystrokes only when your app reports them with
captureKey, and then only their class, never the character. Pausing
keeps out the touches themselves — where and how the user tapped on a PIN pad or a card form — and
any keystrokes your app reports while paused.
When to use it¶
- A login or PIN screen is open
- A payment form is open
- Any screen your privacy policy says is not recorded
Prerequisites¶
- The SDK is installed and started. See the Quick Start.
Usage¶
Pause and resume¶
- Always pair
pause()withresume(). Time spent paused adds no actions, so a session left paused never becomes sufficient and its classification stays.insufficient. resume()does not override consent: if the user has not agreed, nothing is recorded after resuming either.
Note:
pause()andresume()do not nest. Oneresume()restarts capture however many timespause()was called, so two parts of your app that pause on their own interfere: the first one to resume restarts capture while the other still shows sensitive content. Give pausing one owner, or count the pauses yourself and callresume()only when the count is back to zero.
Examples¶
Pause for as long as a screen is shown (SwiftUI)¶
import DeaSDK
import SwiftUI
struct PaymentView: View {
@State private var cardNumber = ""
@State private var cvc = ""
var body: some View {
Form {
TextField("Card number", text: $cardNumber)
SecureField("CVC", text: $cvc)
}
.navigationTitle("Payment")
.onAppear { Dea.sdk?.pause() }
.onDisappear { Dea.sdk?.resume() }
}
}
Pause for as long as a screen is shown (UIKit)¶
import DeaSDK
import UIKit
class PaymentViewController: UIViewController {
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
Dea.sdk?.pause()
}
override func viewDidDisappear(_ animated: Bool) {
super.viewDidDisappear(animated)
Dea.sdk?.resume()
}
}
Pause while a password field has focus (SwiftUI, iOS 15+)¶
import DeaSDK
import SwiftUI
struct PasswordField: View {
@State private var password = ""
@FocusState private var focused: Bool
var body: some View {
SecureField("Password", text: $password)
.focused($focused)
.onChange(of: focused) { isFocused in
if isFocused {
Dea.sdk?.pause()
} else {
Dea.sdk?.resume()
}
}
.onDisappear {
if focused { Dea.sdk?.resume() }
}
}
}
Pause while a password field has focus (UIKit)¶
import DeaSDK
import UIKit
class LoginViewController: UIViewController, UITextFieldDelegate {
private let passwordField = UITextField()
override func viewDidLoad() {
super.viewDidLoad()
passwordField.isSecureTextEntry = true
passwordField.delegate = self
view.addSubview(passwordField)
}
func textFieldDidBeginEditing(_ textField: UITextField) {
if textField === passwordField { Dea.sdk?.pause() }
}
func textFieldDidEndEditing(_ textField: UITextField) {
if textField === passwordField { Dea.sdk?.resume() }
}
}
API¶
| Member | Returns | Description |
|---|---|---|
pause() |
Void |
Stops recording. The session is kept |
resume() |
Void |
Starts recording again |