IOS App crash when switching app (multitasking)

98 views
Skip to first unread message

Yann Ferréol

unread,
Aug 12, 2011, 3:26:31 AM8/12/11
to phon...@googlegroups.com
Hi all,

I'm upgrading my app from phonegap 0.9.3 to phonegap 1.0.0 on IOS. I changed the code to use the connection API to check the internet connection. My problem is with the multitasking. Here is the steps I do to make it crash:

1- Test the connection (call the function using the connection api)
2- Go to the device settings to switch on/off the wifi (I'm testing with an iPad)
3- Go back to the app
4- The app crash.

Note that if I do the same, but without changing the internet connection status, the app don't crash.

Here is what Xcode 4 debugger show me:

2011-08-12 09:05:13.560 mhn-iphone[2569:707] Device initialization: DeviceInfo = {"name":"iPad de Yann Ferréol","uuid":"b55ea1fd437c79e790d004919d233e65591a529d","platform":"iPad","gap":"1.0.0","version":"4.3.3","connection":{"type":"wifi"}};

[Switching to process 13827 thread 0x0]

[Switching to process 12035 thread 0x0]

warning: UUID mismatch detected with the loaded library - on disk is:

/xcode4/Platforms/iPhoneOS.platform/DeviceSupport/4.3.3 (8J3)/Symbols/Developer/usr/lib/libXcodeDebuggerSupport.dylib

And it show me a message in the main.m file : " Thread 1: Program received signal: "SYGSYS" " on the line : int retVal = UIApplicationMain(argc, argv, nil, @"AppDelegate");

The thread 1 stack contain:
0 reachable callback
10 main

Here is the code I'm using:

function loadNews(){

    $('#news').load('src/html/' + LANG + '/main/news.html');

    $('#newsDetail').load('src/html/' + LANG + '/main/newsDetail.html');

    

    var networkState = navigator.network.connection.type;

    

    if(networkState != Connection.NONE && networkState != Connection.UNKNOWN){

        //Connexion OK

        doLoadNews();

    }else{

        //Pas de connexion

        noConnectionError();

    }

    

    $('#home').load('src/html/' + LANG + '/main/accueil.html', "", ajaxError);

jQT.goTo('#home', 'slide');

} 

So what is the problem? How can I resolve this?

Thanks in advance,

Yann Ferréol

philipp

unread,
Aug 12, 2011, 3:35:20 AM8/12/11
to phonegap
Yann, check this thread on Github (there's also a workaround if you
can avoid using the connection API):
https://github.com/phonegap/phonegap-iphone/issues/213

On Aug 12, 9:26 am, Yann Ferréol <yann.ferr...@gmail.com> wrote:
> Hi all,
>
> I'm upgrading my app from phonegap 0.9.3 to phonegap 1.0.0 on IOS. I changed
> the code to use the connection API to check the internet connection. My
> problem is with the multitasking. Here is the steps I do to make it crash:
>
> 1- Test the connection (call the function using the connection api)
> 2- Go to the device settings to switch on/off the wifi (I'm testing with an
> iPad)
> 3- Go back to the app
> 4- The app crash.
>
> Note that if I do the same, but without changing the internet connection
> status, the app don't crash.
>
> Here is what Xcode 4 debugger show me:
>
> *2011-08-12 09:05:13.560 mhn-iphone[2569:707] Device initialization:
> DeviceInfo = {"name":"iPad de Yann
> Ferréol","uuid":"b55ea1fd437c79e790d004919d233e65591a529d","platform":"iPad ","gap":"1.0.0","version":"4.3.3","connection":{"type":"wifi"}};
> *

Yann Ferréol

unread,
Aug 12, 2011, 4:47:06 AM8/12/11
to phon...@googlegroups.com
Thanks for the answer.

Unfortunately, for instance I need this capability because I'm loading a RSS Feed in my app, and, thanks to Apple, I need to check the internet connection. I also tried to modify the Reachability.m in PhonegapLib following this modifications: https://github.com/phonegap/phonegap-iphone/commit/a47d8121c118509149edc50dcebbd77758160a7b
But it doesn't work... So what can I do?

Yann Ferréol

Tue Topholm

unread,
Aug 12, 2011, 7:45:56 AM8/12/11
to phon...@googlegroups.com
I quick workaround for me was, to make a
$.get(url,function(){}).error(function(){}) if you are using jquery...

--

Med venlig hilsen / Kind regards

Tue Topholm
Sugee
Tlf: +45 32 13 32 32
W: http://www.sugee.dk

2011/8/12 Yann Ferréol <yann.f...@gmail.com>:

> --
> You received this message because you are subscribed to the Google
> Groups "phonegap" group.
> To post to this group, send email to phon...@googlegroups.com
> To unsubscribe from this group, send email to
> phonegap+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/phonegap?hl=en?hl=en
>
> For more info on PhoneGap or to download the code go to www.phonegap.com
>

Reply all
Reply to author
Forward
0 new messages