Add info about notifications to README

This commit is contained in:
Evgeny
2024-05-18 13:51:38 +04:00
parent 42473099eb
commit 430379546c
2 changed files with 56 additions and 2 deletions

View File

@@ -0,0 +1,35 @@
function on_resume()
ui:show_lines{
"Show notify",
"Update notify",
"Cancel notify",
}
end
function on_click(idx)
if idx == 1 then
system:show_notify{
message = "Just message",
silent = true,
action1 = "cancel",
}
elseif idx == 2 then
system:show_notify{
message = "Message updated",
silent = true,
action1 = "cancel",
action2 = "action #2",
action3 = "action #3",
}
else
system:cancel_notify()
end
end
function on_notify_action(idx, action)
ui:show_toast("action: "..idx..": "..action)
if action == "cancel" then
system:cancel_notify()
end
end