MyCarePath
The MyCarePath module integrates with Avidon Health to provide a personalized wellness journey. AFCore generates a secure access URL that you load in a WebView, giving members a seamless in-app experience without leaving your application.
How It Works
- Request the access URL -- Call
getMyCarePathAccessUrl()to obtain a secure, session-bound URL. - Load in a WebView -- Present the URL in an in-app browser or WebView.
- Optional deep-linking -- Pass a
MyCarePathSectionto navigate directly to a specific area of the MyCarePath experience.
Sections
The optional section parameter controls where the member lands within MyCarePath.
| Section | Description |
|---|---|
MyCarePathSection.COURSES | Opens the course catalog. |
MyCarePathSection.CONTENT_LIBRARY | Opens the content library. |
null (default) | Opens the MyCarePath home page. |
Get Access URL
- Android (Kotlin)
- iOS (Swift)
lifecycleScope.launch {
try {
// Open the default MyCarePath home page
val url = AFCore.myCarePath().getMyCarePathAccessUrl()
webView.loadUrl(url)
} catch (e: Exception) {
showError("Could not load MyCarePath: ${e.message}")
}
}
do {
let url = try await AFCore.shared.myCarePath().getMyCarePathAccessUrl()
webView.load(URLRequest(url: URL(string: url)!))
} catch {
showError("Could not load MyCarePath: \(error)")
}
Deep-Link to a Section
- Android (Kotlin)
- iOS (Swift)
// Open the course catalog directly
val url = AFCore.myCarePath().getMyCarePathAccessUrl(
section = MyCarePathSection.COURSES
)
webView.loadUrl(url)
// Open the content library directly
let url = try await AFCore.shared.myCarePath().getMyCarePathAccessUrl(
section: .contentLibrary
)
webView.load(URLRequest(url: URL(string: url)!))
Best Practices
- Use an in-app WebView. Members expect a seamless experience. Opening an external browser breaks the flow.
- Explain the partner experience. Show a brief introduction explaining that MyCarePath is powered by Avidon Health before navigating to the WebView.
- Handle deep-link returns. If the WebView redirects back to your app (e.g., after completing a course), intercept the navigation and return the member to the appropriate screen.
- Refresh the URL on each visit. The access URL is session-bound. Always request a fresh URL rather than caching a previous one.
Quick Reference
- Android (Kotlin)
- iOS (Swift)
AFCore.myCarePath().getMyCarePathAccessUrl()
AFCore.myCarePath().getMyCarePathAccessUrl(section = MyCarePathSection.COURSES)
AFCore.myCarePath().getMyCarePathAccessUrl(section = MyCarePathSection.CONTENT_LIBRARY)
try await AFCore.shared.myCarePath().getMyCarePathAccessUrl()
try await AFCore.shared.myCarePath().getMyCarePathAccessUrl(section: .courses)
try await AFCore.shared.myCarePath().getMyCarePathAccessUrl(section: .contentLibrary)