Links

Device Blocks

Overview

Device blocks allow you to access device-specific capabilities, such as sensors, camera functionalities, or location services. By utilizing device blocks, you can create apps that leverage the unique features of the device, enhancing user experiences by incorporating functionalities tailored to the device's capabilities.

Vibrate

This block causes the device to vibrate.

Current Time and Date

This block returns the current time or date in numerical format (e.g. January is returned as month = 1).
If you want to convert the numbers into words, we suggest adding a local table data source and simple tables like the ones below.

Get Seconds since 1970

This block measures seconds since 00:00:00 UTC on 1 January 1970. This timestamp is also known as Unix time or Epoch time. You can learn more about its use in computer programming here: Unix time Wikipedia page.

Device is Online?

This block checks the device's online/offline status. This is helpful if you want to provide a different experience depending on whether the user is online or not. This block returns true or false.

Get Screen Height or Width

This block returns the height or width of the screen running the app in pixels.

Platform is [X]?

This block gets the device's mobile operating system. This is helpful if you want to modify the user experience depending on the user's mobile operating system. This block returns true or false.

Dismiss Keyboard

This block allows you to dismiss the device keyboard for the user.

Keep Screen Awake

Some devices automatically go to sleep if there is no user activity in an app for a certain period. The "set keep screen awake to" block keeps the screen awake even if the user is not actively interacting with the app. This block can be set to true or false.

Is Device Color Scheme?

Having dark and light modes available is a popular choice for apps and device operating systems. This block detects whether the user's device is set to a light or dark color theme. You can then use blocks to change the color scheme of components in your app to match the user's preferences. This block returns true or false.