Search code examples
iosangularjsionic-frameworkinappbrowser

Ionic InAppBrowser no done/close button iOS


Please see attached snippet I am using for inappbrowser. I have used '_blank' with location and toolbar=yes the link opens in the inappbrowser, but there is no back button or done button. I have tried replacing '_blank' with '_self', but this doesn't make any difference. Since this wasn't working for me, I decided it's best to open the link in the system browser and replaced '_self' with '_system', but this does not work. The link does not open at all. All 3 run fine when i test it in the browser, but when simulating it on the iOS simulator or when testing on the iOS device, I face the above issues.

I have read a lot of posts on stack overflow and on the ionic forum and tried almost all solutions provided, but none have worked for me. It seems to be a bug in using ionic with iOS. Anyone have any other solutions?

〈a ng-href="https://facebook.com" target="_self" ng-click="cordova.InAppBrowser.open('https://facebook.com','_self', 'location=yes, toolbar=yes'); return false;"〉test〈/a〉

Ionic 1, Xcode Version 8.3.2, iOS 9, cordova-plugin-inappbrowser spec="^1.7.1"


Solution

  • This fixed the problem for me. Add the following code is in your config.xml file if it isn't already present:

    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    

    Add the href depending on the hyperlink you are using in your project.