I'm developing an App that communicates with a local Web Server and receives data from it (though WebSockets or HTTP) without using internet connection.
So I need to find a way to receive push notifications from the server without using Apple Push Notifications service even with the iPhone in standby so the notifications show up on Apple Watch. For example my idea is to send data from the server to the iPhone client and then creating the notification locally. In order to do so I need to run my app in Background but the modes I found couldn't help me.
-Run an arbitrary piece of code: i can run the app for maximum 3 minutes in background after pressing Home for example. I need to have the app executing in background "forever" if possible in order to receive data from the server and process it.
-Background fetch: this mode isn't reliable because i cannot control when my code is being executed but it's iOS that decides based on the user's behavior and other conditions.
I read about Silent Push Notifications, VOIP (PushKit) but i didn't understand if you need APNs to make them work.
Also does this article describe Silent Push Notifications? https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/pushing_background_updates_to_your_app#see-also
If yes, then I cannot use Silent Push Notifications more than 2/3 times per hour, plus it's considered low-priority, not reliable...
Here it says that from iOS13 i cannot use VOIP mode anymore for non VOIP Apps: Can I use PushKit to do regular push with out using VoIP? Will it allow killed app to be launched in background if user does not act on notification?
Are there some ways to bypass APNs if you can't access the Internet and wake up an app in background based on an event?
Thanks :)