Device
Wisej.Web.Ext.MobileIntegration.Device
Namespace: Wisej.Web.Ext.MobileIntegration
Assembly: Wisej.Web.Ext.MobileIntegration (2.0.0.0)
Represents the user's mobile device. The Wisej application interacts with the device through this class.
C#
VB.NET
1
public class Device : Component
Copied!
1
Public Class Device
2
Inherits Component
Copied!

Properties

Info

DeviceInfo Returns the DeviceInfo object containing the information related to the user's mobile device.

OfflinePage

String The HTML page to display on the device when it loses network connectivity.
Pass the relative path of the file.

Screen

DeviceScreen Returns the DeviceScreen object containing the information related to the mobile device's screen.

Statusbar

DeviceStatusbar Returns the DeviceStatusbar object representing the statusbar on the mobile device.

TabBar

DeviceTabBar Returns the DeviceTabBar object representing the tabBar on the mobile device.

Toolbar

DeviceToolbar Returns the DeviceToolbar object representing the toolbar on the mobile device.

Valid

Boolean Verifies that the application is running inside the mobile container.

Methods

Alert(title, message, options)

Displays a native alert box with the specified configuration.
Parameter
Type
Description
title
String
The title of the alert.
message
String
Message to display to the user.
options
The alert buttons.
Returns: String. The result of the alert.

Authenticate(message)

Asks the device to authenticate the user using biometrics if available, or the device's passcode.
Parameter
Type
Description
message
String
The reason for authenticating.
Returns: Boolean. The success of the authentication.
EXPERIMENTAL: Attempts to bind the native application to the specified URL.
Parameter
Type
Description
link
String
The link of the Wisej application.
Returns: Boolean. The success of binding the app.

FreeBoundApplication()

EXPERIMENTAL: Removes the bound-app configuration from the device.

PostMessage(command, args)

Posts a message to the device.
Parameter
Type
Description
command
String
The command to post to the device, i.e., "action.prompt".
args
Object[]
The arguments to pass with the command.

PostModalMessage(command, args)

Posts a message to the device and enters the modal state waiting for the response.
Parameter
Type
Description
command
String
The command to post to the device, i.e., "action.prompt".
args
Object[]
The arguments to pass with the command.
Returns: DeviceResponse. The response from the device.

Prompt(title, message, options)

Displays a native prompt with a set of options for the user to click.
Parameter
Type
Description
title
String
The title of the prompt.
message
String
Message to display to the user.
options
Options to show to the user. If null, it will display the default OK button.
Returns: String. The result of the prompt.

ReadNFC()

Reads messages from NFC devices.
Returns: String.

RequestPermission(permission)

Requests the specified permission from the device.
Parameter
Type
Description
permission
The permission to request.
Returns: Boolean. The success of the permission request.

ScanDocument()

Detects and scans documents using the camera.
Returns: Image[]. An array Image objects containing the documents.

SetExternalScreenData(url)

If the device is connected to an external display, opens the page on the display.
Parameter
Type
Description
url
String
The URL to display on the external screen.

SetFlashlight(on)

Toggles the device's flashlight.
Parameter
Type
Description
on
Boolean
Specifies whether the flashlight should be on.
Returns: Boolean. A bool indicating whether the action was successful.

SetLocalization(culture)

EXPERIMENTAL: Sets the device's language settings to the specified culture.
Parameter
Type
Description
culture
String
The culture to apply (i.e, "en", "it", etc.)

ShowPicker(mode, minimumDateTime, maximumDateTime, startDateTime)

Shows a picker with the specified configuration.
Parameter
Type
Description
mode
The picker style.
minimumDateTime
DateTime
The minimum date or time to show on the picker.
maximumDateTime
DateTime
The maximum date or time to show on the picker.
startDateTime
DateTime
The starting date or time for the picker.
Returns: Nullable. The result of the picker operation or null if an error occurred.

StartAccelerometer()

Starts accelerometer updates.
Returns: Boolean. When true, the device enabled accelerometer updates.

StartGyro()

Starts gyroscope updates.
Returns: Boolean. When true, the device enabled gyroscope updates.

StartMagnetometer()

Starts magnetometer updates.
Returns: Boolean. When true, the device enabled magnetometer updates.

StopAccelerometer()

Stops accelerometer updates.

StopGyro()

Stops gyroscope updates.

StopMagnetometer()

Stops magnetometer updates.

TakePicture()

Allows the user to take a picture using the device's camera.
Returns: ImageCapture. The jpg's base64 encoded URL

TakeVideo()

Allows the user to take a video using the device's camera.
Returns: String. The video's base64 encoded URL

TryML()

EXPERIMENTAL: Demonstrates vision processing using CoreML on iOS.
Returns: String. The detected vision object.

Vibrate(type)

Triggers notification feedback on the device.
Parameter
Type
Description
type
The type of feedback to post to the device.

WriteNFC(message)

Writes the specified message to the NFC device.
Parameter
Type
Description
message
String
The message to write to the NFC device.
Returns: String.

Events

AccelerometerUpdate

DeviceEventHandler Fired when there's an update from the device's accelerometers.

BackButtonPressed

DeviceEventHandler Fired when the back button is pressed on the device (Android only).

Background

EventHandler Fired when the mobile application is sent to the background.

BrightnessChanged

DeviceEventHandler Fired when the brightness of the device's screen changes.

Event

DeviceEventHandler Fired when the device sends an event back to the application.

Foreground

EventHandler Fired when the mobile application is brought to the foreground.

GyroscopeUpdate

DeviceEventHandler Fired when there's an update from the device's gyroscope.

MagnetometerUpdate

DeviceEventHandler Fired when there's an update from the device's magnetometer.

ModeChanged

DeviceEventHandler Fired when a screen gets removed from the device

OrientationChanged

DeviceEventHandler Fired when the orientation of the device changes.

ReceivedNotification

DeviceEventHandler Fired when the device receives a push notification.

ScreenAdded

DeviceEventHandler Fired when the device gets attached to a new screen

ScreenRemoved

DeviceEventHandler Fired when a screen gets removed from the device

SubscribedNotifications

DeviceEventHandler Fired when the device subscribes to remote notifications and receives a remote token

Terminate

EventHandler Fired when the mobile application is terminated.
Last modified 4mo ago