Online Status
getOnlineStatus
var request = { "type" : "getOnlineStatus", "data" : { } // empty object- this is required in the current API }; bridge.sendRequest(request, function (results) { console.log('Javascript got its response: ' + str(results)); if (results.type === "getOnlineStatusResponse") { var isOnline = results.data; "TRUE" or "FALSE" // do something with the information } else if (results.type == 'error') { errStr = results.data; alert('A problem occurred:\n' + errStr); } });
setOnlineStatus
var request = { "type" : "setOnlineStatus", "data" : "FALSE" }; bridge.sendRequest(request, function (results) { console.log('Javascript got its response: ' + str(results)); if (results.type === "setOnlineStatusResponse") { var isOnline = results.data; "TRUE" or "FALSE" // do something with the information } else if (results.type == 'error') { errStr = results.data; alert('A problem occurred:\n' + errStr); } });