0

I am building a phonegap application that uses jquery mobile navigation. I have an external php page that queries items from Db and loads them to my app. so I am using

  $(document).delegate("#cardslist", "pageinit", function() {    
  $.mobile.changePage( "data/card-list.html", { transition: "fade",  changeHash: false });
      );
 });

where card-list.html is an internal page and its content is

$(document).delegate(".cardslist", "pageinit", function() {         
  $.ajax({
  method:'GET',
  url:'http://www.thecardguys.co.ke/m/card-list-mobile.php',
  beforeSend:function()
     {
  // $("#processing").show();
     },

 complete:function ()
   {
  //   $("#processing").hide();  
   },
 success: function(feedback)
   {
  $('.cardlist').html(feedback); 
  $('.cardlist').css({'transform': 'scale(0.6)'});                 
   }


  });
  }

http://www.thecardguys.co.ke/m/card-list-mobile.php is an external php page that fetches data and echoes it.

content is loading well in ripple emulator, but when I bundle the app the data won't load. it has been a week now

jonah
  • 213
  • 4
  • 16

1 Answers1

2

Make sure that www.thecardguys.co.ke is added to your network request whitelist (see whitelist plugin). Since you are requesting a non-secure url you also need to set transport security off for IOS9 for that url (add the following to your plist):

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSExceptionDomains</key>
    <dict>
        <key>www.thecardguys.co.ke</key>
        <dict>
            <key>NSIncludesSubdomains</key>
            <true/>
            <key>NSExceptionAllowsInsecureHTTPLoads</key>
            <true/>
            <key>NSExceptionRequiresForwardSecrecy</key>
            <false/>
        </dict>
    </dict>
</dict>

or make the url run on https. For more info see How do I load an HTTP URL with App Transport Security enabled in iOS 9?) and Ajax Not working in IOS 9.0 Cordova and the apple document on transport security is IOS9.

Community
  • 1
  • 1
Kris Erickson
  • 33,454
  • 26
  • 120
  • 175
  • Hey, thanks for the response, I added the url on the network whitelist. but it still shows loader but not loading the feed. I tried https and this doesn't even load on emulator. – jonah Oct 28 '15 at 14:51
  • @jonah without more details there is not much more I can add. Since you have an APK and aren't building it yourself getting any debug information would be difficult. If you can build it yourself with the Cordova CLI you can use Safari or GapDebug (https://www.genuitec.com/products/gapdebug/). If you are using PhoneGapBuild they have debugging tools available to determine what is going wrong (http://docs.build.phonegap.com/en_US/debugging_remote_debugging_tools.md.html#Remote%20Debugging%20Tools). – Kris Erickson Oct 28 '15 at 17:24
  • I am not using any APK debugger . Let me try genuitec.com/products/gapdebug – jonah Oct 30 '15 at 07:44