How can I make my app send out notifications when it's loaded but not running in the foreground?

asked6 years ago
last updated6 years ago
viewed5.3k times
Up Vote13Down Vote

I have an app that I use sometimes. I must have left it there in the background before I slept. When I woke up I saw this notification on my screen.

Does anyone have any suggestions on how I can make a notification like this appear with my application?

Also, do these notifications appear on also? I've never seen them on my phone but that could be because I use it much less.