I have a swift music app that plays content from streaming providers on speakers.
The main app makes all the network calls and takes advantage of background audio to enable lock screen control.
I now have a Today Extension, I have setup app groups and use userdefaults to share metadata. I currently run urlsessions within the extension code to activate play/pause/skip/volume,etc... but this will not update the background audio or lock screen controls. It also seems inefficient.
Is there a way to run a function in my main app by pressing a button on the widget?
Thanks, Paul
Please checkout this link it will help you
Perform action in host app from Today extension(Widget) Without opening app ios