incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Randy McMillan (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-53) Bug when connect/disconnect while make ajax request (iOS)
Date Thu, 01 Mar 2012 18:23:58 GMT

    [ https://issues.apache.org/jira/browse/CB-53?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13220210#comment-13220210
] 

Randy McMillan commented on CB-53:
----------------------------------

Use 

if (navigator.onLine){} else {}

or

if (!navigator.onLine){} else {}

for the apps initial load. 

NOTE:

navigator.onLine will always be true in the simulator. 

Also:

If the type is unknown it is better to assume the app is offline.

if (navigator.network.connection.type == "unknown")
{
console.log('Assume app offLine');
onOffline(); //trigger onOffline event
}


function onOffline (){}


https://raw.github.com/RandyMcMillan/SenchaTouch/master/www/src/demos/myDemos/Accelerometer.js



                
> Bug when connect/disconnect while make ajax request (iOS)
> ---------------------------------------------------------
>
>                 Key: CB-53
>                 URL: https://issues.apache.org/jira/browse/CB-53
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: iOS
>            Reporter: Shazron Abdullah
>            Priority: Minor
>
> reported at: https://github.com/phonegap/phonegap-iphone/issues/331
> by: https://github.com/prsolucoes
> Hi,
> I post it on start project because the link to iphone on wiki is wrong, but now i found
it searching on github.
> The problem is my app is make an ajax call every 1 second on my server and if i start
the app without internet connect and connect on wifi/3g the application is killed (fatal error).
Other situation is when im on my app connected and making ajax pooling and the connection
(wifi or 3g) is dropped, the application is killed too (fatal error).
> So, if you are making ajax call and your connection change state (connected/disconnected)
your app get a fatal error and close. :(

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message