[RESOLVED] InappBrowser not working in Ionic


#1

I using the InappBrowser plugin to open the site pages in my application. The problem is that when you touch the item, the InappBrowser is no return, or the ADB error logs, while in the web browser, testing with ionic serve, usually works … Here the code:

HTML:

<ion-item ng-repeat="item in posts | filter: query" class="item-thumbnail-left item-text-wrap item-icon-right item-noticia" ng-click="urlchange('{{item.permalink}}')">
    <img class="thumb-noticia" data-ng-src="{{item.thumbnail}}">
    <h2> {{item.title}} </h2>
    <p>{{item.excerpt | limitTo: 100}}...</p>

    <ion-option-button class="button-dark button-facebook" ng-click="shareAnywhere()">
            <i class="icon ion-social-facebook icon-facebook"></i>
    </ion-option-button>
    <ion-option-button class="button-dark button-whatsapp" ng-click="shareAnywhere()">
            <i class="icon ion-social-whatsapp-outline"></i>
    </ion-option-button>
</ion-item>

AngularJS:

$scope.urlchange = function(url){
  window.open(url, '_blank', 'hidden=no');
}

Help me please?


#2

Anyway, again, I decided the problem by myself…

The result:

In command line:

ionic plugin add cordova-plugin-inappbrowser

AngularJS:

$scope.urlchange = function($url, $rootScope){
    cordova.InAppBrowser.open($url, "_blank", "location=no", "clearcache: no", "toolbar: no");
}

HTML:

<ion-item ng-repeat="item in posts | filter: query" class="item-thumbnail-left item-text-wrap item-icon-right item-noticia" ng-click="urlchange('{{item.permalink}}')">

#3

so, you sure done true?
step1 donwload ng-cordova.js
step2 download inappbrowser at address: https://github.com/apache/cordova-plugin-inappbrowser
step3 example code
var ref = cordova.InAppBrowser.open(‘http://apache.org’, ‘_blank’, ‘location=yes’);
var ref2 = cordova.InAppBrowser.open(encodeURI(‘http://ja.m.wikipedia.org/wiki/ハングル’), ‘_blank’, ‘location=yes’);
please read document on https://github.com/apache/cordova-plugin-inappbrowser.
+ng-cordova.js: it’s lib this resolve problem on inappbrowser.
+Last three month,i have done project mobile android/window phone and ios for ionic with cordova. I’m resolve problem on step here.
goodluck !