Is there any way we can hide url on Iphone browser using Url_launcher plugin

Viewed 1017

I'm using Url_launcher plugin to open some specific URL but I don't want to show URL to the user. In Android, the Adress bar doesn't show up but in IOS it does. Is there any way to hide it?

1 Answers

As the url_launcher documentation says:

By default, Android opens up a browser when handling URLs. You can pass forceWebView: true parameter to tell the plugin to open a WebView instead. On iOS, the default behavior is to open all web URLs within the app. Everything else is redirected to the app handler.

So iOS opens urls inside a WebView already. But.. you must be sure to enable Flutter embedded views on your Info.plist. You need to add a boolean property with:

key = io.flutter.embedded_views_preview
value = YES

And that should do the job.

For more info you can take a look at this issue. https://github.com/flutter/flutter/issues/19030

Related