Genesys Multicloud

 View Only
Discussion Thread View
  • 1.  How to handle background polling iOS

    Posted 06-24-2021 22:46
    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
    ------------------------------


  • 2.  RE: How to handle background polling iOS

    GENESYS
    Posted 06-25-2021 08:08
    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
    ------------------------------



  • 3.  RE: How to handle background polling iOS

    Posted 07-06-2021 01:39

    Hi Jim, 

    Thanks for the response on this - sorry for the slow reply took me a while to find the post and come back to it. 

    Your response is as I feared, and a large piece of work to acheive, but logically makes sense as the best way to perform this function. Based on what you've said, best practise is that the middleware component would continue the polling the nexus interaciton server, keeping the interaction "live" until routed to an agent, and it would store the messages in a queue for retrieval when the client device is seen again?

    Thanks, 

    Jeff



    ------------------------------
    Jeffrey Darby
    TPG Telecom, Australia
    ------------------------------



  • 4.  RE: How to handle background polling iOS

    GENESYS
    Posted 07-06-2021 10:50
    Hi Jeff,

    Yes, most cloud services today probably make this easier than it sounds.  If I take AWS as an example I think you could create some stateless lambdas to facilitate send and receive operations.  And you could use AWS Event Bridge as the message queueing service.  For each new iOS client you could create an Event Bridge session to hold messages.  The lambdas would then push or pull messages from Event Bridge and Genesys.  Event Bridge supports a store and forward mechanism so if the client isn't connected then it will hold messages for a period of time until the client connects.  You can even use device push notifications if the client is unavailable to notify them that messages are waiting and would deep link to the app to wake it up to retrieve those messages.

    Hope that helps.

    ------------------------------
    Jim Crespino
    Senior Director, Developer Evangelism
    Genesys
    https://developer.genesys.com
    ------------------------------



Need Help finding something?

Check out the Genesys Knowledge Network - your all-in-one access point for Genesys resources