@paystory/capacitor-headwind-mdm
v1.0.2
Published
Capacitor wrapper for Headwind MDM
Downloads
1
Maintainers
Readme
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()
disconnect()
isConnected()
getServerHost()
getSecondaryServerHost()
getServerPath()
getServerUrl()
getSecondaryServerUrl()
getDeviceId()
getCustom(...)
log(...)
v(...)
d(...)
i(...)
w(...)
e(...)
get(...)
set(...)
apply()
addListener(...)
addListener(...)
addListener(...)
- Interfaces
- Enums
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)
| Param | Type |
| ------------- | -------------------------------- |
| 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
| Param | Type |
| ------------- | ------------------------------------------------------------------------------------------- |
| 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.
| Param | Type |
| ------------- | ---------------------------------------------- |
| 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.
| Param | Type |
| ------------- | ---------------------------------------------- |
| 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.
| Param | Type |
| ------------- | ---------------------------------------------- |
| 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.
| Param | Type |
| ------------- | ---------------------------------------------- |
| 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.
| Param | Type |
| ------------- | ---------------------------------------------- |
| 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.
| Param | Type |
| ------------- | ------------------------------------------------- |
| 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)
| Param | Type |
| ------------- | --------------------------------------------- |
| 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.
| Param | Type |
| ------------------ | ------------------------------------------------------------ |
| 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.
| Param | Type |
| ------------------ | --------------------------------------------------------------- |
| 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.
| Param | Type |
| ------------------ | ---------------------------------------------------------------- |
| eventName
| "onHeadwindMDMConfigChanged" |
| listenerFunc
| (event: OnHeadwindMDMConfigChangedEvent) => void |
Returns: any
Since: 1.0.0
Interfaces
ConnectResult
| Prop | Type |
| --------------- | -------------------- |
| connected
| boolean |
IsConnectedResult
| Prop | Type |
| ----------------- | -------------------- |
| isConnected
| boolean |
GetServerHostResult
| Prop | Type |
| ---------------- | ------------------- |
| serverHost
| string |
GetSecondaryServerHostResult
| Prop | Type |
| ------------------------- | ------------------- |
| secondaryServerHost
| string |
GetServerPathResult
| Prop | Type |
| ---------------- | ------------------- |
| serverPath
| string |
GetServerUrlResult
| Prop | Type |
| --------------- | ------------------- |
| serverUrl
| string |
GetSecondaryServerUrlResult
| Prop | Type |
| ------------------------ | ------------------- |
| secondaryServerUrl
| string |
GetDeviceIdResult
| Prop | Type |
| -------------- | ------------------- |
| deviceId
| string |
GetCustomResult
| Prop | Type |
| ------------ | ------------------- |
| custom
| string |
GetResult
| Prop | Type |
| ----------- | ------------------- |
| value
| string |
SetResult
| Prop | Type |
| ---------------- | -------------------- |
| successful
| boolean |
PluginListenerHandle
| Prop | Type |
| ------------ | ------------------------- |
| remove
| () => any |
Enums
ErrorLevel
| Members | Value |
| ------------- | -------------- |
| ERROR
| 1 |
| WARN
| 2 |
| INFO
| 3 |
| DEBUG
| 4 |
| VERBOSE
| 5 |