Back to Wails

Wails Mobile Kitchen Sink

v3/examples/mobile/frontend/index.html

2.13.03.3 KB
Original Source

Service bindings

Call Go methods from JS and get typed results back.

Greet

+Add

÷Divide

Results appear here…

Events

Go emits a time event every second (Go → JS).

waiting for first tick…

Send a ping to Go; it replies with pong (JS → Go → JS).

Send ping

No pong yet…

System events

Battery, network, theme, screen-lock and low-memory arrive in Go as common: application events (ios:/android:common:) and are forwarded here by the app. Try toggling charging, airplane mode or dark mode.

Waiting for system events…

Native dialogs

Backed by UIAlertController (iOS) / AlertDialog (Android).

InfoWarningErrorQuestion

Dialog results appear here…

Clipboard

CopyPaste

Clipboard value appears here…

Screen

Get screen metrics

Screen metrics appear here…

Device

Get device info

Device info appears here…

Native share sheet and opening links in the system browser.

Share…

Open

Screen

Keep screen awake

Prevents the display from auto-locking while the app is in front.

Torch (flashlight)

Has no visible effect on a simulator/emulator without a camera flash.

BrightnessRead

Layout & info

Safe-area insetsApp info

Orientation

PortraitLandscapeAuto

Current: —

Status bar

Light iconsDark iconsHideShow

Security & notifications

AuthenticateSend notification

Biometric uses Face ID / Touch ID / fingerprint, with a device-passcode fallback.

Secure storage

Backed by the iOS Keychain / Android EncryptedSharedPreferences.

SaveLoadDelete

These features are available when running on iOS or Android.

Haptics

Tactile feedback via the Taptic Engine (iOS) / Vibrator (Android).

LightMediumHeavySuccessWarningErrorSelection

Location

One-shot GPS fix. Prompts for permission on first use.

Get location

Motion & proximity

Accelerometer

Streams device acceleration (x, y, z) in real time.

Proximity sensor

Reports near/far — cover the top of the device to trigger it.

Speech

SpeakStop

Device state

StoragePowerNetwork

Keyboard & privacy

Watch keyboard insets

Reports the software keyboard's height as it shows and hides.

Block screen capture

Sets FLAG_SECURE on Android; on iOS, detects screenshots and screen recording (it cannot block them).

These features are available when running on iOS or Android.

Camera

Capture a photo or record a video with the system camera (prompts for the camera permission on first use).

PhotoVideo

!captured photo

No photo yet — tap Take photo.

Take photo

Background execution

Keep the app working while backgrounded. On Android this runs a foreground service with an ongoing notification (the process — and your Go goroutines — keep running); on iOS it opens a short background-task window (sustained background work needs a declared UIBackgroundMode).

Foreground service (Android) Begin background task (iOS)

These features are available when running on iOS or Android.

Platform features

Haptic: lightHaptic: mediumHaptic: heavy Scroll enabled Bounce enabled

Drag the page past its edge to feel bounce; turn Scroll off to freeze the page.

VibrateShow toast

Native mobile features are available when running on iOS or Android.