Get started
Accounts
Apps
Users
Relationships
Dialogs (Messages)
Tracks (MuseBase)
Photos
Posts
Comments
Safety
Other
Yurba CDN (cdn.yurba.one)
For Desktop Developers
Allows you to create in-app notifications with custom buttons
app.alert({
"title": (Optional) string Title,
"content": (Optional) string HtmlContent,
"buttons": (Optional) array Buttons,
"timeout": (Optional) int Timeout
},
(title, content, modal, app) => {
return {
/// your buttons functions there...
};
}
)
Notifications can have a title, content (which can be HTML), timed auto-close, and buttons. There is one default button - “Close”, which will be there regardless of whether you have buttons or not. Here is an example of how you can create a notification that greets the user and prompts them to go to the documentation using buttons:
app.alert({
"title": "Hello there!",
"content": "Welcome! Before you close this notice - check out the documentation",
"buttons": [
{
"text": "Documentation",
"signal": "openDocs"
}
]
},
(title, content, modal, app) => {
return {
openDocs: () => { modal.hide(); app.browse("https://docs.yurba.one/") }
};
}
)
As you can see, the buttons array contains an object with two components inside: text and signal. The first one is responsible for the text on the button (without HTML support), and the second one binds a function to the button. Functions are created as the second argument inside a method, and in the same way title (Current title), content (Current content), modal (Notification body) and app are used to create functions