@paystory/capacitor-headwind-mdm
v1.0.2
Published
Capacitor wrapper for Headwind MDM
Maintainers
Readme
Capacitor Headwind MDM
Capacitor wrapper for Headwind MDM
Install
npm install @paystory/capacitor-headwind-mdm
npx cap syncExample
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() => anyConnect 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() => anyDisconnect from Headwind MDM
Returns: any
Since: 1.0.0
isConnected()
isConnected() => anyCheck the connection status. You can use the library functions if this method returns true.
Returns: any
Since: 1.0.0
getServerHost()
getServerHost() => anyGet the host name of Headwind MDM server
Returns: any
Since: 1.0.0
getSecondaryServerHost()
getSecondaryServerHost() => anyGet the secondary host name of Headwind MDM server
Returns: any
Since: 1.0.0
getServerPath()
getServerPath() => anyGet the path of Headwind MDM web panel
Returns: any
Since: 1.0.0
getServerUrl()
getServerUrl() => anyGet the URL of Headwind MDM server
Returns: any
Since: 1.0.0
getSecondaryServerUrl()
getSecondaryServerUrl() => anyGet the secondary URL of Headwind MDM server
Returns: any
Since: 1.0.0
getDeviceId()
getDeviceId() => anyGet the device ID (number)
Returns: any
Since: 1.0.0
getCustom(...)
getCustom(options: { number: number; }) => anyGet 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; }) => anySends 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; }) => anyThese 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; }) => anyThese 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; }) => anyThese 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; }) => anyThese 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; }) => anyThese 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; }) => anyGets 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; }) => anySets an attribute (not yet implemented)
| Param | Type |
| ------------- | --------------------------------------------- |
| options | { attr: string; value: string; } |
Returns: any
Since: 1.0.0
apply()
apply() => anyForces uploading the attributes to the server (not yet implemented)
Returns: any
Since: 1.0.0
addListener(...)
addListener(eventName: 'onHeadwindMDMConnected', listenerFunc: OnHeadwindMDMConnectedListener) => Promise<PluginListenerHandle> & PluginListenerHandleCalled 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> & PluginListenerHandleCalled 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> & PluginListenerHandleCalled 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 |
