2 Replies Latest reply on Mar 16, 2017 3:07 AM by sethup51656429

    how to run code in the background

    sethup51656429 Level 1

      hello,

      I'm developing an app that to keep ping to a php sever and any updation done in the DataBase it should reflect in the app also;

      I can not  ping and retrieve data when the user open the app;

      i need when the app come into  the foreground the change should reflect ; if the app in the background and any change made in the database , a pushnotification came and alert the change...

       

      more importantly ,, I need to get the change in the database even if the app is closed or in the background...is it possible to do it?

        • 1. Re: how to run code in the background
          kerrishotts Adobe Community Professional

          Question: why can't you sync the data when the user opens the app? Is there a technical issue that you need to resolve, or is this just something you want to avoid for some reason?

           

          Apple does have some degree of background processing, but it's limited, and you can't stray from the supported background modes, or you'll be rejected. Android doesn't have the same restrictions, but in both cases you need to be aware of the fact that you're going to be increasing the power needs of the device, which will mean faster battery depletion. Only perform background tasks if the user is aware of it AND if it is necessary.

           

          Finally, push notifications, while great, should not be relied upon for functionality. Make sure your app can work if push notifications aren't received in a timely fashion (or at all).

          • 2. Re: how to run code in the background
            sethup51656429 Level 1

            My purpose is ;

            When a customer enter some details (eg: name,phone no,etc..) with some images  to my application ,these data upload in to server,this can only achieve if the app is in online....

            But my real problem is ,

            if the app is in offline and customer add the above details ,it should be sent to server when the device/app comes to online.

            So can you please help me?