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

TypeScript
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

TypeScript
dash.system.vibrate(options?: VibrateOptions, callOptions?: CallOptions): DashRequest<void>

Plays a short vibration. Resolves once it's done.

Types: VibrateOptions

dash.system.torch

TypeScript
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

TypeScript
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

TypeScript
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

TypeScript
dash.system.copyText(text: string, callOptions?: CallOptions): DashRequest<void>

Copies text for the person to paste somewhere else.

dash.system.share

TypeScript
dash.system.share(options: ShareOptions, callOptions?: CallOptions): DashRequest<void>

Opens the device's share sheet. Resolves once it shows.

Types: ShareOptions

dash.system.dial

TypeScript
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

TypeScript
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

TypeScript
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

TypeScript
type Platform = 'ios' | 'android' | 'simulator';

SystemInfo

FieldTypeWhat it is
platformPlatform
osVersionstringSuch as "18.2" on iOS or "15" on Android.
languagestringThe person's language, such as "en".
regionstring | nullThe person's region, such as "SL", or null if Dash doesn't know it.
timeZonestringSuch as "Africa/Freetown".
dashVersionstringThe version of Dash the dot runs in, such as "2.4.0". To check for a call, use dash.supports.
apiVersionsstring[]The Dash API versions it offers, one for each major it supports, such as ["1.0"].

VibrationStyle

TypeScript
type VibrationStyle = 'light' | 'medium' | 'heavy' | 'success' | 'warning' | 'error';

VibrateOptions

FieldTypeWhat it is
style (optional)VibrationStyleDefault: medium.

BrightnessLevel

TypeScript
type BrightnessLevel = 'max' | 'normal';

ShareOptions

Give at least one of text, url and file.

FieldTypeWhat it is
title (optional)stringA subject, for apps that use one, such as email.
text (optional)string
url (optional)string
file (optional)DotFile

Keep reading