Products · Dash API
System
Vibrate, use the torch, keep the screen on, copy, share, open the dialer or a web page, wait, and read facts about the phone.
dash.system.info
dash.system.info(callOptions?: CallOptions): DashRequest<SystemInfo>Facts about the phone and Dash: the platform, language, region, time zone and versions. Nothing in it identifies the person or the phone.
Types: SystemInfo
dash.system.vibrate
dash.system.vibrate(options?: VibrateOptions, callOptions?: CallOptions): DashRequest<void>Plays a short vibration. Resolves once it's done.
Types: VibrateOptions
dash.system.torch
dash.system.torch(on: boolean, callOptions?: CallOptions): DashRequest<void>Turns the torch on or off. Rejects with unsupported on a device without one.
dash.system.keepAwake
dash.system.keepAwake(on: boolean, callOptions?: CallOptions): DashRequest<void>Keeps the screen from dimming and locking while the dot shows, such as while a ticket's QR code is up. Dash undoes it when the dot closes.
dash.system.brightness
dash.system.brightness(level: BrightnessLevel, callOptions?: CallOptions): DashRequest<void>max makes the screen as bright as it goes, so a scanner can read a QR code on it, and normal puts it back. Dash puts it back too when the dot closes or the person leaves the app.
Types: BrightnessLevel
dash.system.copyText
dash.system.copyText(text: string, callOptions?: CallOptions): DashRequest<void>Copies text for the person to paste somewhere else.
dash.system.share
dash.system.share(options: ShareOptions, callOptions?: CallOptions): DashRequest<void>Opens the device's share sheet. Resolves once it shows.
Types: ShareOptions
dash.system.dial
dash.system.dial(number: string, callOptions?: CallOptions): DashRequest<void>Opens the phone's dialer with number ready, such as "+232 76 123456" or a USSD code such as "*715#". The person taps Call. Spaces and dashes are fine; anything else but digits, +, * and # rejects with invalid. For a code, Dash asks the person first, and rejects with cancelled if they say no. Codes that set up call forwarding, such as "*21…#", reject with denied.
dash.system.openUrl
dash.system.openUrl(url: string, callOptions?: CallOptions): DashRequest<void>Opens an https address in the device's browser. Any other address rejects with invalid.
dash.system.delay
dash.system.delay(milliseconds: number, callOptions?: CallOptions): DashRequest<void>Waits milliseconds, then resolves. A dot has no setTimeout: use this to pause, as between checks on a payment.
Types
Platform
type Platform = 'ios' | 'android' | 'simulator';SystemInfo
| Field | Type | What it is |
|---|---|---|
platform | Platform | |
osVersion | string | Such as "18.2" on iOS or "15" on Android. |
language | string | The person's language, such as "en". |
region | string | null | The person's region, such as "SL", or null if Dash doesn't know it. |
timeZone | string | Such as "Africa/Freetown". |
dashVersion | string | The version of Dash the dot runs in, such as "2.4.0". To check for a call, use dash.supports. |
apiVersions | string[] | The Dash API versions it offers, one for each major it supports, such as ["1.0"]. |
VibrationStyle
type VibrationStyle = 'light' | 'medium' | 'heavy' | 'success' | 'warning' | 'error';VibrateOptions
| Field | Type | What it is |
|---|---|---|
style (optional) | VibrationStyle | Default: medium. |
BrightnessLevel
type BrightnessLevel = 'max' | 'normal';ShareOptions
Give at least one of text, url and file.
| Field | Type | What it is |
|---|---|---|
title (optional) | string | A subject, for apps that use one, such as email. |
text (optional) | string | |
url (optional) | string | |
file (optional) | DotFile |