Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
34 lines (30 loc) · 1.56 KB

File metadata and controls

34 lines (30 loc) · 1.56 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<!DOCTYPE html>
<html>
<head>
<title>Example for Pub/Sub with OpenFin API</title>
<script type="text/javascript" language="javascript">
function init() {
fin.desktop.main(function () {
document.getElementById("status").innerHTML = "Connected to OpenFin Runtime";
var listener = function(payload, sourceUuid) {
document.getElementById("status").innerHTML = "Received message " + JSON.stringify(payload);
fin.desktop.InterApplicationBus.publish('unit-test', { response: payload.text + " received" });
fin.desktop.InterApplicationBus.unsubscribe('*', 'unit-test', listener);
};
fin.desktop.InterApplicationBus.subscribe('*', 'unit-test', listener);
fin.desktop.InterApplicationBus.subscribe('*', 'private-channel', function(payload, sourceUuid) {
document.getElementById("status").innerHTML = "Received message " + JSON.stringify(payload);
// call send to target one particular App with uuid
fin.desktop.InterApplicationBus.send(sourceUuid, 'private-channel', { response: payload.text + " received" });
});
// init is done. broadcast check-in message
fin.desktop.InterApplicationBus.publish('check-in', {name: 'Pub/Sub example app'});
});
}
</script>
</head>
<body onload='init();' >
<div>Example OpenFin app to test publish and susbcribe API calls</div>
<div id="status"></div>
</body>
</html>
Morty Proxy This is a proxified and sanitized view of the page, visit original site.