feat: implement android notification cancellation

This commit is contained in:
2020-06-20 10:17:40 -04:00
parent 4c377a2f20
commit 6449040e61
3 changed files with 42 additions and 3 deletions
+5
View File
@@ -7,6 +7,7 @@ package main
import (
"image/color"
"log"
"time"
"gioui.org/app"
"gioui.org/io/system"
@@ -62,6 +63,10 @@ func loop(w *app.Window) error {
log.Printf("notification send failed: %v", err)
}
log.Println(notif)
time.Sleep(time.Second * 10)
if err := notif.Cancel(); err != nil {
log.Printf("failed cancelling: %v", err)
}
}()
}
}