MobileEvangelist
MobileEvangelist

Reputation: 2628

Loading url in ionic shows blank screen

I have searched on web but got nothing concrete about this issue. I'm using ionic v1, in which I'm loading my adfs url to ask user for login though adfs web page but only on some phones I see login page and on others I see blank screen. I tried debugging it but I got nothing[only the url] constructive so far. I'm loading url using

window.open("https://inve....", '_system');

So far we've encountered with this issue on Android phones only, but I'm targeting iPhones also. Any help will be appreciated. Thanks

Upvotes: 2

Views: 2503

Answers (2)

MobileEvangelist
MobileEvangelist

Reputation: 2628

app browser and loading adfs login page with url in it for this ionic app.

The prob I was facing was because of certificates, The server is using self signed certificate so when I'm trying to load it on the device who don't even opened server pages on browsers the app used to stuck on white screen.

If your server is signed with proper certified certificate by CA then this prob will not occur as browsers able to validate these certificates easily. That's why earlier with right certificate My android app used to work on all android phones.

Here is link to understand the process if you want to specify the certificates locally.

For other guys looking for help in this situation.

Upvotes: 3

Hitarthi Panchal
Hitarthi Panchal

Reputation: 392

For open external url you need to use plugin for ionic which is compatible for both android and ios:

Install cordova-plugin-inappbrowser using below line:

cordova plugin add cordova-plugin-inappbrowser

after that put this code in your html file:

<button class="button" ng-click="openurl('https://..........')">
      Click here
</button>

and then call click event through controller:

.controller('MyCtrl', function($scope, $cordovaInAppBrowser) {

   var options = {
      location: 'yes',
      clearcache: 'yes',
      toolbar: 'no'
   };

   $scope.openurl = function (url) {
          window.open(url, '_system', options);  
    }

 OR

   $scope.openurl = function (url) {
        $cordovaInAppBrowser.open(url, '_system', options);  
   }


})

Also change in your config.xml file

 <allow-intent href="*" />
 <allow-navigation href="*" />
 <allow-intent href="http://*/*" launch-external="yes" />
 <allow-intent href="https://*/*" launch-external="yes" />
 <feature name="StatusBar">
     <param name="ios-package" onload="true" value="CDVStatusBar" />
 </feature>

For further reference you can go through: https://github.com/apache/cordova-plugin-inappbrowser

Upvotes: 1

Related Questions