journey.device

Version compatibility

journey.device was introduced with version 4.29.0 of the JourneyApps Container.

Returns information about the device that the container is currently running on.

Supported fields

PropertyDescriptionExample

platform

Return the device platform that the user is on. One of: "Web": Web platform "Desktop": Windows or macOS platform "Android": Android device "iOS": iOS/iPadOS device

"RealWear": RealWear device

var platform = journey.device.platform; if (platform == "Desktop") { dialog("Welcome, Desktop user."); }

manufacturer

Return the manufacturer of the current device.

journey.device.manufacturer // => 'Apple'

model

Returns the model of the current device.

journey.device.model // => 'iPhone7,2'

isPhone

Whether the user is on a phone. e.g. Returns true for an iPhone, but returns false for an iPad. Criteria for phone: Shorter dimension between height and width should be <= 768px.

<button label="I only show on an phone" show-if="$:journey.device.isPhone" />

isPortrait

Whether the device (mobile / tablet only) is in portrait or landscape mode. This is a field that is automatically updated as boolean value.

journey.device.isPortrait // => true

orientation

A more expressive form of isPortrait, which can give even more information such as if the device is physically upside down.

journey.device.orientation // => 'portrait-primary', 'portrait-secondary', 'landscape-primary', 'landscape-secondary'

id

Returns the ID of the device. See below for more details.

journey.device.id // => '0c95829f-7457-4ff8-a864-4ef60a3aaeee'

journey.device.id

Version compatibility

journey.device.id was introduced with version 4.76.0 of the JourneyApps Runtime.

The device's unique identifier can be used to group different containers running on the same device. There are some caveats with this ID.

On iOS, the device's identifier was stored in the Keychain before Container 20.6.1. This ID was different for each container, and will be persisted even if the container is uninstalled from the device. Furthermore, on iOS, the device's ID will only match if the first two parts of the container's bundle ID match. For example: com.acme.one and com.acme.two will share the same device ID.

The device ID is provided directly by the device, and its format is not necessarily the same across different platforms. It can be upper- or lower case, and may or may not have hyphens. The length can also vary. Treat it as a unique string.

Last updated