How to support background mode while iPhone is communicating with a device which is connected via wifi

Hi,


I have an app which needs to connect with a external device via wifi (External device is working as Access point).

Once connected to device it besically streaming data and notify events using GRPC.

Now i need to support background mode so that iPhone should able to listen all the events in background also.


Thanks

Joy

Replies

For connecting to your accessory I would look at using the NetworkExtension API NEHotspotConfiguration. Once you are connected you can use a NWConnection to run RPC over TCP or UDP. In regards to performing this functionality in the background, my first recommendation would be to investigate using BGTaskScheduler to see if this meets your background needs.



Matt Eaton

DTS Engineering, CoreOS

meaton3 at apple.com

Hi Meaton,


Thanks for your response. I will try to check BGTaskScheduler but Is there anything i can do to achieve this functionality in iOS 12 ?



Thanks

Joy