Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support pane.created event POC #211

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,7 @@ export default class Client {
this._idleState.addObserver(debounce(() => {
this.postMessage('session.live')
}, 1000))
this.postMessage('client.app.registered');
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

send postMessage to ZAF when sdk received app.registered event from zaf

}, this)

this.on('context.updated', (context) => {
Expand All @@ -370,6 +371,7 @@ export default class Client {
tracker.setup()
window.addEventListener('message', messageHandler.bind(null, this))
this.postMessage('iframe.handshake', { version: pkgJson.version })
console.log('** zaf_sdk: app hand shake **');
}

/**
Expand Down Expand Up @@ -434,6 +436,7 @@ export default class Client {
this._messageHandlers[name].push(handler)

if (name !== 'app.registered') {
console.log('** sdk iframe.on:', name);
// Subscriber count is needed as the framework will only bind events on the first attached handler
this.postMessage('iframe.on:' + name, { subscriberCount: this._messageHandlers[name].length })
}
Expand Down
8 changes: 3 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading