eMOBIQ Service Manager is a tool that helps you to create and manage eMOBIQ services.
With this tool you can:
1. Manage eMOBIQ Plugin
- Create your own functions, components and 3rd party plugins to be used or consumed by the eMOBIQ platform.
Note: As of now eMOBIQ Plugin only supports cordova client project platform. We'll be supporting react-native in the near future.
To develop a package you need to have setup and configure your development environment.
To access eMOBIQ Service Manager, you need to have an account on eMOBIQ Service Manager.
To manage your packages in eMOBIQ Service Manager, you need an eMOBIQ Service Manager account. This simple guide explains how to request for an eMOBIQ Service Manager account.
The guide below helps you to create a new package once you have your account.
[
// Sample code for function
{
// function | component
"type": "function",
"name": "myFunction",
"parameters": [
{
"name": "value",
// string | integer | number | boolean | functionList
"type": "string"
},
{
"name": "callback",
// string | integer | number | boolean | functionList
"type": "functionList"
}
]
},
// Sample code for component
{
"type": "component",
"name": "MyLabel",
"attributes": {
"value": {
"default": {
"width": "50%"
}
},
"custom": [
{
"name": "name",
"title": "Name",
// string
"type": "string"
}
]
},
// Default: click, scrollBottom, scrollTop, onScroll,
// press, longPress, sortRelease.
// Custom: user can define whatever event they want, but they need to enable the logic for it, see tap example.
"events": [
"tap"
]
}
]
// Function
// The "function myFunction(...)" is the created function in the editor.
function myFunction(parameters) {
// Do a hello world to the value passed
let welcome = "Hello, " + parameters.value + "!";
// cordova-plugin-dialogs
// The "navigator.notification.alert" is an implementation of a plugin function.
navigator.notification.alert(
welcome, // message
function(){}, // callback
'Welcome', // title
'Okay' // buttonName
);
// Helper function to access component through id or name.
// @param {string} identifier - the component id or name,
// it will prioritize id before name.
let component = pluginGetComponent("componentName");
// Helper function to trigger callback function.
// @param {object} element - main object/caller (make sure this is from the root caller)
// @param {functionList} functionList - the callback to be triggered
// @param {object} parameters - the additonal data that are passed through the callback
// @param {any} parameters.input - the data to be passed to input field
// @param {any} parameters.extra - the data to be passed to extra field
let self = this;
pluginCallback(self, parameters.callback, {input: welcome});
return welcome;
}
// Component
// The "MyLabel" is the created component in the editor.
let MyLabel = {
// The "createElement" function lets user define how the component is going to be created.
createElement: function() {
var element = document.createElement("label");
element.innerHTML = 'My Label - Plugin';
let self = this;
element.onclick = function() {
// Helper function to attach event based action.
// @param {object} element - main object/caller
// @param {string} eventName - the component event name, only works if it is defined
// @param {object} parameters - the additonal data that are passed through the callback
// @param {any} parameters.input - the data to be passed to input field
// @param {any} parameters.extra - the data to be passed to extra field
pluginEvent(self, "tap", {
input: "Plugin"
});
};
return element;
}
};
[
{
"name": "cordova-plugin-dialogs"
}
]
If you’ve successfully created a new package in eMOBIQ Service Manager you can now use it in your eMOBIQ Platform project.
Copyright © Orangekloud Pte. Ltd. All rights reserved.