Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
Flutter Inappwebview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李增强
Flutter Inappwebview
Commits
6edf5f04
Commit
6edf5f04
authored
Nov 19, 2019
by
Lorenzo Pichilli
Committed by
GitHub
Nov 19, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #198 from robertcnst/fix_ios_shared_process_pool_web_view
- added a shared WKProcessPool for webview instances
parents
f6353b8f
56480018
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
3 deletions
+5
-3
ios/Classes/FlutterWebViewController.swift
ios/Classes/FlutterWebViewController.swift
+1
-1
ios/Classes/InAppBrowserWebViewController.swift
ios/Classes/InAppBrowserWebViewController.swift
+1
-1
ios/Classes/InAppWebView.swift
ios/Classes/InAppWebView.swift
+2
-1
ios/Classes/SwiftFlutterPlugin.swift
ios/Classes/SwiftFlutterPlugin.swift
+1
-0
No files found.
ios/Classes/FlutterWebViewController.swift
View file @
6edf5f04
...
...
@@ -28,7 +28,7 @@ public class FlutterWebViewController: NSObject, FlutterPlatformView {
let
options
=
InAppWebViewOptions
()
options
.
parse
(
options
:
initialOptions
)
let
preWebviewConfiguration
=
InAppWebView
.
preWKWebViewConfiguration
(
options
:
options
)
let
preWebviewConfiguration
=
InAppWebView
.
preWKWebViewConfiguration
(
options
:
options
,
webViewProcessPool
:
SwiftFlutterPlugin
.
webViewProcessPool
)
webView
=
InAppWebView
(
frame
:
frame
,
configuration
:
preWebviewConfiguration
,
IABController
:
nil
,
IAWController
:
self
)
let
channelName
=
"com.pichillilorenzo/flutter_inappwebview_"
+
String
(
viewId
)
...
...
ios/Classes/InAppBrowserWebViewController.swift
View file @
6edf5f04
...
...
@@ -113,7 +113,7 @@ class InAppBrowserWebViewController: UIViewController, UIScrollViewDelegate, WKU
override
func
viewWillAppear
(
_
animated
:
Bool
)
{
if
!
viewPrepared
{
let
preWebviewConfiguration
=
InAppWebView
.
preWKWebViewConfiguration
(
options
:
webViewOptions
)
let
preWebviewConfiguration
=
InAppWebView
.
preWKWebViewConfiguration
(
options
:
webViewOptions
,
webViewProcessPool
:
SwiftFlutterPlugin
.
webViewProcessPool
)
self
.
webView
=
InAppWebView
(
frame
:
.
zero
,
configuration
:
preWebviewConfiguration
,
IABController
:
self
,
IAWController
:
nil
)
self
.
containerWebView
.
addSubview
(
self
.
webView
)
prepareConstraints
()
...
...
ios/Classes/InAppWebView.swift
View file @
6edf5f04
...
...
@@ -191,8 +191,9 @@ public class InAppWebView: WKWebView, UIScrollViewDelegate, WKUIDelegate, WKNavi
}
}
public
static
func
preWKWebViewConfiguration
(
options
:
InAppWebViewOptions
?)
->
WKWebViewConfiguration
{
public
static
func
preWKWebViewConfiguration
(
options
:
InAppWebViewOptions
?
,
webViewProcessPool
:
WKProcessPool
)
->
WKWebViewConfiguration
{
let
configuration
=
WKWebViewConfiguration
()
configuration
.
processPool
=
webViewProcessPool
if
#available(iOS 10.0, *)
{
configuration
.
mediaTypesRequiringUserActionForPlayback
=
((
options
?
.
mediaPlaybackRequiresUserGesture
)
!
)
?
.
all
:
[]
...
...
ios/Classes/SwiftFlutterPlugin.swift
View file @
6edf5f04
...
...
@@ -38,6 +38,7 @@ public class SwiftFlutterPlugin: NSObject, FlutterPlugin {
static
var
registrar
:
FlutterPluginRegistrar
?
static
var
channel
:
FlutterMethodChannel
?
static
let
webViewProcessPool
:
WKProcessPool
=
WKProcessPool
()
var
webViewControllers
:
[
String
:
InAppBrowserWebViewController
?]
=
[:]
var
safariViewControllers
:
[
String
:
Any
?]
=
[:]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment