Skip to main content

Device

Namespace: Wisej.Hybrid

Assembly: Wisej.Hybrid

The "gateway" into the Hybrid client that provides access to native device properties, methods, and events.

public class Device : Component

Properties

Static memberAppActions

DeviceAppActions: Manages application actions, such as shortcuts to specific parts of the application. This class provides methods to retrieve and set app actions, which can be used for quick access.

Use of this class requires additional setup. See App Actions for more details.

Static memberAppInfo

DeviceAppInfo: Provides methods to interact with the application info.

DeviceAppLinks: Provides methods to register and deregister application deep links.

Static memberAuthenticator

DeviceAuthenticator: A web navigation API intended to be used for Authentication with external web services such as OAuth.

This API helps with navigating to a start URL and waiting for a callback URL to the app. Your app must be registered to handle the callback scheme you provide in the call to authenticate.

Static memberBackground

DeviceBackground: Provides properties to interact with the device's background.

Static memberBorder

DeviceBorder: Provides methods to interact with the device's border.

Static memberBottomBar

DeviceBottomBar: Provides properties to interact with the device's bottom bar.

Static memberBrowser

DeviceBrowser: Provides methods to open the device's embedded or external web browser.

Static memberClipboard

DeviceClipboard: Provides methods for interacting with the client device's clipboard.

Static memberContacts

DeviceContacts: Provides methods to access the device's contacts.

Static memberDisplay

DeviceDisplay: Provides properties and events to interact with the device's display.

Static memberEmail

DeviceEmail: Provides methods to access the device's email client.

Static memberFileSystem

DeviceFileSystem: Provides methods to interact with the device's file system.

Static memberFlashlight

DeviceFlashlight: Provides methods to interact with the device's flashlight.

Static memberFlyout

DeviceFlyout: Provides properties, methods, and events to interact with the Hybrid client's Flyout.

Static memberGeolocation

DeviceGeolocation: Provides methods to fetch the user's location.

Static memberHapticFeedback

DeviceHapticFeedback: Provides methods to trigger haptic feedback on the client device.

Static memberInfo

DeviceInfo: Provides information about the hybrid client.

Static memberLauncher

DeviceLauncher: Provides methods to launch other apps.

Static memberLifecycle

DeviceLifecycle: Provides events related to the device lifecycle.

Static memberLocalNotification

DeviceLocalNotification: Provides methods to schedule and handle local notifications on the device.

Static memberLogs

DeviceLogs: Provides an event to log device events.

Static memberMap

DeviceMap: The Map API enables an application to open the installed map application to a specific location or placemark.

Static memberMedia

DeviceMedia: Provides properties and methods to interact with device media.

DeviceMenuBar: Provides methods to interact with the device's menu bar.

DeviceNavigation: Provides methods for handling navigation and page transitions within the app.

Static memberPermissions

DevicePermissions: Provides methods to interact with device permissions.

Static memberPopups

DevicePopups: Provides methods to show popups.

Static memberPreferences

DevicePreferences: Manages device preferences, allowing retrieval and storage of user preferences.

Static memberResources

DeviceResources: Provides methods for accessing resources embedded within the Hybrid client application.

Static memberScreen

DeviceScreen: Provides methods for interacting with the device's screen, including taking screenshots and screen recording.

Static memberSecureStorage

DeviceSecureStorage: Provides secure storage functionality for sensitive information on the device. This class allows for the storing, retrieving, and deleting of secure information.

This class requires special setup. See: https://learn.microsoft.com/en-us/dotnet/maui/platform-integration/storage/secure-storage for details.

Static memberSensors

DeviceSensors: Provides integrations to interact with device sensors.

Static memberSharing

DeviceSharing: Provides methods for sharing data on the client device.

Static memberSms

DeviceSms: Provides methods to compose a SMS.

Static memberSpeech

DeviceSpeech: Provides methods to interact with the device's speech module.

Static memberStatusBar

DeviceStatusBar: Provides properties to interact with the device's status bar.

Static memberTabBar

DeviceTabBar: Provides acceess to the client device's tab bar.

Static memberTheme

DeviceTheme: Provides methods to interact with the Hybrid client app's theme.

Static memberTitleBar

DeviceTitleBar: Provides information about the application's title bar.

Static memberToolbar

DeviceToolbar: Provides access to the client device's toolbar.

Static memberValid

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

Static memberVibration

DeviceVibration: Provides methods to vibrate the client device.

Static memberWindows

DeviceWindows: Provides methods to interact with device windows.

Methods

Static memberPostMessage(handler, action, args)

Posts a message to the device.

ParameterTypeDescription
handlerStringThe handler to post to the device, i.e., "tabBar".
actionStringThe action to perform on the handler.
argsObject[]The arguments associated with the action.

Static memberPostMessageAsync(handler, action, args)

Posts an asynchronous message to the hybrid client.

ParameterTypeDescription
handlerStringThe handler.
actionStringThe action to perform on the handler.
argsObject[]The action arguments.

Returns: Task<Object>. A task representing the result of the operation.

Static memberPostModalMessage(handler, action, args)

Posts a message to the device and enters the modal state waiting for the response.

ParameterTypeDescription
handlerStringThe handler to post to the device, i.e., "tabBar".
actionStringThe action to perform on the handler.
argsObject[]The arguments associated with the action.

Returns: DeviceResponse. The response from the device.

Static memberRegisterEventListener(handler, callback)

Registers a client device event listener.

ParameterTypeDescription
handlerStringThe handler identifier.
callbackAction<DeviceEvent>The callback to execute.

Static memberRemoveEventListener(handler, callback)

Removes an event listener, if it exists.

ParameterTypeDescription
handlerStringThe handler identifier.
callbackAction<DeviceEvent>The event callback to detach.

Static memberUse<T>()

Gets the given member or extension.

ParameterTypeDescription
TThe type of the member or extension.

Returns: T. The member or extension.