facebook

Mobione Cordova 2.2: InAppBrowser Crash (Replicatable)

  1. MobiOne Archive
  2.  > 
  3. Feedback & Suggestions
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #342150 Reply

    Unknown Author
    Participant

    Mobione Cordova 2.2 is susceptible to this InAppBrowser crash issue:

    https://issues.apache.org/jira/browse/CB-4147

    To replicate it. Go into the RSS example, but change the viewArticle() function to the following. It uses Google Feed response format.

    
    function viewArticle(idx) {
        curArticleIdx = idx;
        phoneui.showURL(theresult.responseData.feed.entries[curArticleIdx].link, '_child', {showLocationBar: true, showAddress: true, patchWindowClose: true, showNavigationBar: true,});
    }
    

    If one clicks directly, the app crashes. If, however, you move the list up or down, and then click, everything loads just fine. I have a video if anyone’s interested.

    -1TC

    #342158 Reply

    support-michael
    Keymaster

    >I have a video if anyone’s interested.

    Yes, please share.

    #342195 Reply

    Unknown Author
    Participant
    #342196 Reply

    Unknown Author
    Participant

    Here’s the video.

    http://www.drruss.net/Mobione/

    In the video, when the app crashes, the list item has been clicked on. When the app does not crash, the list has been moved up and down first, then clicked on. Using an iPhone 4S with the latest iOS 6 version. App compiled with Mobione Cordova 2.2 because I need the child browser. This crash does not happen under 2.9. However, I don’t have access to the child browser under 2.9, either. Ultimate solution: Child browser support under 2.9.

    When the project is run in Test Center and the link is clicked, Test Center will attempt to open an external link 3 times. However, if the list has been moved up and down, it will attempt to open an external link only 2 times.

    -1TC

    #342203 Reply

    support-michael
    Keymaster

    Thanks for the video and detailed explanation. This is very helpful. Will work on replicating the issue locally for dev team to address.

    >This crash does not happen under 2.9. However, I don’t have access to the child browser under 2.9, either. Ultimate solution: Child browser support under 2.9.

    In Cordova 2.9 the InAppBrowser provides the implementation for the phoneui.showUrl() function. A couple of thoughts for quick workaround:
    1) (disclaimer: I don’t know that this will work) try running your showUrl() call in a setTimeout() with a very short delay of 50-100 ms

    2) or you can try the InAppBrowser api, window.open(url, ‘_blank’, options)

    We are working on moving to cordova3 as soon as possible which will no longer provide the childbrowser (it is major jacked across platforms, especially android)

    #342207 Reply

    Unknown Author
    Participant

    Thanks.

    The first suggestion I’ve tried and it didn’t stop the crashing under 2.2.

    The second suggestion opens a new browser instance. Is it supposed to do that? I’d like to keep folks in the app itself if I could. My one major quam with 2.9 is that the in-app browser started zoomed in on one corner of the page, whereas the child browser acted more like Safari, showing the entire page. Is there a zoom parameter? The 2.9 browser always starts saying “Load Error” as well…

    -1TC?

    #342208 Reply

    Unknown Author
    Participant

    I’ve cracked it! Under Mobione Cordova 2.9:

    function viewArticle(idx) {
        curArticleIdx = idx;
            url=theresult.responseData.feed.entries[curArticleIdx].link;
            url=encodeURI(url);
            window.open(url, '_blank','EnableViewPortScale=yes','location=yes');
    
    }

    The encodeURI prevents to load failure message at the beginning. The ViewPortScale enables zooming.

    -1TC

    #342215 Reply

    Unknown Author
    Participant

    Well…I still haven’t gotten to the root of the issue. The app isn’t crashing, but the location bar will say “Load Error” if I click the list directly, “Loading…” if I move the list up and down first. There’s still something not quite right.

    For now, I’m just going to hide the location bar and go with this code:

    
    function viewArticle(idx) {
        curArticleIdx = idx;
            url=theresult.responseData.feed.entries[curArticleIdx].link;
            url=encodeURI(url);
            window.open(url, '_blank','location=no,enableViewportScale=yes');}

    -1TC

    #342220 Reply

    Unknown Author
    Participant

    Here’s the source of the error/crashes:

    NSURLErrorCancelled (-999)

    “Returned when an asynchronous load is canceled. A Web Kit framework delegate will receive this error when it performs a cancel operation on a loading resource. Note that an NSURLConnection or NSURLDownload delegate will not receive this error if the download is canceled.”

    Mobione is calling URLs more than once.

    #342485 Reply

    support-michael
    Keymaster

    > window.open(url, ‘_blank’,’location=no,enableViewportScale=yes’);

    Congrats on making progress. We are moving to InAppBrowser and will be recommending that app developers (not webapp/website devs) use the Cordova api directly. I kicked your analysis of the load error to the dev team to eval. The next release will include InAppBrowser patched in Cordova 2.9 with the 3.0 fix. I don’t know that it will address the Load Error because we are wrapping up testing shortly.

Viewing 10 posts - 1 through 10 (of 10 total)
Reply To: Mobione Cordova 2.2: InAppBrowser Crash (Replicatable)

You must be logged in to post in the forum log in