Equivalent of background service for iOS

Viewed 921

I am currently porting an Android app to iOS but i can't seem to find a good equivalent for background service of Android to handle user requests. The Android app has a background service with an Socket.IO object and with sending BroadcastReceivers back and forth between UI and service i can handle requests as well (By replacing BroadcastReceivers with EventBus i could update UI with changes that were done during the time app was in background). Before iOS 10 voip calls was recommended for users for such tasks but then it was deprecated and pushKit came instead but it doesn't let app know about push notification. Anyway i am looking for a good architecture to give me these features if anyone has an opinion i would be more than happy to hear it.

  • It should be able to hold a single Socket object and keep it alive and accessible to UI elements in background without blocking UI.
  • Some socket events need to have Notification if the app is in background if it's in the foreground then request UI to make some changes. (If it could update UI in background when app is in background and present user with updated UI too that would be better)
  • Sending events between Socket object and UI to needs be easy and decoupled as possible because there are lots of events with different properties.
0 Answers
Related