Send yourself a notification.
Turn on notifications for your gno.land address, then call the echo realm with a message. It comes back to this browser as a push notification, even with the tab closed.
-
Step 1 of 2
Turn on notifications
Adena ·The address you will send the message from. With Adena, connect it to fill this in: Get Adena ↗
Notifications are on for this address. Turn them off to change it.
Checking…
Keeps a connection to the gnotif server open while this page is open, and sends it your address. Messages then show here as they arrive, with no permission prompt.
Live updates off
Arrived live
Nothing has arrived yet.
See the code
js · your pageimport { Gnotif } from "gnotif"; const gnotif = new Gnotif({ network: "onyx", icon: "/icon.png" }); const [echo] = await gnotif.triggers(""); button.addEventListener("click", async () => { await gnotif.enable(); await gnotif.setOptins([{ trigger: echo.id, value: address }]); }); -
Step 2 of 2
Send yourself a message
notification · this browserEcho · a few seconds after the callsh · gnokeyRun it with the key of the address in step 1. The notification goes to whoever sends.
See the code
gno · the echo realmfunc init(cur realm) { gnotif.Declare(cross(cur), cur.PkgPath(), "Echo", "", "to", "Echo", "{msg}", "/") } func Echo(cur realm, msg string) { chain.Emit("Echo", "to", cur.Previous().Address().String(), "msg", msg) }