Mental Fitness (Spot-It)
Mental Fitness brings the Spot-It technique into your app: a short guided check-in where the member picks a situation and the symptoms or thoughts they notice, and receives personalized coping strategies ("spots"). When the member gives feedback on a strategy, the Spot-It visit is recorded in their activity. Requires Mental Fitness to be enabled for your client.
What you can do
- Load the questionnaire: the situations, symptoms and thoughts to choose from, and the feedback options.
- Generate personalized coping strategies from the member's choices.
- Collect the member's feedback on a strategy, which records the visit.
Key APIs
| Call | What it is for |
|---|---|
getSpotItTechniqueData() | The situations, symptoms, thoughts and feedback options |
generateSpots(...) | Coping strategies for the member's selection |
submitSpotItFeedback(...) | The member's feedback; records the Spot-It visit |
Example: one Spot-It session
- Android (Kotlin)
- iOS (Swift)
lifecycleScope.launch {
try {
val data = AFCore.mentalFitness().getSpotItTechniqueData()
// The member picks one situation and any symptoms or thoughts from `data`
val result = AFCore.mentalFitness().generateSpots(
situationIds = selectedSituationIds,
symptomIds = selectedSymptomIds,
timestampInSeconds = Clock.System.now().epochSeconds
)
showSpots(result.spots)
// The member rates a strategy with options from `data`
val feedback = AFCore.mentalFitness().submitSpotItFeedback(
spotId = result.requestId.orEmpty(), // the id of this generateSpots() request
endorsementId = selectedEndorsement.id?.toInt() ?: 0,
successId = selectedSuccess.id?.toInt() ?: 0,
feedback = null
)
if (feedback.status) showThanks()
} catch (t: Throwable) {
showError(t)
}
}
Task {
do {
let data = try await AFCore.shared.mentalFitness().getSpotItTechniqueData()
// The member picks one situation and any symptoms or thoughts from `data`
let result = try await AFCore.shared.mentalFitness().generateSpots(
situationIds: selectedSituationIds,
symptomIds: selectedSymptomIds,
timestampInSeconds: Int64(Date().timeIntervalSince1970)
)
showSpots(result.spots)
// The member rates a strategy with options from `data`
let feedback = try await AFCore.shared.mentalFitness().submitSpotItFeedback(
spotId: result.requestId ?? "", // the id of this generateSpots() request
endorsementId: selectedEndorsement.id?.int32Value ?? 0,
successId: selectedSuccess.id?.int32Value ?? 0,
feedback: nil
)
if feedback.status { showThanks() }
} catch {
showError(error)
}
}
Learn more
- API Reference -- every Mental Fitness call and model.
- Complete integration guides for Spot-It are in AIDE Docs.