client-device
Reactive icon

Client Device

Stable version 1.0.0 (Compatible with OutSystems 11)
Uploaded
 on 29 October 2022
 by 
5.0
 (1 rating)
client-device

Client Device

Documentation
1.0.0

Overview

eSpace Name

ClientDevice_Lib

Description

Module that expose client action to retrieve info about battery,location,network and Browser context of the current device.


Implementation

Actions

Client Actions


GetBatteryInfo

 Provides information about the system's battery charge level.

Input parameters

-----

Output parameters

Name

Description

DataType

IsApiSupported

Indicate if the current context supports the api

Boolean

IsCharging

A Boolean value indicating whether the battery is currently being charged.

Boolean

ChargingTime

A number representing the remaining time in seconds until the battery is fully charged, or 0 if the battery is already fully charged

Integer

DischargingTime

A number representing the remaining time in seconds until the battery is completely discharged and the system suspends

Integer

Level

A number representing the system's battery charge level scaled to a value between 0.0 and 1.0

Decimal


GetBrowserContextInfo

Return the info of the current browser.

Input parameters

-----

Output parameters

Name

Description

DataType

UserAgent

Returns the user agent string for the current browser

Text

CookieEnabled

Returns a Boolean value that indicates whether cookies are enabled or not.

Boolean

HardwareConcurrency

Returns the number of logical processors available to run threads on the user's computer

Integer

Language

Returns a string representing the preferred language of the user, usually the language of the browser UI

Text

PreferredLanguages

Returns an array of strings representing the user's preferred languages

Text List

MaxTouchPoints

The maximum number of simultaneous touch contact points are supported by the current device.

Integer

PdfViewerEnabled

Indicates whether the browser supports inline display of PDF files when navigating to them.

Boolean


GetCurrentGeoLocationPosition

Get the current position of the device.

Input parameters

-----

Output parameters

Name

Description

DataType

IsSuccess

Indicate if the operation is completed with success status

Boolean

ErrorCode

1 PERMISSION_DENIED

2 POSITION_UNAVAILABLE

3 TIMEOU

Integer

Accuracy

Returns a double representing the accuracy of the latitude and longitude properties, expressed in meters.

Decimal

Altitude

Returns a double representing the position's altitude in meters, relative to sea level. This value can be null if the implementation cannot provide the data.

Decimal

Longitude

Returns a double representing the position's longitude in decimal degrees.

Decimal

Latitude

Returns a double representing the position's latitude in decimal degrees.

Decimal



GetNetworkInfo

Provides information about the connection a device is using to communicate with the network.

Input parameters

-----

Output parameters

Name

Description

DataType

IsOnline

Indicate if the client is connected.

Boolean

Downlink

Returns the effective bandwidth estimate in megabits per second, rounded to the nearest multiple of 25 kilobits per seconds.

Decimal

EffectiveType

Returns the effective type of the connection meaning one of 'slow-2g', '2g', '3g', or '4g'. This value is determined using a combination of recently observed round-trip time and downlink values.

Text

Rtt

Returns the estimated effective round-trip time of the current connection, rounded to the nearest multiple of 25 milliseconds.

Decimal

IsSaveData

Returns true if the user has set a reduced data usage option on the user agent.

Boolean