Actions And Check-In
How your app opens from an Action and how a check-in completes it.
A mini app does its work inside an Action. People pick your app when they create an Action, and your app is what they open when they do it.
How An Action Opens Your App
- A person creates an Action and chooses the Mini app page step.
- Under Aksa mini apps they pick your app. Aksa fills in the link and the defaults you suggested in the manifest (
action.titleandaction.minMinutes). - When they do the Action, your app opens inside Aksa with the Action's context.
Call context.get to read that context. It returns the app id, a pseudonymous userId, the actionId, the roomId, the locale and the source. When it returns an actionId you are inside an Action, so do not ask the person to link one.
Checking In
actions.checkIn completes the Action once the minimum minutes have passed. Before that, the app is told how many seconds are left. The call needs the actions.checkin scope, which any developer can use.
window.aksa.request({ method: "actions.checkIn", params: { note: "8 glasses" } })When There Is No Action
Outside Aksa, or when no Action opened your app, context.get has no actionId. The helper in aksa-mini.js shows a "Link An Action" row where the person pastes the Action link once.
›Checkpoint
- You read
context.getinstead of asking for an Action link. action.minMinutesmatches the habit.actions.checkinis in your declared scopes.
Ready to ship?
Submit An App