Skip to content

Maestro Panel - Hello World !#2

Open
bruno-albino wants to merge 8 commits intomainfrom
Hello-World
Open

Maestro Panel - Hello World !#2
bruno-albino wants to merge 8 commits intomainfrom
Hello-World

Conversation

@bruno-albino
Copy link
Copy Markdown
Contributor

No description provided.

unmountFunction.current = await SDK.renderPanel("panel-section");

if (eventViewModel.current) {
await eventViewModel.current.didShowPanel();
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Callback to the SDK so we know the panel was shown


const showPanel = async () => {
setPanelVisible(true);
unmountFunction.current = await SDK.renderPanel("panel-section");
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Unmount function to be used as cleanup function afterwards

Comment on lines +35 to +37
SDK.configure({
siteID: "69388ee52b46b639897261f1",
});
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

initialize SDK as first thing

Comment on lines +56 to +58
await SDK.userDidStopWatchingEvent({
pageId: "69388ee52b46b63989726228",
});
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Call userDidStopWatchingEvent when you want to quit the current event watch

Comment on lines +38 to +40
SDK.configure({
siteID: SITE_ID,
});
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

initialize SDK as first thing

Comment on lines +59 to +68
await SDK.userDidStopWatchingEvent({
pageId: PAGE_ID,
});
} else {
setVideoVisible(true);
eventViewModel.current = await SDK.userDidStartWatchingEvent({
pageId: PAGE_ID,
delegate,
useProdEnv: false,
});
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Call userDidStopWatchingEvent to stop the current event watch, and userDidStartWatchingEvent to start a new one

Use useProdEnv = false for dev mode

const delegate = new AppDelegate();

const PAGE_ID = "69388ee52b46b63989726228";
const SITE_ID = "69388ee52b46b639897261f1";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This siteId and pageId combination is configured to deliver the hello world panel.

Once completed and ready to move forward with custom panel delivery these ID's will be replaced with ones specific to your site and it's pages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants