victorbonnet / flutter_web_browser Goto Github PK
View Code? Open in Web Editor NEWPlugin for flutter to open web page with Chrome Custom Tabs and SFSafariViewController
License: MIT License
Plugin for flutter to open web page with Chrome Custom Tabs and SFSafariViewController
License: MIT License
I tried to open the URL like
view-source:https://www.google.com/ but I can't open the URL its says
" PlatformException(LAUNCH_ERROR, No Activity found to handle Intent { act=android.intent.action.VIEW dat=view-source:https://google.com }, null)"
I try to open the URL using the webview_flutter, then it's working fine.
the view-source also works in the chrome browser.
Is there is any way to open that URL by using custom tabs?
@victorbonnet
I am using flutter_web_browser: ^0.16.0
with flutter version 2.8.1
and I want to listen to the URL
and perform some actions.
Building flutter_web_browser 0.17.1 gives the following warning:
Note: /opt/homebrew/Caskroom/flutter/3.3.8/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_web_browser-0.17.1/android/src/main/java/dev/vbonnet/flutterwebbrowser/FlutterWebBrowserPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
I have used the example program to test the plugin here but it didn't work.
The error message after clicking on button reads:
E/flutter ( 8046): [ERROR:flutter/lib/ui/ui_dart_state.cc(166)] Unhandled Exception: MissingPluginException(No implementation found for method openWebPage on channel flutter_web_browser)
E/flutter ( 8046): #0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:159:7)
E/flutter ( 8046): <asynchronous suspension>
E/flutter ( 8046): #1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:334:12)
E/flutter ( 8046): #2 FlutterWebBrowser.openWebPage (package:flutter_web_browser/flutter_web_browser.dart:15:21)
E/flutter ( 8046): #3 _MyAppState.openBrowserTab (package:inappbrowser/main.dart:36:29)
E/flutter ( 8046): #4 _MyAppState.build.<anonymous closure> (package:inappbrowser/main.dart:48:30)
E/flutter ( 8046): #5 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:992:19)
E/flutter ( 8046): #6 _InkResponseState.build.<anonymous closure> (package:flutter/src/material/ink_well.dart:1098:38)
E/flutter ( 8046): #7 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:184:24)
E/flutter ( 8046): #8 TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:524:11)
E/flutter ( 8046): #9 BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:284:5)
E/flutter ( 8046): #10 BaseTapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:219:7)
E/flutter ( 8046): #11 PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:477:9)
E/flutter ( 8046): #12 PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:78:12)
E/flutter ( 8046): #13 PointerRouter._dispatchEventToRoutes.<anonymous closure> (package:flutter/src/gestures/pointer_router.dart:124:9)
E/flutter ( 8046): #14 _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:377:8)
E/flutter ( 8046): #15 PointerRouter._dispatchEventToRoutes (package:flutter/src/gestures/pointer_router.dart:122:18)
E/flutter ( 8046): #16 PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:108:7)
E/flutter ( 8046): #17 GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:220:19)
E/flutter ( 8046): #18 GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:200:22)
E/flutter ( 8046): #19 GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:158:7)
E/flutter ( 8046): #20 GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:104:7)
E/flutter ( 8046): #21 GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:88:7)
E/flutter ( 8046): #22 _rootRunUnary (dart:async/zone.dart:1206:13)
E/flutter ( 8046): #23 _CustomZone.runUnary (dart:async/zone.dart:1100:19)
E/flutter ( 8046): #24 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1005:7)
E/flutter ( 8046): #25 _invoke1 (dart:ui/hooks.dart:267:10)
E/flutter ( 8046): #26 _dispatchPointerDataPacket (dart:ui/hooks.dart:176:5)
pubspec.yaml
:dependencies:
flutter_web_browser: "^0.11.0"
Is it possible to remove the app bar?
Is web support planned for the future?
No matter if I set entersReaderIfAvailable to true, or false, Safari always enters Reading mode on the websites I visit. In ios simulator 13.6 and on a real device
If using UIModalPresentationStyle.pageSheet and dragging down to close the browser, the close event will never be received.
The package works as expected on Android but crashes on the ios simulator and on physical devices with this error:
*** First throw call stack:
(
0 CoreFoundation 0x000000010ab9b6fb __exceptionPreprocess + 331
1 libobjc.A.dylib 0x000000010b19bac5 objc_exception_throw + 48
2 CoreFoundation 0x000000010ab9b555 +[NSException raise:format:] + 197
3 SafariServices 0x000000010a5435a8 -[SFSafariViewController initWithURL:configuration:] + 105
4 SafariServices 0x000000010a543b46 -[SFSafariViewController initWithURL:] + 94
5 Runner 0x0000000103a6b0a4 -[FlutterWebBrowserPlugin handleMethodCall:result:] + 788
6 Flutter 0x0000000107ea2818 Flutter + 514072
7 Flutter 0x0000000107e42476 Flutter + 119926
8 Flutter 0x0000000<β¦>
The example in this repo works, but when including this plugin via git, the following error shows when building for iOS:
/Users/matthew/Development/hackwinds_cameras/hackwinds_cameras/ios/Runner/GeneratedPluginRegistrant.m:6:9: fatal error: 'flutter_web_browser/FlutterWebBrowserPlugin.h' file not found
#import <flutter_web_browser/FlutterWebBrowserPlugin.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Could not build the application for the simulator.
Any help would be awesome. Otherwise I can just re-write it myself for local use. Thanks!
Since google is deprecating install_referrer we won't be able to use that post 1 March
steps to reproduce:
Create an app with
Hello.
First of all this project looks awesome π
Can you please choose a license for it ?
I would recommend Apache 2.0 or MIT.
Thanks.
I was wondering if you could implement a function to close the tab previously opened with openWebPage. This would help me on an app that requires some permissions from the user; after accepting these permissions, they have to manually close the page and I think that this should be done automatically.
in v2 embedding not running anymore, can you help me?
We have an app that opens links to the company website using flutter_web_browser, that website uses cookies for a variety of reasons. As of iOS 14.5, Apple requires that apps on the App Store need to receive the userβs permission before collecting data used to track them, and provide an option to opt out of cookies. Since the website is developed by a different team, the easiest way to deal with this issue would be to manually access the browser cookies and set permissions to off. Is it at all possible to do it using this library?
Useful when the browser redirects back to an in-app page using URL schemes.
Please create a nullsafe prerelease version of this package
I have some functionality on URL change (I'm opening external links in the browser instead of webview) but it opens the browser 2 times and when I checked it using STOP POINT the reason is it calls function 2 times every time URL gets change.
I'm using flutter_web_browser for opening up links in chrome.
When I try to open twitter.com
on Android, it redirects me to the Twitter app, as expected.
But when I try this on iOS it doesn't happens.
Is this an issues regarding iOS URL management? Can this be fixed?
We could use prewarmconnections for sfsafariviewcontroller and mayLaunchUrl from CustomTab
Hey there π
Chrome allows passing custom headers as a Bundle, I don't know about the impl. detail for iOS.
Is it possible for the plugin to support custom headers? I have used them on Chrome before, so I can try submit a PR. I'd need help on iOS though.
Bundle headers = new Bundle();
headers.putString("header1", "value1");
headers.putString("header2", "value2");
customTabsIntent.intent.putExtra(Browser.EXTRA_HEADERS, headers);
await FlutterWebBrowser.openWebPage(url: url);
hangs forever
result
is unused and never completes the platform channel call.
It should at least result.success("launched")
be called after successfully launching the intent.
This package is great. I'm using it in my Hacker News app right now. It would be even better if it was on Pub with proper semver π.
Hi, dear author
The navigating behavior of "openWebPage" in the plugin is right_in and right_out. I hope there is a parameter to set, which can be set to pop up (bottom_in and bottom_out)
I was wondering if you could implement a function to change the modal presentation style, example as below, thanks
iOS
sfvc.modalPresentationStyle = UIModalPresentationOverFullScreen;
I get error
flutterwebbrowser\FlutterWebBrowserPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Hi!
Is it possible to return a value to dart, once the browser is closed?
Can you help?
Please add support for SDK 31 its plugin had a issue with SDK 32
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.