1.0.2 • Published 2 years ago

@paystory/capacitor-headwind-mdm v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Capacitor Headwind MDM

Capacitor wrapper for Headwind MDM

Install

npm install @paystory/capacitor-headwind-mdm
npx cap sync

Example

import { HeadwindMDM } from '@paystory/capacitor-headwind-mdm';

// Check if HeadwindMDM is available
if (await HeadwindMDM.isConnected()) {
    // Perfect!
}

// Getting a value from server
const value = await HeadwindMDM.get({attr: 'hello'});

// Getting the device id
const deviceId = await HeadwindMDM.getDeviceId();

API

connect()

connect() => any

Connect to Headwind MDM service and set the event handler. This method returns true on success and false if Headwind MDM is not running.

Returns: any

Since: 1.0.0


disconnect()

disconnect() => any

Disconnect from Headwind MDM

Returns: any

Since: 1.0.0


isConnected()

isConnected() => any

Check the connection status. You can use the library functions if this method returns true.

Returns: any

Since: 1.0.0


getServerHost()

getServerHost() => any

Get the host name of Headwind MDM server

Returns: any

Since: 1.0.0


getSecondaryServerHost()

getSecondaryServerHost() => any

Get the secondary host name of Headwind MDM server

Returns: any

Since: 1.0.0


getServerPath()

getServerPath() => any

Get the path of Headwind MDM web panel

Returns: any

Since: 1.0.0


getServerUrl()

getServerUrl() => any

Get the URL of Headwind MDM server

Returns: any

Since: 1.0.0


getSecondaryServerUrl()

getSecondaryServerUrl() => any

Get the secondary URL of Headwind MDM server

Returns: any

Since: 1.0.0


getDeviceId()

getDeviceId() => any

Get the device ID (number)

Returns: any

Since: 1.0.0


getCustom(...)

getCustom(options: { number: number; }) => any

Get the custom variable defined on the server (number can be from 1 to 3)

ParamType
options{ number: number; }

Returns: any

Since: 1.0.0


log(...)

log(options: { level: ErrorLevel; tag: string; message: string; }) => any

Sends a log message to the server

ParamType
options{ level: ErrorLevel; tag: string; message: string; }

Returns: any

Since: 1.0.0


v(...)

v(options: { tag: string; message: string; }) => any

These methods are similar to android.util.Log. They combine writing to Android internal log (logcat) and sending the log message to the server.

ParamType
options{ tag: string; message: string; }

Returns: any

Since: 1.0.0


d(...)

d(options: { tag: string; message: string; }) => any

These methods are similar to android.util.Log. They combine writing to Android internal log (logcat) and sending the log message to the server.

ParamType
options{ tag: string; message: string; }

Returns: any

Since: 1.0.0


i(...)

i(options: { tag: string; message: string; }) => any

These methods are similar to android.util.Log. They combine writing to Android internal log (logcat) and sending the log message to the server.

ParamType
options{ tag: string; message: string; }

Returns: any

Since: 1.0.0


w(...)

w(options: { tag: string; message: string; }) => any

These methods are similar to android.util.Log. They combine writing to Android internal log (logcat) and sending the log message to the server.

ParamType
options{ tag: string; message: string; }

Returns: any

Since: 1.0.0


e(...)

e(options: { tag: string; message: string; }) => any

These methods are similar to android.util.Log. They combine writing to Android internal log (logcat) and sending the log message to the server.

ParamType
options{ tag: string; message: string; }

Returns: any

Since: 1.0.0


get(...)

get(options: { attr: string; defValue?: string; }) => any

Gets an attribute defined in “Application settings” tab of the configuration.

ParamType
options{ attr: string; defValue?: string; }

Returns: any

Since: 1.0.0


set(...)

set(options: { attr: string; value: string; }) => any

Sets an attribute (not yet implemented)

ParamType
options{ attr: string; value: string; }

Returns: any

Since: 1.0.0


apply()

apply() => any

Forces uploading the attributes to the server (not yet implemented)

Returns: any

Since: 1.0.0


addListener(...)

addListener(eventName: 'onHeadwindMDMConnected', listenerFunc: OnHeadwindMDMConnectedListener) => Promise<PluginListenerHandle> & PluginListenerHandle

Called when the connection is established. In this method, you can retrieve your app settings from the server.

ParamType
eventName"onHeadwindMDMConnected"
listenerFunc(event: OnHeadwindMDMConnectedEvent) => void

Returns: any

Since: 1.0.0


addListener(...)

addListener(eventName: 'onHeadwindMDMDisconnected', listenerFunc: OnHeadwindMDMDisconnectedListener) => Promise<PluginListenerHandle> & PluginListenerHandle

Called when the connection is interrupted. This method doesn’t require any actions and it is usually followed by onHeadwindMDMConnected() within some seconds.

ParamType
eventName"onHeadwindMDMDisconnected"
listenerFunc(event: OnHeadwindMDMDisconnectedEvent) => void

Returns: any

Since: 1.0.0


addListener(...)

addListener(eventName: 'onHeadwindMDMConfigChanged', listenerFunc: OnHeadwindMDMConfigChangedListener) => Promise<PluginListenerHandle> & PluginListenerHandle

Called when the application settings were changed on the server. In this method, you need to refresh your application settings.

ParamType
eventName"onHeadwindMDMConfigChanged"
listenerFunc(event: OnHeadwindMDMConfigChangedEvent) => void

Returns: any

Since: 1.0.0


Interfaces

ConnectResult

PropType
connectedboolean

IsConnectedResult

PropType
isConnectedboolean

GetServerHostResult

PropType
serverHoststring

GetSecondaryServerHostResult

PropType
secondaryServerHoststring

GetServerPathResult

PropType
serverPathstring

GetServerUrlResult

PropType
serverUrlstring

GetSecondaryServerUrlResult

PropType
secondaryServerUrlstring

GetDeviceIdResult

PropType
deviceIdstring

GetCustomResult

PropType
customstring

GetResult

PropType
valuestring

SetResult

PropType
successfulboolean

PluginListenerHandle

PropType
remove() => any

Enums

ErrorLevel

MembersValue
ERROR1
WARN2
INFO3
DEBUG4
VERBOSE5