I’ve been trying to load external content on my ionic app but can’t seem to make it work properly using the ng-cordova inappbrowser.
I’ve set some of the options but they doesn’t seem to affect anything when I test.
The object to string parsing is made by the directive… Oddly enough they don’t seem to work as I try to set up the location to off but I can still see it when I open the app.
I ran into this issue last week… turns out that because window.open works somewhat without the plugin (on Android at least, where I was testing), I thought I had already installed the plugin but that it was broken. I spent a long time trying to figure out why the options weren’t working…
@mhartington I installed with the command on the ng-cordova page.
I have this on my plugin list:
org.apache.cordova.inappbrowser 0.5.4 “InAppBrowser”
I assume I have everything … I’m trying to define the default options on the config of the module like in the example (just trying everything imaginary and possible)
Don’t have any console logs when running on emulator or device with Xcode (Haven’t tested on Android)
+1 I’m not able to set return back or done button on ngCordova InappBrowser default options. Could you please help to set back buttons on InAppBrowser?
So was it just that you didn’t have the plugin installed? I think I am having the same issue, but definitely have it installed, and I can’t resolve it.
Instead of Done button you can make the close button appear when location is set to yes for Android since the close button is part of the location bar.
marcelc, I have the exactly the same problem. Location and toolbar with back button doesn’t shows on my iPhone 6 in Ionic View app, so I can’t go back to my app from external site view. But if I run on emulator (ionic emulate ios) — then I see both back button and location bar.
I wonder what we do wrong and why in Ionic View Done button doesn’t shows.
Since you say the inappbrowser only doesn’t work on ionic view but works when installed on device, I’ve a suspicion that inappbrowser doesn’t work on ionic view because ionic view is already utilizing it to show our app? That’s why cordova take over the entire ionic view instead when we’re triggering the inappbrowser. Another thing that makes me think this way is because most of other cordova plugins that ionic view is already using doesn’t work such as the status bar plugin.
This is only my suspicion though and I’ve yet to find a solid prove to based this on. Meanwhile I’ll keep on searching for a solution.
####On the emulation (ios), the inAppBrowser uses the device’s native browser, you can get the ‘done’ button by adding “closebuttoncaption: ‘done’” to the options of the .open() method.
####So if you’re in ionic-view, it’s going to open a new browser by you default system browser, which should be chrome of firefox on your desktop.
####One caveat is that this is the functionality for opening links using the .open() method on inAppBrowser. If you use an anchor tag to open links, I haven’t been able to get the done button with using that, but it will open as you expect in ionic view.
@marcelc is correct! On the emulation (ios), the inAppBrowser uses the device’s native browser,you can get the ‘done’ button by adding “closebuttoncaption: ‘done’” to the options of the .open() method.
So if you’re in ionic-view, it’s going to open a new browser by you default system browser, which should be chrome of firefox on your desktop.
One caveat is that this is the functionality for opening links using the .open() method on inAppBrowser. If you use an anchor tag to open links I haven’t been able to get the done button with using that.
Make sure that links are https if they’re supposed to be, especially in dealing with API data, the desktop browser will automatically resolve them but the emulator browser won’t
I am sure this works but I get an error ( expected and identifier and instead saw ‘.’) at line one and the app screen is white… I added the code at the bottom of app.js
I tried to open a link in the system browser, it worked just fine. Would there be any way to hide the browser back and forward buttons, the whole bar in fact? I tried to do location=no, toolbar=no didn’t seem to work