-
Notifications
You must be signed in to change notification settings - Fork 0
Javascript APIs
Nicholas Jitkoff edited this page Mar 26, 2024
·
1 revision
Translucent adds a Javascript bridge to communicate with the native app.
The following are available through existing web apis:
- Camera
- Microphone
- Location
To access other apis, send messages through the window.widget object:
widget.postMessage({})
To request battery level and state, use:
await widget.postMessage({"action":"battery"})
Which will respond with a json status:
{level: "95", state: "0"}