Skip to content

Security Scanning

Alphyn SDK performs continuous security scanning of your application and its runtime environment. The scan results provide insights into the security posture of your app.

Scan Trigger Methods:

import Alphyn
// Get latest scan result
let scanResultString = try? AlphynSDK.getScanResult()
// Scan results are also delivered via callbacks
// (Example within AlphynSecurityListener's onSuccess method)
func onSuccess(_ result: AlphynCallbackResult) {
if result.isScanResponse {
let scanResult = result.getScanResult()
processScanResult(scanResult)
}
}
ResultDescriptionRecommended Action
trustedApp passed all security checksContinue normal operation
flaggedPotential security concerns detectedMonitor and investigate
untrustedApp failed critical security checksRestrict functionality or terminate
unknownScan result unclear or invalidRetry scan or investigate
initializationErrorSDK failed to initialize properlyFix initialization issues

Scan Result Handling:

import Alphyn
private func processScanResult(_ scanResult: AlphynScanResult) {
print("Alphyn Scan Result: \(scanResult.emoji) \(scanResult.displayName)")
if scanResult.isThreat {
print("Alphyn Security threat detected!")
if scanResult.isCriticalThreat {
print("Alphyn Critical threat - terminating app")
} else {
print("Alphyn Enabling enhanced security monitoring")
}
} else if scanResult == .trusted {
print("Alphyn Application verified as secure")
}
}```
### Handling Scan Responses
**Comprehensive Scan Response Handler:**
```swift
import Alphyn
class SecurityManager {
func handleScanResponse(result: AlphynScanResult) {
switch result {
case .trusted:
print("Security ✅ Application is trusted")
case .flagged:
print("Security ⚠️ Application flagged for review")
case .untrusted:
print("Security 🚨 Application untrusted - critical action required")
case .initializationError:
print("Security Initialization error during scan response")
case .unknown:
print("Security Unknown scan result")
}
}
}