I’m developing a iOS VPN app, and I need to execute a task in the main app even when it’s in the background or killed state. I know the Network Extension continues running during those times. Is there a way for the extension to immediately notify the app or trigger a task on the app side?
How can a Network Extension notify or trigger tasks in the main app when it’s backgrounded or killed?
It is not possible for an extension to communicate with it's parent app if it is not active at that time.
Whether it is suspended in the background, or terminated, it is not possible to trigger the main app.
What you could do is add the code for the tasks to your extension (as long as it is possible to do so within the extensions memory and time limits, and certain functional limitations the extension might have), and then share the results in a shared container, and have the main app check this container the next time it is launched.