danielsogl / awesome-cordova-plugins

Native features for mobile apps built with Cordova/PhoneGap and open web technologies. Complete with TypeScript support.
https://danielsogl.gitbook.io/awesome-cordova-plugins/
Other
2.41k stars 2.42k forks source link

Ionic2 InappBrowser close button for ios #1169

Closed omgalbert closed 7 years ago

omgalbert commented 7 years ago

Ionic version: (check one with "x") [ ] 1.x [x ] 2.x

I'm submitting a ... (check one with "x") [x ] bug report [ ] feature request [ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/

Current behavior: Hi,

I have a problem with inappbrowser plugin for ios. I open google maps app with a location and I'm trying to show the toolbar with a button to can close the new windows and come back to the application, but it doesn't work, it opens the google maps app but without any toolbar/button. I tried everything. currently I'm opening the new window using:

let browser = new InAppBrowser(marker.map.mapUrl, '_system', 'location=yes,toolbar=yes,closebuttoncaption=done');

Expected behavior: Open a new window with the toolbar and the close button.

Related code:

let browser = new InAppBrowser(marker.map.mapUrl, '_system', 'location=yes,toolbar=yes,closebuttoncaption=done'); insert any relevant code here

mesutcsk commented 7 years ago

I have the same problem.

ehorodyski commented 7 years ago

If you're opening up the Google Maps app, even if it's invoked from InAppBrowser, it won't open the app inside of a WebView. At least as far as I know.

InAppBrowser will only control what's in an InAppBrowser instance.

ihadeed commented 7 years ago

In addition to what @ehorodyski said:

When you use the _system target, you have no control over what you want the browser window to look like. _system opens it in an app of the user's choice. You need to use _blank to open it in an InAppBrowser instance that you can customize.

omgalbert commented 7 years ago

Thanks for you answers guys.

The problem is that I'm trying to open a web page using _blank as well but it doesn't show the browser window in the webview.

ihadeed commented 7 years ago

@omgalbert None of the In App Browser plugins we have will open a URL inside of your current WebView.

To achieve that kind of functionality, you will need to use an iframe.

omgalbert commented 7 years ago

@ihadeed to open a url, it has the option closebuttoncaption, it means there is the possibility to show a button to close the browser opened and come back to the application. Android doesn't have any problem because it has the back button, but for not ios .

This is what I want and currently it's not working: capture

ihadeed commented 7 years ago

Not sure why you're not getting the toolbar with the Done button. Can't see anything wrong with the Ionic Native wrapper.

I will test this out when I get a chance.

In the meanwhile, may I suggest using the BrowserTab plugin: https://ionicframework.com/docs/v2/native/browser-tab/

Anujmoglix commented 7 years ago

No toolbar is showing if i use'location=no,closebuttoncaption=Close'

albertfdiaz commented 7 years ago

@Anujmoglix you need use location=yes

kwanite commented 6 years ago

Any update on this issue?

I am testing using the DevApp and I haven't been able to get a toolbar in iOS. Plugin works perfectly with Android but on iOS there is no toolbar.

Here are my options:

location : 'yes', hidden : 'no', clearcache : 'yes', clearsessioncache : 'yes', zoom : 'yes',//Android only ,shows browser zoom controls hardwareback : 'yes', mediaPlaybackRequiresUserAction : 'no', shouldPauseOnSuspend : 'no', //Android only closebuttoncaption : 'Close', //iOS only disallowoverscroll : 'no', //iOS only toolbar : 'yes', //iOS only enableViewportScale : 'no', //iOS only allowInlineMediaPlayback : 'no',//iOS only presentationstyle : 'pagesheet',//iOS only fullscreen : 'yes',//Windows only

Ross-Rawlins commented 6 years ago

I am getting this issue now on iPhone X