iOS
Integrate Phonelink phone verification in native iOS apps with Swift.
Install
Basic usage
1. Configure
Add PhoneLink.configure to your AppDelegate or App init. Call this once at launch before any verification calls.
import PhoneLink
PhoneLink.configure("your-client-id")2. Verify
Call PhoneLink.verify to start the verification flow. The SDK opens a secure browser session where the user enters and verifies their phone number.
PhoneLink.verify { result in
if let phone = result.phoneNumber, let token = result.token {
// Send token to your server for validation
print("Verified: \(phone)")
} else if let error = result.error {
print("Error: \(error)")
}
}Prefilled phone number
If you already have the user's phone number, skip the number entry screen by passing it directly:
PhoneLink.verify(phoneNumber: "+14155551234") { result in
if let token = result.token {
// Send token to your server
}
}The user will go straight to the verification code screen.
Server verification
The result.token contains a signed JWT that should be validated on your server before trusting the phone number. The server-side verification is identical across all platforms — see the Server Verification guide.