# Problem with InAppBrowser on iOS

**URL:** <https://forum.ionicframework.com/t/problem-with-inappbrowser-on-ios/76856>\
**Category:** cordova\
**Created:** [January 20, 2017, 1:32pm UTC](https://forum.ionicframework.com/t/problem-with-inappbrowser-on-ios/76856 "2017-01-20T13:32:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Keldarne](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Keldarne](https://forum.ionicframework.com/u/Keldarne)\
**Post date:** [January 20, 2017, 1:32pm UTC](https://forum.ionicframework.com/t/problem-with-inappbrowser-on-ios/76856/1 "2017-01-20T13:32:03Z")

</div>

Hi guys,

I have problems with showing a PDF file with inAppBrowser of cordova. It’s half working, I mean it’s working but only if I go out of app and come back in it.

Here is my function (I use google.doc viewer) :

```
$scope.openPDF = function openPDF() {
     if (ionic.Platform.isIOS()) {
        window.open("data/ses_pdf.pdf", '_blank', 'location=no');
     } else {
        window.open(encodeURI('https://docs.google.com/gview?embedded=true&url=https://www.dropbox.com/s/jp5cwme8dle1ura/ses_pdf.pdf?dl=1'), '_system', 'location=no,EnableViewPortScale=yes');
     }
};

```

And here is my call to function :

```
<div class="col-xs-4 menu_pdf">
      <a ng-click="openPDF();" style="display: inline-block;">
            <div style="text-align:left;">
                <img src="img/logo_pdf.png" alt="logo" width="75px" height="75px">
            </div>
       </a>
</div>

```

PS : It’s working on android.

Edit : here is a link showing how iOS is acting : [Youtube Issue Video](https://www.youtube.com/watch?v=qmoqCqhUs2s)

Hope you can help me 😄

Joseph Gremaud

---

<div class="post-metadata">

**Author:** ![MarcinRychter](https://avatars.discourse-cdn.com/v4/letter/m/3e96dc/32.png) [@MarcinRychter](https://forum.ionicframework.com/u/MarcinRychter)\
**Post date:** [March 22, 2018, 3:59pm UTC](https://forum.ionicframework.com/t/problem-with-inappbrowser-on-ios/76856/2 "2018-03-22T15:59:26Z")

</div>

encodeURI works differently on android and on iOS.
