It’s not the approach I’d take. You’d probably be better doing the notification in your sketch.
You also need to use a flag variable to ensure that only one notification is sent for each detection event. You should probably read this for more info…
Pete.