The Push Module is used to receive data over an HTTP connection.
|push (Module) <META> Syntax|
<META HTTP-Equiv="Push" content="[Parameter]">
<META HTTP-Equiv="Push" content="[Parameter:Attribute]">
<META HTTP-Equiv="Push" contents="detected:url('[jsFunction | url]')">
e.g. push.port = 'value';
e.g. push.detected = 'doFunction(%json)';
To set multiple EMML parameters / events on a single line use the following syntax: push.setEMML("[Your EMML Tags]");
Items listed in this section indicate methods or, in some cases, indicate parameters which will be retrieved.
|start||Starts the server. Must be after the <port> tag.||N/A|
|stop||Stops the server.||N/A|
Items listed in this section indicate parameters, or attributes which can be set.
|Name||Possible Values||Description||Default Value|
|port:[Value]||0 - 65535 in Windows and 1025 - 65535 in Android||Port number to listen on.||8081|
|passKey:[Value]||Any string||If specified then the client must include passkey=value in the passed parameters. Case sensitive.||Empty (no passkey required)|
|response:[Value]||Filename||Name of the HTML file to return to the client after a successful request.||Empty (a short default HTML response is sent)|
|path:[Value]||Virtual path||The client must include this in the HTTP request (after the address and before the parameters). The forward slash '/' should be used as the directory delimiter.||Empty (any path is accepted)|
|unattended:[Value]||enabled or disabled||Enables or disables unattended mode - see Remarks for details.||disabled|
|1||Whatever is defined as 'name' in each name=value pair in the HTTP request.||One value is returned for each name=value pair in the HTTP request, you access this in JSON using the names you provided in the request. An example is provided in the examples section below.|
The push server accepts both GET and POST requests. For GET requests the parameters and values are specified in the URL, while for POST requests the request body should hold the parameters and values in url encoded form. The virtual path in the URL must be as specified by the <path> tag, or can be anything if the tag isn't present. The parameters must include 'passkey' with the correct value if the <passkey> tag is present.
When a valid request is received the specified destination URL is called with one '%s' per parameter/value pair in the request. Only the values are returned; the parameter names are discarded. The 'passkey' parameter and value are ignored if present. Parameter names are only applicable if you are accessing your return values via JSON.
Only alphanumeric characters and the characters $-_.!*'(), are allowed in a URL (see RFC 1738). Any other characters will cause undefined behaviour. Ensure that the passkey uses only valid characters.
Normally when a device enters suspend mode, either because it has been idle for a certain time or because the power key was pressed, all the device subsystems are switched off, including the wireless network. When unattended mode is enabled however the device keeps enough subsystems powered that applications continue to run, and it can still respond to Push requests. Note that unattended mode uses significantly more battery power.
In version 2.2 of RhoElements for WM / CE the default push port was changed from '80' to '8081' to match RhoElements for Android. Applications developed for RhoElements 2.1 and previous which rely on the default port number being 80 should add the default meta tag <MetaTag VALUE="Push~port:80"> to their configuration.
|RhoElements Version||1.0.0 or above|
|Supported Devices||All supported devices|
|Persistence||Persistent - Changes to this module will persist when navigating to a new page.|
To enable unattended mode:
<META HTTP-Equiv="push" Content="unattended:enable">