sign In Or Create Member
abstract suspend fun signInOrCreateMember(externalUserId: String, email: String? = null, firstName: String? = null, middleName: String? = null, lastName: String? = null, gender: String? = null, dateOfBirth: String? = null, phoneNumber: String? = null, address1: String? = null, address2: String? = null, city: String? = null, state: String? = null, zip: String? = null, attributes: Map<String, String?>? = null): AFResult
Attempts to authenticate a member using their externalUserId.
This flow is intended for organization accounts that do not use eligibility files. Instead, members are identified and authenticated directly by a tenant-unique identifier.
Return
true if authentication succeeded; false if the member could not be found.
Parameters
external User Id
A tenant-unique identifier string.
Throws
on network errors or unexpected responses.
Android (Kotlin) — auto-login after member creation
lifecycleScope.launch {
val ok = AFCore.authentication().loginWithUniqueId(uniqueId = "EMP001")
if (ok) navigateToHome() else showError("Member not found")
}Content copied to clipboard
iOS (Swift) — auto-login after member creation
Task {
do {
let ok = try await AFCore.shared.authentication().signInOrCreateMember(externalUserId: "EMP001")
if ok { navigateToHome() } else { showError("Member not found") }
} catch {
showError("Sign in failed: \\(error.localizedDescription)")
}
}Content copied to clipboard