Capacitor wrapper for Headwind MDM
npm install @paystory/capacitor-headwind-mdm
npx cap sync
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();
connect()
disconnect()
isConnected()
getServerHost()
getSecondaryServerHost()
getServerPath()
getServerUrl()
getSecondaryServerUrl()
getDeviceId()
getCustom(...)
log(...)
v(...)
d(...)
i(...)
w(...)
e(...)
get(...)
set(...)
apply()
addListener(...)
addListener(...)
addListener(...)
- Interfaces
- Enums
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() => any
Disconnect from Headwind MDM
Returns: any
Since: 1.0.0
isConnected() => any
Check the connection status. You can use the library functions if this method returns true.
Returns: any
Since: 1.0.0
getServerHost() => any
Get the host name of Headwind MDM server
Returns: any
Since: 1.0.0
getSecondaryServerHost() => any
Get the secondary host name of Headwind MDM server
Returns: any
Since: 1.0.0
getServerPath() => any
Get the path of Headwind MDM web panel
Returns: any
Since: 1.0.0
getServerUrl() => any
Get the URL of Headwind MDM server
Returns: any
Since: 1.0.0
getSecondaryServerUrl() => any
Get the secondary URL of Headwind MDM server
Returns: any
Since: 1.0.0
getDeviceId() => any
Get the device ID (number)
Returns: any
Since: 1.0.0
getCustom(options: { number: number; }) => any
Get the custom variable defined on the server (number can be from 1 to 3)
Param | Type |
---|---|
options |
{ number: number; } |
Returns: any
Since: 1.0.0
log(options: { level: ErrorLevel; tag: string; message: string; }) => any
Sends a log message to the server
Param | Type |
---|---|
options |
{ level: ErrorLevel; tag: string; message: string; } |
Returns: any
Since: 1.0.0
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.
Param | Type |
---|---|
options |
{ tag: string; message: string; } |
Returns: any
Since: 1.0.0
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.
Param | Type |
---|---|
options |
{ tag: string; message: string; } |
Returns: any
Since: 1.0.0
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.
Param | Type |
---|---|
options |
{ tag: string; message: string; } |
Returns: any
Since: 1.0.0
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.
Param | Type |
---|---|
options |
{ tag: string; message: string; } |
Returns: any
Since: 1.0.0
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.
Param | Type |
---|---|
options |
{ tag: string; message: string; } |
Returns: any
Since: 1.0.0
get(options: { attr: string; defValue?: string; }) => any
Gets an attribute defined in “Application settings” tab of the configuration.
Param | Type |
---|---|
options |
{ attr: string; defValue?: string; } |
Returns: any
Since: 1.0.0
set(options: { attr: string; value: string; }) => any
Sets an attribute (not yet implemented)
Param | Type |
---|---|
options |
{ attr: string; value: string; } |
Returns: any
Since: 1.0.0
apply() => any
Forces uploading the attributes to the server (not yet implemented)
Returns: any
Since: 1.0.0
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.
Param | Type |
---|---|
eventName |
"onHeadwindMDMConnected" |
listenerFunc |
(event: OnHeadwindMDMConnectedEvent) => void |
Returns: any
Since: 1.0.0
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.
Param | Type |
---|---|
eventName |
"onHeadwindMDMDisconnected" |
listenerFunc |
(event: OnHeadwindMDMDisconnectedEvent) => void |
Returns: any
Since: 1.0.0
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.
Param | Type |
---|---|
eventName |
"onHeadwindMDMConfigChanged" |
listenerFunc |
(event: OnHeadwindMDMConfigChangedEvent) => void |
Returns: any
Since: 1.0.0
Prop | Type |
---|---|
connected |
boolean |
Prop | Type |
---|---|
isConnected |
boolean |
Prop | Type |
---|---|
serverHost |
string |
Prop | Type |
---|---|
secondaryServerHost |
string |
Prop | Type |
---|---|
serverPath |
string |
Prop | Type |
---|---|
serverUrl |
string |
Prop | Type |
---|---|
secondaryServerUrl |
string |
Prop | Type |
---|---|
deviceId |
string |
Prop | Type |
---|---|
custom |
string |
Prop | Type |
---|---|
value |
string |
Prop | Type |
---|---|
successful |
boolean |
Prop | Type |
---|---|
remove |
() => any |
Members | Value |
---|---|
ERROR |
1 |
WARN |
2 |
INFO |
3 |
DEBUG |
4 |
VERBOSE |
5 |