Profile
AFCore.profile() gives your app the signed-in member's personal data -- name, contact details, date of birth, gender and mailing address -- and lets the member keep it up to date. It also offers a directory-style search of colleagues in the member's organization.
What you can do
- Show the member's profile on a profile or account screen.
- Let the member edit their name, email, phone numbers, address and gender; only the fields you set are changed.
- Search colleagues by name, for example to invite them to the program.
Key APIs
| Call | What it is for |
|---|---|
profile().get() | The member's MemberProfile |
profile().update(profileData) | Save changes; returns an AFResult |
profile().searchColleagueProfiles(query, maxResults) | Colleagues in the member's organization, with their enrollment status |
Example
- Android (Kotlin)
- iOS (Swift)
lifecycleScope.launch {
val profile = AFCore.profile().get()
nameLabel.text = "${profile.firstName} ${profile.lastName}"
profile.cellPhone = "+1-555-0199"
val result = AFCore.profile().update(profileData = profile)
if (!result.status) showError(result.statusMessage)
}
Task {
let profile = try await AFCore.shared.profile().get()
nameLabel.text = "\(profile.firstName ?? "") \(profile.lastName ?? "")"
profile.cellPhone = "+1-555-0199"
let result = try await AFCore.shared.profile().update(profileData: profile)
if !result.status { showError(result.statusMessage) }
}
Profile updates are sent right away and never queued offline; if status is false, show statusMessage and let the member try again. A failed read returns an empty profile unless your config enables throwOnReadFailure(true) -- see Error Handling.
Learn more
See the API Reference for MemberProfile and its fields. Complete integration guides are in AIDE Docs.