If you are building a native iOS application using any of our APIs that use CometD Long Polling then I would highly recommend some kind of middleware component that will manage the highly disconnected environment of mobile devices. Most cloud providers (AWS, Azure, GCP) offer some kind of store-and-forward message queue services that you could use to store events if/when the mobile apps gets disconnects so that those messages can be delivered when the device reconnects. An app can become disconnected when iOS puts the app to sleep in the background, if they get out of signal range, or if they go into low power mode. I would not recommend trying to workaround the iOS background sleep. For one, I don't think you'll find a good way to do it and even if you could if you keep the CometD long polling going for a long period of time that will keep the radio on in the phone and cause battery drain for the user.
You might also have to look at implementing push notifications to the iOS device if a message needs to be delivered but the app is not online. This way when the device comes back online the user can touch on the push notification that can deep link to the app which will wake the app up so that it can retrieve the messages from you middleware.
I know that sounds like a lot of work, but its a pretty standard mode of operation for messaging-based application on iOS and Android.
------------------------------
Jim Crespino
Senior Director, Developer Evangelism
Genesys
https://developer.genesys.com------------------------------
Original Message:
Sent: 06-24-2021 22:45
From: jeffrey darby
Subject: How to handle background polling iOS
Has anyone any advice on how to enable a background polling feature in iOS? We are using Consumer messaging api and finding that device level controls on iOS prevent us from implementing the long polling feature successfully. This is meaning that unless agents are routed an interaction within the message transport timeout period, the interactions are delivered as disconnected and there is no way to get back to the customer?
Thanks in advance.
#DigitalChannels
------------------------------
jeffrey darby
Vodafone Australia
------------------------------