Features
Learn how to use different features in Wisej Mobile.
Native functionality can be leveraged in Wisej applications using the Wisej Mobile Integration package. The package allows interaction with various hardware and software capabilities on the device.
Cross-Platform Wisej Application
for a full list of properties, methods and events see the API documentation.

Hardware Features

Biometric Authentication

Biometric authentication is a form of security that uses the biometric features of a user to identify and validate a user. Android and iOS both implement a form of this for user-identification.

Usage

C#
1
try
2
{
3
Device.Authenticate("Login with FaceID");
4
}
5
catch (DeviceException ex)
6
{
7
AlertBox.Show(ex.Message);
8
}
Copied!

Document Scanning

Using VisionKit in iOS, devices can leverage the built-in document scanner to upload documents to their Wisej application.

Usage

C#
1
// Gets a list of scanned documents from the device. Yes, it's that easy.
2
try
3
{
4
Image[] documents = Device.Camera.ScanDocument();
5
}
6
catch (DeviceException ex)
7
{
8
AlertBox.Show(ex.Message);
9
}
Copied!
Document scanning on iOS requires iOS 14 or greater.

Haptic Feedback

Haptic feedback uses touch as a means to communicate with users. It applies forces, vibrations, or motions to the user.

Haptic Feedback Types

  • Error: Play when a user performs an error.
  • Success: Play when a user performs a successful action.
  • Warning: Play when you want to warn the user of an action.

Usage

From the Server:
C#
1
Device.Vibrate(DeviceVibrationType.Error);
Copied!
From the Client:
JavaScript
1
// Triggers haptic feedback on the client device. 1 refers to the vibration type.
2
window.webkit.messageHandlers.Device.postMessage({"type":"action.vibrate", data: [1]});
Copied!
Add Haptic Feedback on the client by opening ClientEvents on a control, adding an event handler, and adding the above code.

Near-Field Communication (NFC)

Near-Field-Communication is a set of communication protocols that allows the communication of two electronic devices. This protocol is often used for contactless payment systems.‌

Usage

C#
1
try
2
{
3
var data = Device.NFC.ReadNFC();
4
5
Device.NFC.WriteNFC("Some Data");
6
}
7
catch (DeviceException ex)
8
{
9
AlertBox.Show(ex.Reason);
10
}
Copied!

Sensors

As the system gathers information using various sensors on a device, the raw data can be monitored and used in the Wisej application.

Usage

C#
1
try
2
{
3
Device.Sensors.StartAccelerometer();
4
Device.AccelerometerUpdate += Device_AccelerometerUpdate;
5
}
6
catch (DeviceException ex)
7
{
8
AlertBox.Show(ex.Reason);
9
}
10
...
11
private void Device_AccelerometerUpdate(object sender, DeviceEventArgs e)
12
{
13
AlertBox.Show(e.Data.ToString());
14
}
Copied!

Software Features

Audio

By default, iOS Safari does not allow auto-playing audio. The native integration disables this “feature”, so developers can play sounds on button clicks or any event after the first DOM interaction.

Usage

C#
VB.NET
1
Application.Play("C:\\Some\\Audio\\File.mp4");
Copied!
1
Application.Play("C:\\Some\\Audio\\File.mp4")
Copied!

Native Popups

Native popups show users relevant in-app information that often request some form of feedback such as a selection or text entry.‌

Usage

C#
VB.NET
1
try
2
{
3
Device.Popups.Alert("Session Timeout", "Would you like to continue the session?", new[] {
4
new DevicePopupOption("yes", "Yes"),
5
new DevicePopupOption("no", "No")
6
{
7
Type = DevicePromptOptionType.Destructive
8
}
9
});
10
}
11
catch (DeviceException ex)
12
{
13
AlertBox.Show(ex.Reason);
14
}
Copied!
1
Copied!
iOS Native Prompt

Push Notifications

Push notifications are user-facing messages that display important information to the user about a specific application.‌

Usage

C#
VB.NET
1
Device.SubscribedNotifications += Device_SubscribedNotifications;
2
3
private void Device_SubscribedNotifications(object sender, DeviceEventArgs e)
4
{
5
// e.Data is the remote notification token.
6
var token = e.Data;
7
}
Copied!
1
Device.SubscribedNotifications += AddressOf Device_AccelerometerUpdate
2
3
Private Sub Device_SubscribedNotifications(ByVal sender As Object, ByVal e As DeviceEventArgs)
4
// e.Data is the remote notification token.
5
Dim token = e.Data;
6
End Sub
Copied!
To process remote notifications in a self-hosted application, you must configure a remote notifications server.

Permissions

When using certain device capabilities, it may be required to request the specified permission from the user of the device before proceeding.

Device Permission Types

  • Camera: Required to use the device’s camera.
  • Location: Required to access the device’s location.
  • Microphone: Required to access the device’s microphone.
  • Photos: Required to access the device’s photo library natively.

Usage

C#
VB.NET
1
try
2
{
3
var isSuccess = Device.RequestPermission(Device.PermissionType.Camera);
4
}
5
catch (DeviceException ex)
6
{
7
AlertBox.Show(ex.Reason);
8
}
Copied!
1
Device.RequestPermission(Device.PermissionType.Camera)
Copied!
Some permissions are automatically requested the first time they are used.

Screen Brightness

The brightness of the screen can be controlled through the Wisej application.

Usage

C#
VB.NET
1
Device.Screen.Brightness = 0.5;
Copied!
1
Device.Screen.Brightness = 0.5
Copied!

Screen Timeout

The timeout of the screen display can be controlled through the Wisej application.

Usage

C#
VB.NET
1
// prevents the screen from locking.
2
Device.Screen.IdleTimerDisabled = true;
Copied!
1
' prevents the screen from locking.'
2
Device.Screen.IdleTimerDisabled = true
Copied!

Status Bar

The status bar appears on the top edge of the device's screen. It displays useful information about the time, network connectivity, and more.

Usage

C#
VB.NET
1
Device.Statusbar.BackColor = Color.Blue;
Copied!
1
Device.Statusbar.BackColor = Color.Blue
Copied!

Tab Bar

A tab bar is a graphical element that appears at the bottom of the user's screen. It provides an interface for quickly switching between different parts of an application.

Usage

C#
VB.NET
1
// assigns the background color of the tabbar.
2
Device.TabBar.BackColor = Color.Blue;
3
4
// attach to the tabbar selected event.
5
Device.TabBar.Selected += this.TabBar_Selected;
6
7
private void TabBar_Selected(object sender, SelectedEventsArgs e) {
8
AlertBox.Show(quot;Selected {e.Button.Text}")
9
}
Copied!
1
Device.TabBar.BackColor = Color.Blue
2
Device.TabBar.Selected += AddressOf Me.TabBar_Selected
3
4
Private Sub TabBar_Selected(ByVal sender As Object, ByVal e As SelectedEventsArgs)
5
AlertBox.Show($"Selected {e.Button.Text}")
6
End Sub
Copied!

Toolbar

The toolbar is a graphical control that features buttons, icons, and other elements to interact with the user.‌

Usage

C#
VB.NET
1
var button = new DeviceToolbar.Button()
2
{
3
Text = "My Button!",
4
Icon = Image.FromFile("C:\\MyImage.png")
5
}
6
7
Device.Toolbar.Buttons = new DeviceToolbar.Button[] { button };
8
Device.Toolbar.Visible = true;
Copied!
1
Dim button = New DeviceToolbar.Button() With {
2
.Text = "My Button!",
3
.Icon = Image.FromFile("C:\MyImage.png")
4
}
5
Device.Toolbar.Buttons = New DeviceToolbar.Button() {button}
6
Device.Toolbar.Visible = True
Copied!
Last modified 18d ago