App just in Notifications visible sending remote media button keystrokes

I would like to create an app that is only visible in the notification bar after start, and sends a Romote Keystrong "play" ('to play with any open media player) when a charger is plugged in, and sends a remote Keystrong "pause" when the charger is unplugged. Is this somehow possible?
I know that Taifuns Battery Manager Extension can give the charging status, but how can I implement this notification thing and how can I send remote keystrokes?



I found some more Extensions for this project. So now I can Autoplay/Pause on plugin the power plug. But also I tried this Notification Style Extension adding a Notification, this is not working, when my app isn't in foreground or display is off. Any idea how to solve this? I found this, but I cannot find out how it works: [FREE] Background Tasks: Itoo also the example contains puzzle parts that doesn't exist in the downloadable extension.
AutoPlayOnPower.aia (58.5 KB)

Try a foreground service

Read the complete thread and try the several examples you can find there to learn how to work with the extension

Then try to put some blocks together using the extension for your task

And if you got stuck, then ask in the itoo thread and provide a screenshot of what you tried there


Okay, I tried a lot of hours now, but I think there is no possibility to realize this. What ever I do, when I switch the screen off or change to the music player the ScMusicPlayerControl_V2.aix will not work anymore. So I decided to say the user to come back to my app after open a media player that supports external control and leaf screen on. This is not the best solution, but it works.