0 Replies Latest reply on Aug 10, 2012 9:14 AM by jxyiliu@yahoo.ca

    how to continue scheduled sync even when application in sleep mode

    jxyiliu@yahoo.ca Level 1

      Hi All,

       

      How can we make sure our application will continue to be active even in sleep mode?

       

      I am assigned a feature for our iOS Mobile application that can periodically update user's current geolocation onto remote database.

       

      It works fine when the mobile devices are in activate mode. The timer expire event fired -> grab newest geolocation -> send to database.

       

      However, it did not work at all when devices went into sleep mode. Depending on when/where the devices went to sleep, the code stopped at different points. Like, The timer expire event never fired. The synch with database stops in the middle. The sniffer gps events never return. etc.

       

      I tried to use NativeApplication.nativeApplication.executeInBackground = true as mentioned in (http://forums.adobe.com/message/4386837). However, my flashbuilder compliented can not find this executeInBackground property. (my flash builder is 4.6, air application is 3.1). I tried with -swf-version=16 and with air application set as 3.3 and did not help.

       

      First question: will executeInBackground be the right solution for solving my problem? From document, it sounds like the continue executation is not garanteed.

       

      Second question: For executeInBackground issue, How can I pass the runtime error.

       

      Third question: Is there any better way to implement this type of activities?

       

      Thanks in advance,