Listen to native events in background

I built a music player app that plays Spotify and Apple Music. My issue is that when I play apple music songs it plays directly through Apple Music, so my app is not put in background mode. I want to be able to listen to events, so if someone clicks skip on the apple music notification, I want my app to run a function. Right now when I do this nothing happens because my app is not put into the background. I don’t know how to listen to these events without being flagged by apple for misusing background mode.

Let me know if you have any questions, or need more information. Thanks!

Does anyone have any ideas on this?