getMyCarePathAccessUrl

abstract suspend fun getMyCarePathAccessUrl(section: MyCarePathSection? = null): String

Retrieves the personalized MyCarePath access URL.

Return

A String with the MyCarePath access URL. Returns an empty string if unavailable.

Parameters

section

An optional section to deep link into. See com.advantahealth.api.mycarepath.model.MyCarePathSection for available sections.

Throws

if the request fails.

Android (Kotlin)

lifecycleScope.launch {
try {
val url = AFCore.myCarePath().getMyCarePathAccessUrl(MyCarePathSection.COURSES)
if (url.isNotEmpty()) {
openInWebView(url)
} else {
showError("Could not retrieve MyCarePath URL")
}
} catch (t: Throwable) {
showError("Failed to load MyCarePath: ${t.message}")
}
}

iOS (Swift)

Task {
do {
let url = try await AFCore.shared.myCarePath().getMyCarePathAccessUrl(section: .courses)
if !url.isEmpty {
self.openInWebView(url)
} else {
self.showError("Could not retrieve MyCarePath URL")
}
} catch {
self.showError("Failed to load MyCarePath: \(error.localizedDescription)")
}
}