mirror of
https://repository.entgra.net/community/device-mgt-plugins.git
synced 2025-09-16 23:42:15 +00:00
fixes wso2/product-iots/#1266
This commit is contained in:
parent
28a3b25c5b
commit
b035321def
@ -73,9 +73,9 @@ $(window).load(function () {
|
||||
connect(websocketUrl)
|
||||
});
|
||||
|
||||
$(window).unload(function () {
|
||||
window.onbeforeunload = function() {
|
||||
disconnect();
|
||||
});
|
||||
};
|
||||
|
||||
//websocket connection
|
||||
function connect(target) {
|
||||
|
||||
@ -73,13 +73,13 @@ public class EventReceiverServiceImpl implements EventReceiverService {
|
||||
String eventPayload = eventBeanWrapper.getPayload();
|
||||
JsonObject jsonObject = gson.fromJson(eventPayload, JsonObject.class);
|
||||
Object payload[] = {
|
||||
jsonObject.get(TIME_STAMP),
|
||||
jsonObject.get(LONGITUDE),
|
||||
jsonObject.get(LATITUDE)
|
||||
jsonObject.get(TIME_STAMP).getAsLong(),
|
||||
jsonObject.get(LONGITUDE).getAsDouble(),
|
||||
jsonObject.get(LATITUDE).getAsDouble()
|
||||
};
|
||||
try {
|
||||
if (AndroidAPIUtils.getEventPublisherService().publishEvent(
|
||||
EVENT_STREAM_DEFINITION, "1.0.0", new Object[0], new Object[0], payload)) {
|
||||
EVENT_STREAM_DEFINITION, "1.0.0", metaData, new Object[0], payload)) {
|
||||
message.setResponseCode("Event is published successfully.");
|
||||
return Response.status(Response.Status.CREATED).entity(message).build();
|
||||
} else {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user