Runs on (chain ) with test GNOT only. Get test GNOT →

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.

  1. Step 1 of 2

    Turn on notifications

    The address you will send the message from.

    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

    See the code
    js · your page
    import { 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 }]);
    });
  2. Step 2 of 2

    Send yourself a message

    notification · this browser

    sh · gnokey

    Run it with the key of the address in step 1. The notification goes to whoever sends.

    See the code
    gno · the echo realm
    func 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)
    }