Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inline Android and iOS WebView #730

Closed
eseidelGoogle opened this issue Dec 4, 2015 · 100 comments
Closed

Inline Android and iOS WebView #730

eseidelGoogle opened this issue Dec 4, 2015 · 100 comments
Assignees
Labels
c: new feature Nothing broken; request for a new capability customer: mulligan (g3) framework flutter/packages/flutter repository. See also f: labels. package flutter/packages repository. See also p: labels.

Comments

@eseidelGoogle
Copy link
Contributor

Presumably this requires some compositor work, similar to maps or video?

@Hixie Hixie added the c: new feature Nothing broken; request for a new capability label Dec 11, 2015
@Hixie Hixie added this to the Blue Sky milestone Dec 11, 2015
@jxson
Copy link

jxson commented Jan 4, 2016

Adding an example use case for this:

I have a hybrid Android application where some rendering is handled by a WebView but controls for things like navigation are handled by native UI widgets. I would like to port a version to Flutter, off the top of my head the requirements for getting this to work are:

The last item here allows us to stream the contents of PDF files to the WebView. The current Android implementation intercepts HTTP requests from the WebView and streams back the contents of the requested PDF file. The implementation can be seen here.

I'm new to Flutter so I may have gotten some of the terminology wrong, let me know if you need clarification on anything.

@eseidelGoogle
Copy link
Contributor Author

We're currently moving towards an approach of making it easier to use native views in conjunction with FlutterView:
https://docs.google.com/document/d/1DOfwpL6VojCAG_zjjcA_z5ekF7rTIohV8dWn2o7_IME/edit

@Hixie
Copy link
Contributor

Hixie commented May 13, 2016

This is more about having a way to put a WebView within a Flutter widget tree, I think. As you say in your original comment, we need something similar for embedding videos or maps provided by a third-party non-Flutter library.

@owenthereal
Copy link

Any updates on integrating a webview with flutter?

@abarth abarth modified the milestones: 5: Make Hixie proud, 4: Make shippers happy Jan 26, 2017
@mit-mit mit-mit added framework flutter/packages/flutter repository. See also f: labels. and removed plugin labels Feb 2, 2017
@eseidelGoogle
Copy link
Contributor Author

Looks like someone has started a plugin to do full screen webviews: https://github.com/dart-flitter/flutter_webview_plugin

@xster
Copy link
Member

xster commented May 20, 2017

I think doing the activity subset is a great start. It would unlock a whole set of app types that would need getting an oauth token from a web login.

@sethladd
Copy link
Contributor

FWIW: here's the PR for the iOS version of the webview plugin: fluttercommunity/flutter_webview_plugin#3

@lejard-h
Copy link

We now have the webview plugin on IOS thanks to @toufikzitouni 👍 https://pub.dartlang.org/packages/flutter_webview_plugin

@Hixie Hixie modified the milestones: 3: Current Milestone, 4: Make shippers happy Jun 20, 2017
@Hixie Hixie modified the milestones: 3: Current Milestone, 4: Next milestone Dec 13, 2017
@Hixie
Copy link
Contributor

Hixie commented Dec 13, 2017

This is not on our short-term priority list. Moving to next milestone.

@csbenjamin
Copy link

It would be great to have a webview and a way to interacting with it. I want to show embedded YouTube video and to control the player. Right now I am using https://github.com/dart-flitter/flutter_webview_plugin, but I am using some hack for some situations. For example, I change the webview URL in JavaScript after the video ends in order to the flutter app to receive an event onUrlChange and then to close the webview.

@eseidelGoogle
Copy link
Contributor Author

@csbenjamin Are you specifically looking for YouTube you prefer https://developers.google.com/youtube/android/player/ over a WebView to control? Or did you also need a WebView? If you're looking for a YouTube specific player, please file a new bug, that's definitely a reasonable request. :)

@csbenjamin
Copy link

Yes, I am looking for YouTube player. I don't need anything from webview, just a YouTube player. I will open a new issue. Thanks

@megatolya
Copy link

We have to open payment web form and this feature is blocker for us 😢

@lejard-h
Copy link

@megatolya the webview plugin cannot do the job for you ?

@megatolya
Copy link

@lejard-h
Unfortunately no. We need to have oppurtunity to render web forms in any place on the page. Not only on top of other content or on the separate page. Manually control scroll (to reposition webview) seems too complicated for us.

I understand that this issue is by-design problem but IMHO this feature is quite fundamental to ignore.

@zoechi
Copy link
Contributor

zoechi commented Oct 18, 2018

@flddr Just because it is an important feature doesn't mean it is easy and quick to add. Rather the opposite.
You seem to assume that Google has unlimited resources and that adding enough additional developers to a team is enough to get instant results. Sadly that's not how the world works.

You can rest assured that the Flutter team is aware of this features importance and you can follow progress in https://github.com/flutter/plugins/tree/master/packages/webview_flutter

@ghost
Copy link

ghost commented Oct 18, 2018

@zoechi ups, thanks, i did never want to say this 😕

My guess was, it was dropped morely in development to hold a gap between hybrids and natives, because the flutter UI itself is enormous powerful and clean, whereas the possibility to do things in a webview can end in lower quality (like, miss of material design or those points). Because webview is often miss-used for all things (quick n dirty)

Thanks for the link

@zoechi
Copy link
Contributor

zoechi commented Oct 18, 2018

@flddr I think it's mostly that they don't want to rewrite a browser in Dart (for good reasons) and instead make native functionality available which required to implement additional capabilities for Flutter.
This capability became available recently and since then implementing webview is in progress.

https://pub.dartlang.org/packages/flutter_webview_plugin (community effort) is available since quite some time, but it had the disadvantage that it was always shown on top of Flutter widgets. For example opening a drawer menu opens it behind the webview if there is overlap.
The new plugin will work well with other Flutter widgets.

@ghost
Copy link

ghost commented Oct 18, 2018

@zoechi you are right - i have overseen a rewrite in dart completely. I just know flutter is the future of app development in my opinion, the tooling is great, dart is great - but i couldn't dive deep in because i am developing my backend actually. I am just looking flutter.io daily and waiting for 1.0 - and sometimes, this hopeful waiting causes a talk about whatever, the main thing is something is happening.

Sorry for miss-talk about the webview

Btw: sorry, i know about all you guys how are beeing google, and all your hard work, but, yes, you are google. Nothing else. My first contact with google was the last day i used altavista.

So, if i could bet on a company who would win a race, i ever would bet on google.

Thanks for infos :) I have nothing more to say for this issue :)

@Rockvole
Copy link

Flutter uses Skia to render, and Chrome uses Skia to render so it seems like it should be an easy conversion. But you cannot add a browser into Flutter this way because any flutter apps would be banned from running on the apple store. Without cross platform ability Flutter would be abandoned. Google are right to take time with this issue.

https://www.howtogeek.com/184283/why-third-party-browsers-will-always-be-inferior-to-safari-on-iphone-and-ipad/

@ghost
Copy link

ghost commented Oct 18, 2018

@Rockvole very interesting 👍

@pichillilorenzo
Copy link

pichillilorenzo commented Oct 22, 2018

Finally, I released a new version (v0.5.1) of flutter_inappbrowser where there is initial support of inline WebViews (InAppWebView class)! Obviously, this Widget is available only for Android at this moment and there are some limitations because AndroidView is not stable enough.

However, you can already play with it a little bit. There are a lot of functions and events that you can test and use! An example of an inline WebView can be found in the README.md file of the plugin repository.

EDIT 1: released new version (1.0.1) with support for both Android and iOS inline webview widget! 🎉

EDIT 2: it has been renamed to flutter_inappwebview. Current version is 2.0.1! There are a lot of new events, options and methods.

@imWildCat
Copy link
Contributor

I am just curious: it is mentioned in Google Developer Days China (last month) that the official WebView plugin should be release with developer preview 2. However, this plugin webview_flutter is still in development: https://github.com/flutter/plugins/tree/master/packages/webview_flutter

@dnfield dnfield modified the milestones: bucket10, Overdue Nov 6, 2018
@amirh amirh modified the milestones: Overdue, bucket11 Nov 7, 2018
@InMatrix
Copy link

InMatrix commented Nov 8, 2018

@imWildCat Thank you for joining us at GDD China. To clarify, we demoed a preview of the WebView widget at GDD. I checked the video recording (55:12) of the GDD keynote to make sure we didn't say it's released. Nonetheless, we apologize that you were under the impression that this plugin had been released.

@imWildCat
Copy link
Contributor

@InMatrix Sorry for my misunderstanding. Many thanks your explanation and I really appreciate it. I look forward to the release of the official WebView plugin.

@amirh
Copy link
Contributor

amirh commented Nov 10, 2018

flutter/plugins#890 added iOS support to the webview_flutter plugin.
The platform views embedding support, which the inline webview is based on, is still in early preview (see #19030 (comment) ).

Open issues are tagged with the platform-views and/or webview labels, please upvote the issues you care about to help us prioritize.

@amirh amirh closed this as completed Nov 10, 2018
@amirh
Copy link
Contributor

amirh commented Nov 10, 2018

Note that if you want to try it out on iOS you will need to enable the preview flag, see more details on:
#19030 (comment)

@ZhennanWu
Copy link

The absence of a usable WebView is really a deal-breaker to me personally.
flutter_inappbrowser is a great package that comes very close to full usability but still lacks keyboard support yet. Unfortunately, I was just going to build a code editor app........

@ghost
Copy link

ghost commented Dec 5, 2018

Congratulations to 1.0 for best mobile framework ever 🎉

Now waiting for webview ☺️

@amirh
Copy link
Contributor

amirh commented Dec 5, 2018

Just to clarify: The webview_flutter plugin provides an embedded WebView on Android and iOS and is currently in developers preview.

We are tracking issues and missing features with the webview tag, if you care about specific issues you can help by filing an issue if there's isn't one yet, or upvoting an existing issue. PRs are of course also welcomed 😄

@danielRi
Copy link

@amirh Sorry to hassle you with questions. We are heavily considering moving over to Flutter for a upcoming project, but we rely on a WebView to work (inline, flutter_webview_plugin is not an option). Do you have any information about upcoming updates or a roadmap for us? Thank you very much for any reply, keep up the great work and may the Flutter love spread around the world.

@zoechi
Copy link
Contributor

zoechi commented Dec 13, 2018

@kyawsithu
Copy link

kyawsithu commented Mar 14, 2019

Very interesting topic for my problem, I have come across to this topic after struggling a lot to find a right web view for flutter. Unfortunately, this new plugin (still developer preview) has a big issue with Android when I tried to open keyboard. Would that be fixed when it comes to release?

@droplet-js
Copy link

droplet-js commented Sep 29, 2019

i think foreign function interface + webkit is best way. inline android webview or ios wkwebview is not good idea

@amirh
Copy link
Contributor

amirh commented Sep 30, 2019

i think foreign function interface + webkit is best way. inline android webview or ios wkwebview is not good idea

There are pros and cons (the obvious one is binary size).
I definitely see how for certain use case bundling a web engine would be the preferred choice.
It may be possible to add this as an alternative webview_flutter implementation by implementing the platform interface. If anyone gives it a shot I'm curious to lean about it!

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 25, 2021
@flutter-triage-bot flutter-triage-bot bot added the package flutter/packages repository. See also p: labels. label Jul 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
c: new feature Nothing broken; request for a new capability customer: mulligan (g3) framework flutter/packages/flutter repository. See also f: labels. package flutter/packages repository. See also p: labels.
Projects
None yet
Development

No branches or pull requests