iOS Business User APIs
Business user APIs for authentication and account management. Access these APIs through vipaso.user.business.
Authentication
Login
Authenticate a business user with email and password. Business accounts are created through Vipaso's registration process:
do {
let request = LoginRequest(identifier: email, password: password)
try await vipaso.user.business.login(request: request)
// Business user successfully logged in
// Authentication state change will be sent via delegate
} catch {
// Handle login error
print("Login failed: \(error.localizedDescription)")
}
Logout
Log out the current business user:
vipaso.user.business.logout()
// Authentication state change will be sent via delegate
Business User Data
Fetch Business Details
Get information about the business user associated with the current business user:
do {
let response = try await vipaso.user.business.fetchUser()
let user = response.user
// Access user.id, user.name, user.currency, etc.
print("Business user: \(user.name ?? "Unknown")")
} catch {
print("Fetch business user failed: \(error.localizedDescription)")
}
Notes
- Business accounts are created through Vipaso's registration process, not through the SDK