diff --git a/.idea/vcs.xml b/.idea/vcs.xml
index 94a25f7f..c7434d0c 100644
--- a/.idea/vcs.xml
+++ b/.idea/vcs.xml
@@ -2,5 +2,6 @@
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index ac4fdf88..2fe30737 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -15,13 +15,48 @@
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -31,28 +66,37 @@
-
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
@@ -68,13 +112,6 @@
- takeS
- Completer
- args.putIfAbsent('isLocalFile', () => true);
- args.putIfAbsent('isLocalFile', () =>
- Opens the
- _isOpened
- initialFile
onBrowserCreated
getUrl
onScrollChanged
@@ -98,6 +135,13 @@
AndroidView
_uuidGenerator
in the flutter
+ RELOAD
+ localhostServer
+ initialFile
+ loadFile
+ openFile
+ File
+ onExit
activity.getPreferences(0)
@@ -135,22 +179,27 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -165,7 +214,6 @@
-
@@ -206,6 +254,7 @@
+
@@ -213,22 +262,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -257,13 +290,14 @@
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
+
@@ -306,6 +345,9 @@
+
+
+
@@ -339,46 +381,17 @@
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
@@ -396,40 +409,42 @@
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
+
+
-
-
-
-
-
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -438,21 +453,7 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -466,16 +467,7 @@
-
-
-
-
-
-
-
-
-
-
+
@@ -485,39 +477,25 @@
-
-
-
+
-
-
-
+
-
-
-
+
-
-
-
+
-
-
-
+
-
-
-
+
-
-
-
+
@@ -535,16 +513,7 @@
-
-
-
-
-
-
-
-
-
-
+
@@ -553,31 +522,8 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -601,19 +547,13 @@
-
-
-
+
-
-
-
+
-
-
-
+
@@ -637,45 +577,16 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
+
-
-
-
-
-
-
-
-
-
-
+
-
-
-
+
@@ -698,41 +609,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -740,13 +616,132 @@
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 37973716..62353b01 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,7 +1,12 @@
+## 1.0.1
+
+- Fixed Unable to load initialFile on iOS #56
+- Some code cleanup
+
## 1.0.0
Breaking changes:
-- Fixed [Flutter AndroidX compatibility](https://flutter.dev/docs/development/packages-and-plugins/androidx-compatibility), the latest version that doesn't use `AndroidX` is `0.6.0`.
+- Fixed [Flutter AndroidX compatibility](https://flutter.dev/docs/development/packages-and-plugins/androidx-compatibility), the latest version that doesn't use `AndroidX` is `0.6.0` (thanks to [juicycleff](https://github.com/juicycleff)).
## 0.6.0
diff --git a/README.md b/README.md
index ffd6b5bd..16e9a5c3 100644
--- a/README.md
+++ b/README.md
@@ -13,6 +13,8 @@ This plugin is inspired by the popular [cordova-plugin-inappbrowser](https://git
### Requirements
- Dart sdk: ">=2.1.0-dev.7.1 <3.0.0"
- Flutter: ">=0.10.1 <2.0.0"
+- Android: `minSdkVersion 17`
+- iOS: `--ios-language swift`
### Note for Android
During the build, if Android fails with `Error: uses-sdk:minSdkVersion 16 cannot be smaller than version 17 declared in library`, it means that you need to update the `minSdkVersion` of your `build.gradle` file to at least `17`.
diff --git a/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/FlutterWebView.java b/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/FlutterWebView.java
index 287449be..badf13b6 100644
--- a/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/FlutterWebView.java
+++ b/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/FlutterWebView.java
@@ -128,8 +128,7 @@ public class FlutterWebView implements PlatformView, MethodCallHandler {
case "injectScriptCode":
if (webView != null) {
source = call.argument("source").toString();
- jsWrapper = "(function(){return JSON.stringify(eval(%s));})();";
- webView.injectDeferredObject(source, jsWrapper, result);
+ webView.injectScriptCode(source, result);
}
else {
result.success("");
@@ -138,24 +137,21 @@ public class FlutterWebView implements PlatformView, MethodCallHandler {
case "injectScriptFile":
if (webView != null) {
urlFile = call.argument("urlFile").toString();
- jsWrapper = "(function(d) { var c = d.createElement('script'); c.src = %s; d.body.appendChild(c); })(document);";
- webView.injectDeferredObject(urlFile, jsWrapper, null);
+ webView.injectScriptFile(urlFile);
}
result.success(true);
break;
case "injectStyleCode":
if (webView != null) {
source = call.argument("source").toString();
- jsWrapper = "(function(d) { var c = d.createElement('style'); c.innerHTML = %s; d.body.appendChild(c); })(document);";
- webView.injectDeferredObject(source, jsWrapper, null);
+ webView.injectStyleCode(source);
}
result.success(true);
break;
case "injectStyleFile":
if (webView != null) {
urlFile = call.argument("urlFile").toString();
- jsWrapper = "(function(d) { var c = d.createElement('link'); c.rel='stylesheet'; c.type='text/css'; c.href = %s; d.head.appendChild(c); })(document);";
- webView.injectDeferredObject(urlFile, jsWrapper, null);
+ webView.injectStyleFile(urlFile);
}
result.success(true);
break;
diff --git a/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppBrowserActivity.java b/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppBrowserActivity.java
index bc96459d..e7c5b837 100644
--- a/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppBrowserActivity.java
+++ b/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppBrowserActivity.java
@@ -198,7 +198,7 @@ public class InAppBrowserActivity extends AppCompatActivity {
if (webView != null) {
webView.loadUrl(url, result);
} else {
- result.error(LOG_TAG, "Cannot load url " + url, null);
+ result.error(LOG_TAG, "webView is null", null);
}
}
@@ -206,7 +206,7 @@ public class InAppBrowserActivity extends AppCompatActivity {
if (webView != null) {
webView.loadUrl(url, headers, result);
} else {
- result.error(LOG_TAG, "Cannot load url " + url, null);
+ result.error(LOG_TAG, "webView is null", null);
}
}
@@ -214,7 +214,7 @@ public class InAppBrowserActivity extends AppCompatActivity {
if (webView != null) {
webView.postUrl(url, postData, result);
} else {
- result.error(LOG_TAG, "Cannot load url " + url, null);
+ result.error(LOG_TAG, "webView is null", null);
}
}
@@ -222,7 +222,7 @@ public class InAppBrowserActivity extends AppCompatActivity {
if (webView != null) {
webView.loadData(data, mimeType, encoding, baseUrl, result);
} else {
- result.error(LOG_TAG, "Cannot load data", null);
+ result.error(LOG_TAG, "webView is null", null);
}
}
@@ -230,7 +230,7 @@ public class InAppBrowserActivity extends AppCompatActivity {
if (webView != null) {
webView.loadFile(url, result);
} else {
- result.error(LOG_TAG, "Cannot load file " + url, null);
+ result.error(LOG_TAG, "webView is null", null);
}
}
@@ -238,7 +238,7 @@ public class InAppBrowserActivity extends AppCompatActivity {
if (webView != null) {
webView.loadFile(url, headers, result);
} else {
- result.error(LOG_TAG, "Cannot load file " + url, null);
+ result.error(LOG_TAG, "webView is null", null);
}
}
@@ -420,13 +420,28 @@ public class InAppBrowserActivity extends AppCompatActivity {
return optionsMap;
}
- public void injectDeferredObject(String source, String jsWrapper, MethodChannel.Result result) {
+ public void injectScriptCode(String source, MethodChannel.Result result) {
if (webView != null)
- webView.injectDeferredObject(source, jsWrapper, result);
+ webView.injectScriptCode(source, result);
else
result.success("");
}
+ public void injectScriptFile(String urlFile) {
+ if (webView != null)
+ webView.injectScriptFile(urlFile);
+ }
+
+ public void injectStyleCode(String source) {
+ if (webView != null)
+ webView.injectStyleCode(source);
+ }
+
+ public void injectStyleFile(String urlFile) {
+ if (webView != null)
+ webView.injectStyleFile(urlFile);
+ }
+
public HashMap getCopyBackForwardList() {
if (webView != null)
return webView.getCopyBackForwardList();
diff --git a/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppBrowserFlutterPlugin.java b/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppBrowserFlutterPlugin.java
index edabeadd..83fe334a 100644
--- a/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppBrowserFlutterPlugin.java
+++ b/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppBrowserFlutterPlugin.java
@@ -212,25 +212,21 @@ public class InAppBrowserFlutterPlugin implements MethodCallHandler {
break;
case "injectScriptCode":
source = call.argument("source").toString();
- jsWrapper = "(function(){return JSON.stringify(eval(%s));})();";
- injectDeferredObject(uuid, source, jsWrapper, result);
+ injectScriptCode(uuid, source, result);
break;
case "injectScriptFile":
urlFile = call.argument("urlFile").toString();
- jsWrapper = "(function(d) { var c = d.createElement('script'); c.src = %s; d.body.appendChild(c); })(document);";
- injectDeferredObject(uuid, urlFile, jsWrapper, null);
+ injectScriptFile(uuid, urlFile);
result.success(true);
break;
case "injectStyleCode":
source = call.argument("source").toString();
- jsWrapper = "(function(d) { var c = d.createElement('style'); c.innerHTML = %s; d.body.appendChild(c); })(document);";
- injectDeferredObject(uuid, source, jsWrapper, null);
+ injectStyleCode(uuid, source);
result.success(true);
break;
case "injectStyleFile":
urlFile = call.argument("urlFile").toString();
- jsWrapper = "(function(d) { var c = d.createElement('link'); c.rel='stylesheet'; c.type='text/css'; c.href = %s; d.head.appendChild(c); })(document);";
- injectDeferredObject(uuid, urlFile, jsWrapper, null);
+ injectStyleFile(uuid, urlFile);
result.success(true);
break;
case "show":
@@ -307,12 +303,33 @@ public class InAppBrowserFlutterPlugin implements MethodCallHandler {
}
- private void injectDeferredObject(String uuid, String source, String jsWrapper, final Result result) {
+ private void injectScriptCode(String uuid, String source, final Result result) {
final InAppBrowserActivity inAppBrowserActivity = webViewActivities.get(uuid);
if (inAppBrowserActivity != null) {
- inAppBrowserActivity.injectDeferredObject(source, jsWrapper, result);
+ inAppBrowserActivity.injectScriptCode(source, result);
} else {
- Log.d(LOG_TAG, "Can't inject code into the system browser");
+ Log.d(LOG_TAG, "webView is null");
+ }
+ }
+
+ private void injectScriptFile(String uuid, String urlFile) {
+ final InAppBrowserActivity inAppBrowserActivity = webViewActivities.get(uuid);
+ if (inAppBrowserActivity != null) {
+ inAppBrowserActivity.injectScriptFile(urlFile);
+ }
+ }
+
+ private void injectStyleCode(String uuid, String source) {
+ final InAppBrowserActivity inAppBrowserActivity = webViewActivities.get(uuid);
+ if (inAppBrowserActivity != null) {
+ inAppBrowserActivity.injectStyleCode(source);
+ }
+ }
+
+ private void injectStyleFile(String uuid, String urlFile) {
+ final InAppBrowserActivity inAppBrowserActivity = webViewActivities.get(uuid);
+ if (inAppBrowserActivity != null) {
+ inAppBrowserActivity.injectStyleFile(urlFile);
}
}
diff --git a/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppWebView/InAppWebView.java b/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppWebView/InAppWebView.java
index d234b141..6fd2c575 100644
--- a/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppWebView/InAppWebView.java
+++ b/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppWebView/InAppWebView.java
@@ -406,6 +406,26 @@ public class InAppWebView extends WebView {
});
}
+ public void injectScriptCode(String source, MethodChannel.Result result) {
+ String jsWrapper = "(function(){return JSON.stringify(eval(%s));})();";
+ injectDeferredObject(source, jsWrapper, result);
+ }
+
+ public void injectScriptFile(String urlFile) {
+ String jsWrapper = "(function(d) { var c = d.createElement('script'); c.src = %s; d.body.appendChild(c); })(document);";
+ injectDeferredObject(urlFile, jsWrapper, null);
+ }
+
+ public void injectStyleCode(String source) {
+ String jsWrapper = "(function(d) { var c = d.createElement('style'); c.innerHTML = %s; d.body.appendChild(c); })(document);";
+ injectDeferredObject(source, jsWrapper, null);
+ }
+
+ public void injectStyleFile(String urlFile) {
+ String jsWrapper = "(function(d) { var c = d.createElement('link'); c.rel='stylesheet'; c.type='text/css'; c.href = %s; d.head.appendChild(c); })(document);";
+ injectDeferredObject(urlFile, jsWrapper, null);
+ }
+
public HashMap getCopyBackForwardList() {
WebBackForwardList currentList = copyBackForwardList();
int currentSize = currentList.getSize();
diff --git a/example/assets/index.html b/example/assets/index.html
index 30a1709a..c4d3df1a 100644
--- a/example/assets/index.html
+++ b/example/assets/index.html
@@ -16,13 +16,13 @@
- One of three columns
+
PAGE 1
- One of three columns
+
PAGE 2
- One of three columns
+
PAGE 3
diff --git a/example/assets/page-1.html b/example/assets/page-1.html
new file mode 100644
index 00000000..5f0d6c83
--- /dev/null
+++ b/example/assets/page-1.html
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+ Document
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/example/assets/page-2.html b/example/assets/page-2.html
new file mode 100644
index 00000000..30dccff6
--- /dev/null
+++ b/example/assets/page-2.html
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+ Document
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/example/assets/page-3.html b/example/assets/page-3.html
new file mode 100644
index 00000000..74ac9753
--- /dev/null
+++ b/example/assets/page-3.html
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+ Document
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj
index 3e370621..49f29988 100644
--- a/example/ios/Runner.xcodeproj/project.pbxproj
+++ b/example/ios/Runner.xcodeproj/project.pbxproj
@@ -9,7 +9,6 @@
/* Begin PBXBuildFile section */
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
25A517508F43E58C47090625 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E8D91E403808A7540F18B75D /* Pods_Runner.framework */; };
- 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */ = {isa = PBXBuildFile; fileRef = 2D5378251FAA1A9400D5DBA9 /* flutter_assets */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; };
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
@@ -39,7 +38,6 @@
/* Begin PBXFileReference section */
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; };
- 2D5378251FAA1A9400D5DBA9 /* flutter_assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = flutter_assets; path = Flutter/flutter_assets; sourceTree = SOURCE_ROOT; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; };
3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; };
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; };
@@ -88,7 +86,6 @@
9740EEB11CF90186004384FC /* Flutter */ = {
isa = PBXGroup;
children = (
- 2D5378251FAA1A9400D5DBA9 /* flutter_assets */,
3B80C3931E831B6300D905FE /* App.framework */,
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
9740EEBA1CF902C7004384FC /* Flutter.framework */,
@@ -209,7 +206,6 @@
EDC1147F21735BC200D2247A /* Main.storyboard in Resources */,
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
- 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/example/lib/chrome_safari_example.screen.dart b/example/lib/chrome_safari_example.screen.dart
index 93b21f94..1a7255e9 100644
--- a/example/lib/chrome_safari_example.screen.dart
+++ b/example/lib/chrome_safari_example.screen.dart
@@ -38,7 +38,7 @@ class _ChromeSafariExampleScreenState extends State {
return new Center(
child: new RaisedButton(
onPressed: () async {
- await widget.browser.open("https://flutter.io/");
+ await widget.browser.open("https://flutter.dev/");
},
child: Text("Open Chrome Safari Browser")),
);
diff --git a/example/lib/inline_example.screen.dart b/example/lib/inline_example.screen.dart
index d152ac84..989cb6dc 100644
--- a/example/lib/inline_example.screen.dart
+++ b/example/lib/inline_example.screen.dart
@@ -40,9 +40,12 @@ class _InlineExampleScreenState extends State {
decoration:
BoxDecoration(border: Border.all(color: Colors.blueAccent)),
child: InAppWebView(
- initialUrl: "https://flutter.io/",
+ initialUrl: "https://flutter.dev/",
initialHeaders: {},
- initialOptions: {},
+ initialOptions: {
+ "useShouldOverrideUrlLoading": true,
+ "useOnLoadResource": true
+ },
onWebViewCreated: (InAppWebViewController controller) {
webView = controller;
},
@@ -52,12 +55,22 @@ class _InlineExampleScreenState extends State {
this.url = url;
});
},
+ onLoadStop: (InAppWebViewController controller, String url) {
+ print("stopped $url");
+ },
onProgressChanged:
(InAppWebViewController controller, int progress) {
setState(() {
this.progress = progress / 100;
});
},
+ shouldOverrideUrlLoading: (InAppWebViewController controller, String url) {
+ print("override $url");
+ controller.loadUrl(url);
+ },
+ onLoadResource: (InAppWebViewController controller, WebResourceResponse response, WebResourceRequest request) {
+ print("resource " + request.url);
+ }
),
),
),
diff --git a/example/lib/main.dart b/example/lib/main.dart
index 8d58463e..515d300a 100644
--- a/example/lib/main.dart
+++ b/example/lib/main.dart
@@ -5,7 +5,10 @@ import 'package:flutter_inappbrowser_example/chrome_safari_example.screen.dart';
import 'package:flutter_inappbrowser_example/inline_example.screen.dart';
import 'package:flutter_inappbrowser_example/webview_example.screen.dart';
+// InAppLocalhostServer localhostServer = new InAppLocalhostServer();
+
Future main() async {
+ // await localhostServer.start();
runApp(new MyApp());
}
diff --git a/example/lib/webview_example.screen.dart b/example/lib/webview_example.screen.dart
index b27ea888..54c98e7b 100644
--- a/example/lib/webview_example.screen.dart
+++ b/example/lib/webview_example.screen.dart
@@ -65,7 +65,7 @@ class MyInappBrowser extends InAppBrowser {
}
class WebviewExampleScreen extends StatefulWidget {
- final InAppBrowser browser = new MyInappBrowser();
+ final MyInappBrowser browser = new MyInappBrowser();
@override
_WebviewExampleScreenState createState() => new _WebviewExampleScreenState();
}
@@ -81,7 +81,10 @@ class _WebviewExampleScreenState extends State {
return new Center(
child: new RaisedButton(
onPressed: () {
- widget.browser.open(url:"https://flutter.io/");
+ widget.browser.open(url: "https://flutter.dev/", options: {
+ "useShouldOverrideUrlLoading": true,
+ "useOnLoadResource": true
+ });
},
child: Text("Open Webview Browser")),
);
diff --git a/example/pubspec.yaml b/example/pubspec.yaml
index 3d53c971..8ec2d08e 100644
--- a/example/pubspec.yaml
+++ b/example/pubspec.yaml
@@ -40,6 +40,9 @@ flutter:
assets:
- assets/index.html
+ - assets/page-1.html
+ - assets/page-2.html
+ - assets/page-3.html
- assets/css/
- assets/images/
diff --git a/flutter_inappbrowser.iml b/flutter_inappbrowser.iml
index 456cf06e..79687838 100644
--- a/flutter_inappbrowser.iml
+++ b/flutter_inappbrowser.iml
@@ -20,6 +20,8 @@
+
+
diff --git a/ios/Classes/FlutterWebViewController.swift b/ios/Classes/FlutterWebViewController.swift
index db495150..2fc7eb92 100644
--- a/ios/Classes/FlutterWebViewController.swift
+++ b/ios/Classes/FlutterWebViewController.swift
@@ -24,7 +24,7 @@ public class FlutterWebViewController: NSObject, FlutterPlatformView {
self.channel = FlutterMethodChannel(name: channelName, binaryMessenger: registrar.messenger())
self.channel?.setMethodCallHandler(self.handle)
- var initialUrl = (args["initialUrl"] as? String)!
+ let initialUrl = (args["initialUrl"] as? String)!
let initialFile = args["initialFile"] as? String
let initialData = args["initialData"] as? [String: String]
let initialHeaders = (args["initialHeaders"] as? [String: String])!
@@ -134,35 +134,29 @@ public class FlutterWebViewController: NSObject, FlutterPlatformView {
webView!.injectScriptCode(source: source, result: result)
}
else {
- result(false)
+ result("")
}
break
case "injectScriptFile":
if webView != nil {
let urlFile = (arguments!["urlFile"] as? String)!
- webView!.injectScriptFile(urlFile: urlFile, result: result)
- }
- else {
- result(false)
+ webView!.injectScriptFile(urlFile: urlFile)
}
+ result(true)
break
case "injectStyleCode":
if webView != nil {
let source = (arguments!["source"] as? String)!
- webView!.injectStyleCode(source: source, result: result)
- }
- else {
- result(false)
+ webView!.injectStyleCode(source: source)
}
+ result(true)
break
case "injectStyleFile":
if webView != nil {
let urlFile = (arguments!["urlFile"] as? String)!
- webView!.injectStyleFile(urlFile: urlFile, result: result)
- }
- else {
- result(false)
+ webView!.injectStyleFile(urlFile: urlFile)
}
+ result(true)
break
case "reload":
if webView != nil {
diff --git a/ios/Classes/InAppBrowserWebViewController.swift b/ios/Classes/InAppBrowserWebViewController.swift
index f8f43ab6..ea2696e9 100644
--- a/ios/Classes/InAppBrowserWebViewController.swift
+++ b/ios/Classes/InAppBrowserWebViewController.swift
@@ -154,7 +154,7 @@ class InAppBrowserWebViewController: UIViewController, UIScrollViewDelegate, WKU
loadUrl(url: self.initURL!, headers: self.initHeaders)
}
else {
- loadData(data: initData!, mimeType: initMimeType!, encoding: initEncoding!, baseUrl: initBaseUrl!)
+ webView.loadData(data: initData!, mimeType: initMimeType!, encoding: initEncoding!, baseUrl: initBaseUrl!)
}
navigationDelegate?.onBrowserCreated(uuid: uuid, webView: webView)
@@ -225,16 +225,6 @@ class InAppBrowserWebViewController: UIViewController, UIScrollViewDelegate, WKU
updateUrlTextField(url: (webView.currentURL?.absoluteString)!)
}
- func loadData(data: String, mimeType: String, encoding: String, baseUrl: String) {
- webView.loadData(data: data, mimeType: mimeType, encoding: encoding, baseUrl: baseUrl)
- }
-
- func postUrl(url: URL, postData: Data, result: @escaping FlutterResult) {
- webView.postUrl(url: url, postData: postData, completionHandler: { () -> Void in
- result(true)
- })
- }
-
// Load user requested url
func textFieldShouldReturn(_ textField: UITextField) -> Bool {
textField.resignFirstResponder()
diff --git a/ios/Classes/InAppWebView.swift b/ios/Classes/InAppWebView.swift
index 5e3d0b4b..0adaad41 100644
--- a/ios/Classes/InAppWebView.swift
+++ b/ios/Classes/InAppWebView.swift
@@ -279,8 +279,7 @@ public class InAppWebView: WKWebView, UIScrollViewDelegate, WKUIDelegate, WKNavi
if assetURL == nil {
throw NSError(domain: url + " asset file cannot be found!", code: 0)
}
- let absoluteUrl = URL(string: url)!.absoluteURL
- loadUrl(url: absoluteUrl, headers: headers)
+ loadUrl(url: assetURL!, headers: headers)
}
func setOptions(newOptions: InAppWebViewOptions, newOptionsMap: [String: Any]) {
@@ -440,19 +439,19 @@ public class InAppWebView: WKWebView, UIScrollViewDelegate, WKUIDelegate, WKNavi
injectDeferredObject(source: source, withWrapper: jsWrapper, result: result)
}
- public func injectScriptFile(urlFile: String, result: FlutterResult?) {
+ public func injectScriptFile(urlFile: String) {
let jsWrapper = "(function(d) { var c = d.createElement('script'); c.src = %@; d.body.appendChild(c); })(document);"
- injectDeferredObject(source: urlFile, withWrapper: jsWrapper, result: result)
+ injectDeferredObject(source: urlFile, withWrapper: jsWrapper, result: nil)
}
- public func injectStyleCode(source: String, result: FlutterResult?) {
+ public func injectStyleCode(source: String) {
let jsWrapper = "(function(d) { var c = d.createElement('style'); c.innerHTML = %@; d.body.appendChild(c); })(document);"
- injectDeferredObject(source: source, withWrapper: jsWrapper, result: result)
+ injectDeferredObject(source: source, withWrapper: jsWrapper, result: nil)
}
- public func injectStyleFile(urlFile: String, result: FlutterResult?) {
+ public func injectStyleFile(urlFile: String) {
let jsWrapper = "(function(d) { var c = d.createElement('link'); c.rel='stylesheet', c.type='text/css'; c.href = %@; d.body.appendChild(c); })(document);"
- injectDeferredObject(source: urlFile, withWrapper: jsWrapper, result: result)
+ injectDeferredObject(source: urlFile, withWrapper: jsWrapper, result: nil)
}
public func getCopyBackForwardList() -> [String: Any] {
diff --git a/ios/Classes/SwiftFlutterPlugin.swift b/ios/Classes/SwiftFlutterPlugin.swift
index ad5af94e..e2f9a80b 100644
--- a/ios/Classes/SwiftFlutterPlugin.swift
+++ b/ios/Classes/SwiftFlutterPlugin.swift
@@ -198,15 +198,15 @@ public class SwiftFlutterPlugin: NSObject, FlutterPlugin {
self.injectScriptCode(uuid: uuid, arguments: arguments!, result: result)
break
case "injectScriptFile":
- self.injectScriptFile(uuid: uuid, arguments: arguments!, result: nil)
+ self.injectScriptFile(uuid: uuid, arguments: arguments!)
result(true)
break
case "injectStyleCode":
- self.injectStyleCode(uuid: uuid, arguments: arguments!, result: nil)
+ self.injectStyleCode(uuid: uuid, arguments: arguments!)
result(true)
break
case "injectStyleFile":
- self.injectStyleFile(uuid: uuid, arguments: arguments!, result: nil)
+ self.injectStyleFile(uuid: uuid, arguments: arguments!)
result(true)
break
case "takeScreenshot":
@@ -496,7 +496,7 @@ public class SwiftFlutterPlugin: NSObject, FlutterPlugin {
if browserOptions.hidden {
webViewController.view.isHidden = true
tmpController.present(webViewController, animated: false, completion: {() -> Void in
- webViewController.loadData(data: data, mimeType: mimeType, encoding: encoding, baseUrl: baseUrl)
+ webViewController.webView.loadData(data: data, mimeType: mimeType, encoding: encoding, baseUrl: baseUrl)
})
webViewController.presentingViewController?.dismiss(animated: false, completion: {() -> Void in
self.tmpWindow?.windowLevel = 0.0
@@ -505,66 +505,23 @@ public class SwiftFlutterPlugin: NSObject, FlutterPlugin {
}
else {
tmpController.present(webViewController, animated: true, completion: {() -> Void in
- webViewController.loadData(data: data, mimeType: mimeType, encoding: encoding, baseUrl: baseUrl)
+ webViewController.webView.loadData(data: data, mimeType: mimeType, encoding: encoding, baseUrl: baseUrl)
})
}
}
- public func loadUrl(uuid: String, arguments: NSDictionary, result: @escaping FlutterResult) {
- let webViewController: InAppBrowserWebViewController = self.webViewControllers[uuid] as! InAppBrowserWebViewController
- if let url = arguments["url"] as? String {
- let headers = (arguments["headers"] as? [String: String])!
- let absoluteUrl = URL(string: url)!.absoluteURL
- webViewController.loadUrl(url: absoluteUrl, headers: headers)
- }
- else {
- result(FlutterError(code: "InAppBrowserFlutterPlugin", message: "url is empty", details: nil))
+ func open(inSystem url: URL, result: @escaping FlutterResult) {
+ if !UIApplication.shared.canOpenURL(url) {
+ result(FlutterError(code: "InAppBrowserFlutterPlugin", message: url.absoluteString + " cannot be opened!", details: nil))
return
}
- result(true)
- }
-
- public func loadData(uuid: String, arguments: NSDictionary, result: @escaping FlutterResult) {
- let webViewController: InAppBrowserWebViewController = self.webViewControllers[uuid] as! InAppBrowserWebViewController
- let data = (arguments["data"] as? String)!
- let mimeType = (arguments["mimeType"] as? String)!
- let encoding = (arguments["encoding"] as? String)!
- let baseUrl = (arguments["baseUrl"] as? String)!
- webViewController.loadData(data: data, mimeType: mimeType, encoding: encoding, baseUrl: baseUrl)
- result(true)
- }
-
- public func postUrl(uuid: String, arguments: NSDictionary, result: @escaping FlutterResult) {
- let webViewController: InAppBrowserWebViewController = self.webViewControllers[uuid] as! InAppBrowserWebViewController
- if let url = arguments["url"] as? String {
- let postData = (arguments["postData"] as? FlutterStandardTypedData)!
- let absoluteUrl = URL(string: url)!.absoluteURL
- webViewController.postUrl(url: absoluteUrl, postData: postData.data, result: result)
- }
else {
- result(FlutterError(code: "InAppBrowserFlutterPlugin", message: "url is empty", details: nil))
- return
- }
- }
-
- public func loadFile(uuid: String, arguments: NSDictionary, result: @escaping FlutterResult) {
- let webViewController: InAppBrowserWebViewController = self.webViewControllers[uuid] as! InAppBrowserWebViewController
- if let url = arguments["url"] as? String {
- let headers = (arguments["headers"] as? [String: String])!
-
- let key = SwiftFlutterPlugin.registrar!.lookupKey(forAsset: url)
- let assetURL = Bundle.main.url(forResource: key, withExtension: nil)
- if assetURL == nil {
- result(FlutterError(code: "InAppBrowserFlutterPlugin", message: url + " asset file cannot be found!", details: nil))
- return
+ if #available(iOS 10.0, *) {
+ UIApplication.shared.open(url, options: [:], completionHandler: nil)
+ } else {
+ UIApplication.shared.openURL(url)
}
- let absoluteUrl = URL(string: url)!.absoluteURL
- webViewController.loadUrl(url: absoluteUrl, headers: headers)
- }
- else {
- result(FlutterError(code: "InAppBrowserFlutterPlugin", message: "url is empty", details: nil))
- return
}
result(true)
}
@@ -616,88 +573,106 @@ public class SwiftFlutterPlugin: NSObject, FlutterPlugin {
}
}
- func open(inSystem url: URL, result: @escaping FlutterResult) {
- if !UIApplication.shared.canOpenURL(url) {
- result(FlutterError(code: "InAppBrowserFlutterPlugin", message: url.absoluteString + " cannot be opened!", details: nil))
- return
+ public func loadUrl(uuid: String, arguments: NSDictionary, result: @escaping FlutterResult) {
+ if let webViewController = self.webViewControllers[uuid] {
+ if let url = arguments["url"] as? String {
+ let headers = (arguments["headers"] as? [String: String])!
+ let absoluteUrl = URL(string: url)!.absoluteURL
+ webViewController!.loadUrl(url: absoluteUrl, headers: headers)
+ }
+ else {
+ result(FlutterError(code: "InAppBrowserFlutterPlugin", message: "url is empty", details: nil))
+ return
+ }
+ result(true)
}
else {
- if #available(iOS 10.0, *) {
- UIApplication.shared.open(url, options: [:], completionHandler: nil)
- } else {
- UIApplication.shared.openURL(url)
- }
+ result(FlutterError(code: "InAppBrowserFlutterPlugin", message: "webView is null", details: nil))
}
- result(true)
}
- // This is a helper method for the inject{Script|Style}{Code|File} API calls, which
- // provides a consistent method for injecting JavaScript code into the document.
- //
- // If a wrapper string is supplied, then the source string will be JSON-encoded (adding
- // quotes) and wrapped using string formatting. (The wrapper string should have a single
- // '%@' marker).
- //
- // If no wrapper is supplied, then the source string is executed directly.
- func injectDeferredObject(uuid: String, source: String, withWrapper jsWrapper: String, result: FlutterResult?) {
+ public func loadData(uuid: String, arguments: NSDictionary, result: @escaping FlutterResult) {
if let webViewController = self.webViewControllers[uuid] {
- let jsonData: Data? = try? JSONSerialization.data(withJSONObject: [source], options: [])
- let sourceArrayString = String(data: jsonData!, encoding: String.Encoding.utf8)
- if sourceArrayString != nil {
- let sourceString: String? = (sourceArrayString! as NSString).substring(with: NSRange(location: 1, length: (sourceArrayString?.count ?? 0) - 2))
- let jsToInject = String(format: jsWrapper, sourceString!)
-
- webViewController?.webView?.evaluateJavaScript(jsToInject, completionHandler: {(value, error) in
- if result == nil {
- return
- }
-
- if error != nil {
- let userInfo = (error! as NSError).userInfo
- self.onConsoleMessage(uuid: uuid, sourceURL: (userInfo["WKJavaScriptExceptionSourceURL"] as? URL)?.absoluteString ?? "", lineNumber: userInfo["WKJavaScriptExceptionLineNumber"] as! Int, message: userInfo["WKJavaScriptExceptionMessage"] as! String, messageLevel: "ERROR")
- }
-
- if value == nil {
- result!("")
- return
- }
-
- do {
- let data: Data = ("[" + String(describing: value!) + "]").data(using: String.Encoding.utf8, allowLossyConversion: false)!
- let json: Array = try JSONSerialization.jsonObject(with: data, options: []) as! Array
- if json[0] is String {
- result!(json[0])
- }
- else {
- result!(value)
- }
- } catch let error as NSError {
- result!(FlutterError(code: "InAppBrowserFlutterPlugin", message: "Failed to load: \(error.localizedDescription)", details: error))
- }
-
+ let data = (arguments["data"] as? String)!
+ let mimeType = (arguments["mimeType"] as? String)!
+ let encoding = (arguments["encoding"] as? String)!
+ let baseUrl = (arguments["baseUrl"] as? String)!
+ webViewController!.webView.loadData(data: data, mimeType: mimeType, encoding: encoding, baseUrl: baseUrl)
+ result(true)
+ }
+ else {
+ result(FlutterError(code: "InAppBrowserFlutterPlugin", message: "webView is null", details: nil))
+ }
+ }
+
+ public func postUrl(uuid: String, arguments: NSDictionary, result: @escaping FlutterResult) {
+ if let webViewController = self.webViewControllers[uuid] {
+ if let url = arguments["url"] as? String {
+ let postData = (arguments["postData"] as? FlutterStandardTypedData)!
+ let absoluteUrl = URL(string: url)!.absoluteURL
+ webViewController!.webView.postUrl(url: absoluteUrl, postData: postData.data, completionHandler: { () -> Void in
+ result(true)
})
}
+ else {
+ result(FlutterError(code: "InAppBrowserFlutterPlugin", message: "url is empty", details: nil))
+ return
+ }
+ }
+ else {
+ result(FlutterError(code: "InAppBrowserFlutterPlugin", message: "webView is null", details: nil))
}
}
- public func injectScriptCode(uuid: String, arguments: NSDictionary, result: FlutterResult?) {
- let jsWrapper = "(function(){return JSON.stringify(eval(%@));})();"
- injectDeferredObject(uuid: uuid, source: arguments["source"] as! String, withWrapper: jsWrapper, result: result)
+ public func loadFile(uuid: String, arguments: NSDictionary, result: @escaping FlutterResult) {
+ if let webViewController = self.webViewControllers[uuid] {
+ if let url = arguments["url"] as? String {
+ let headers = (arguments["headers"] as? [String: String])!
+ do {
+ try webViewController!.webView.loadFile(url: url, headers: headers)
+ }
+ catch let error as NSError {
+ dump(error)
+ result(FlutterError(code: "InAppBrowserFlutterPlugin", message: error.localizedDescription, details: nil))
+ return
+ }
+ }
+ else {
+ result(FlutterError(code: "InAppBrowserFlutterPlugin", message: "url is empty", details: nil))
+ return
+ }
+ result(true)
+ }
+ else {
+ result(FlutterError(code: "InAppBrowserFlutterPlugin", message: "webView is null", details: nil))
+ }
}
- public func injectScriptFile(uuid: String, arguments: NSDictionary, result: FlutterResult?) {
- let jsWrapper = "(function(d) { var c = d.createElement('script'); c.src = %@; d.body.appendChild(c); })(document);"
- injectDeferredObject(uuid: uuid, source: arguments["urlFile"] as! String, withWrapper: jsWrapper, result: result)
+ public func injectScriptCode(uuid: String, arguments: NSDictionary, result: @escaping FlutterResult) {
+ if let webViewController = self.webViewControllers[uuid] {
+ webViewController!.webView.injectScriptCode(source: arguments["source"] as! String, result: result)
+ }
+ else {
+ result(FlutterError(code: "InAppBrowserFlutterPlugin", message: "webView is null", details: nil))
+ }
}
- public func injectStyleCode(uuid: String, arguments: NSDictionary, result: FlutterResult?) {
- let jsWrapper = "(function(d) { var c = d.createElement('style'); c.innerHTML = %@; d.body.appendChild(c); })(document);"
- injectDeferredObject(uuid: uuid, source: arguments["source"] as! String, withWrapper: jsWrapper, result: result)
+ public func injectScriptFile(uuid: String, arguments: NSDictionary) {
+ if let webViewController = self.webViewControllers[uuid] {
+ webViewController!.webView.injectScriptFile(urlFile: arguments["urlFile"] as! String)
+ }
}
- public func injectStyleFile(uuid: String, arguments: NSDictionary, result: FlutterResult?) {
- let jsWrapper = "(function(d) { var c = d.createElement('link'); c.rel='stylesheet', c.type='text/css'; c.href = %@; d.body.appendChild(c); })(document);"
- injectDeferredObject(uuid: uuid, source: arguments["urlFile"] as! String, withWrapper: jsWrapper, result: result)
+ public func injectStyleCode(uuid: String, arguments: NSDictionary) {
+ if let webViewController = self.webViewControllers[uuid] {
+ webViewController!.webView.injectStyleCode(source: arguments["source"] as! String)
+ }
+ }
+
+ public func injectStyleFile(uuid: String, arguments: NSDictionary) {
+ if let webViewController = self.webViewControllers[uuid] {
+ webViewController!.webView.injectStyleFile(urlFile: arguments["urlFile"] as! String)
+ }
}
func onBrowserCreated(uuid: String, webView: WKWebView) {
@@ -706,84 +681,10 @@ public class SwiftFlutterPlugin: NSObject, FlutterPlugin {
}
}
- func onLoadStart(uuid: String, webView: WKWebView) {
- if let webViewController = self.webViewControllers[uuid] {
- let url: String = webViewController!.webView.currentURL!.absoluteString
- SwiftFlutterPlugin.channel!.invokeMethod("onLoadStart", arguments: ["uuid": uuid, "url": url])
- }
- }
-
- func onLoadStop(uuid: String, webView: WKWebView) {
- if let webViewController = self.webViewControllers[uuid] {
- let url: String = webViewController!.webView.currentURL!.absoluteString
- SwiftFlutterPlugin.channel!.invokeMethod("onLoadStop", arguments: ["uuid": uuid, "url": url])
- }
- }
-
- func onLoadError(uuid: String, webView: WKWebView, error: Error) {
- if let webViewController = self.webViewControllers[uuid] {
- let url: String = webViewController!.webView.currentURL!.absoluteString
- let arguments = ["uuid": uuid, "url": url, "code": error._code, "message": error.localizedDescription] as [String : Any]
- SwiftFlutterPlugin.channel!.invokeMethod("onLoadError", arguments: arguments)
- }
- }
-
- func onProgressChanged(uuid: String, webView: WKWebView, progress: Int) {
- if let webViewController = self.webViewControllers[uuid] {
- SwiftFlutterPlugin.channel!.invokeMethod("onProgressChanged", arguments: ["uuid": uuid, "progress": progress])
- }
- }
-
- func onLoadResource(uuid: String, webView: WKWebView, response: URLResponse, fromRequest request: URLRequest?, withData data: Data, startTime: Int64, duration: Int64) {
- if self.webViewControllers[uuid] != nil {
- var headersResponse = (response as! HTTPURLResponse).allHeaderFields as! [String: String]
- headersResponse.lowercaseKeys()
-
- var headersRequest = request!.allHTTPHeaderFields! as [String: String]
- headersRequest.lowercaseKeys()
-
- let arguments: [String : Any] = [
- "uuid": uuid,
- "response": [
- "url": response.url!.absoluteString,
- "statusCode": (response as! HTTPURLResponse).statusCode,
- "headers": headersResponse,
- "startTime": startTime,
- "duration": duration,
- "data": data
- ],
- "request": [
- "url": request!.url!.absoluteString,
- "headers": headersRequest,
- "method": request!.httpMethod!
- ]
- ]
- SwiftFlutterPlugin.channel!.invokeMethod("onLoadResource", arguments: arguments)
- }
- }
-
- func onScrollChanged(uuid: String, webView: WKWebView, x: Int, y: Int) {
- if let webViewController = self.webViewControllers[uuid] {
- SwiftFlutterPlugin.channel!.invokeMethod("onScrollChanged", arguments: ["uuid": uuid, "x": x, "y": y])
- }
- }
-
func onExit(uuid: String) {
SwiftFlutterPlugin.channel!.invokeMethod("onExit", arguments: ["uuid": uuid])
}
- func shouldOverrideUrlLoading(uuid: String, webView: WKWebView, url: URL) {
- if self.webViewControllers[uuid] != nil {
- SwiftFlutterPlugin.channel!.invokeMethod("shouldOverrideUrlLoading", arguments: ["uuid": uuid, "url": url.absoluteString])
- }
- }
-
- func onConsoleMessage(uuid: String, sourceURL: String, lineNumber: Int, message: String, messageLevel: String) {
- if self.webViewControllers[uuid] != nil {
- SwiftFlutterPlugin.channel!.invokeMethod("onConsoleMessage", arguments: ["uuid": uuid, "sourceURL": sourceURL, "lineNumber": lineNumber, "message": message, "messageLevel": messageLevel])
- }
- }
-
func onChromeSafariBrowserOpened(uuid: String) {
if self.safariViewControllers[uuid] != nil {
SwiftFlutterPlugin.channel!.invokeMethod("onChromeSafariBrowserOpened", arguments: ["uuid": uuid])
@@ -800,10 +701,6 @@ public class SwiftFlutterPlugin: NSObject, FlutterPlugin {
SwiftFlutterPlugin.channel!.invokeMethod("onChromeSafariBrowserClosed", arguments: ["uuid": uuid])
}
- func onCallJsHandler(uuid: String, webView: WKWebView, handlerName: String, args: String) {
- SwiftFlutterPlugin.channel!.invokeMethod("onCallJsHandler", arguments: ["uuid": uuid, "handlerName": handlerName, "args": args])
- }
-
func safariExit(uuid: String) {
if let safariViewController = self.safariViewControllers[uuid] {
if #available(iOS 9.0, *) {
diff --git a/pubspec.yaml b/pubspec.yaml
index e0f05c30..870d8b49 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,6 +1,6 @@
name: flutter_inappbrowser
description: A Flutter plugin that allows you to add an inline webview or open an in-app browser window (inspired by the popular cordova-plugin-inappbrowser).
-version: 1.0.0
+version: 1.0.1
author: Lorenzo Pichilli
homepage: https://github.com/pichillilorenzo/flutter_inappbrowser