Commit c7356f33 authored by pichillilorenzo's avatar pichillilorenzo

fixed WebView.storyboard path for iOS, added v0.3.2

parent 67a7341b
This diff is collapsed.
## 0.3.2
- fixed WebView.storyboard path for iOS
## 0.3.1
- fixed README.md example
......
......@@ -27,6 +27,8 @@ Classes:
Screenshots [here](#screenshots).
### `InAppBrowser` class
Native WebView.
Create a Class that extends the `InAppBrowser` Class in order to override the callbacks to manage the browser events.
Example:
```dart
......@@ -432,6 +434,8 @@ inAppBrowser.removeJavaScriptHandler(String handlerName, int index);
### `ChromeSafariBrowser` class
[Chrome Custom Tabs](https://developer.android.com/reference/android/support/customtabs/package-summary) on Android / [SFSafariViewController](https://developer.apple.com/documentation/safariservices/sfsafariviewcontroller) on iOS.
Create a Class that extends the `ChromeSafariBrowser` Class in order to override the callbacks to manage the browser events. Example:
```dart
import 'package:flutter/material.dart';
......
......@@ -16,10 +16,9 @@
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; };
9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
ED5EF13121506A3E0065FD45 /* WebView.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = ED5EF108214FF6F80065FD45 /* WebView.storyboard */; };
EDC1147F21735BC200D2247A /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
......@@ -55,7 +54,6 @@
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
E8D91E403808A7540F18B75D /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
ED5EF108214FF6F80065FD45 /* WebView.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = WebView.storyboard; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
......@@ -132,7 +130,6 @@
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
ED5EF108214FF6F80065FD45 /* WebView.storyboard */,
);
path = Runner;
sourceTree = "<group>";
......@@ -209,11 +206,10 @@
buildActionMask = 2147483647;
files = (
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
EDC1147F21735BC200D2247A /* Main.storyboard in Resources */,
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
ED5EF13121506A3E0065FD45 /* WebView.storyboard in Resources */,
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */,
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......
......@@ -307,8 +307,8 @@ public class SwiftFlutterPlugin: NSObject, FlutterPlugin {
browserOptions = InAppBrowserOptions()
browserOptions.parse(options: options)
}
let storyboard = UIStoryboard(name: WEBVIEW_STORYBOARD, bundle: nil)
let storyboard = UIStoryboard(name: WEBVIEW_STORYBOARD, bundle: Bundle(for: InAppBrowserFlutterPlugin.self))
let vc = storyboard.instantiateViewController(withIdentifier: WEBVIEW_STORYBOARD_CONTROLLER_ID)
self.webViewControllers[uuid] = vc as? InAppBrowserWebViewController
let webViewController: InAppBrowserWebViewController = self.webViewControllers[uuid] as! InAppBrowserWebViewController
......
......@@ -4,7 +4,7 @@
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<deployment version="2048" identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14283.14"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
......@@ -21,9 +21,6 @@
<rect key="frame" x="0.0" y="0.0" width="414" height="736"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" image="LaunchImage" translatesAutoresizingMaskIntoConstraints="NO" id="5cB-8U-Az3">
<rect key="frame" x="206.66666666666666" y="367.66666666666669" width="1" height="1"/>
</imageView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="gA9-n8-qaQ" customClass="WKWebView_IBWrapper" customModule="flutter_inappbrowser">
<rect key="frame" x="0.0" y="66" width="414" height="626"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
......@@ -71,7 +68,6 @@
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="5cB-8U-Az3" firstAttribute="centerY" secondItem="ISu-6l-aO1" secondAttribute="centerY" id="7gS-HV-ExU"/>
<constraint firstItem="gA9-n8-qaQ" firstAttribute="leading" secondItem="ISu-6l-aO1" secondAttribute="leading" id="8YB-0N-UzE"/>
<constraint firstItem="gA9-n8-qaQ" firstAttribute="trailing" secondItem="ISu-6l-aO1" secondAttribute="trailing" id="Dhn-ga-7dD"/>
<constraint firstItem="gA9-n8-qaQ" firstAttribute="bottom" secondItem="8Pf-5R-cFf" secondAttribute="top" id="KeI-jL-Qoi"/>
......@@ -79,7 +75,6 @@
<constraint firstItem="vlz-kT-71x" firstAttribute="leading" secondItem="gA9-n8-qaQ" secondAttribute="leading" id="OZ2-Kx-4su"/>
<constraint firstItem="gA9-n8-qaQ" firstAttribute="leading" secondItem="8Pf-5R-cFf" secondAttribute="leading" id="RGD-3l-ddR"/>
<constraint firstItem="gA9-n8-qaQ" firstAttribute="top" secondItem="vlz-kT-71x" secondAttribute="bottom" id="Sjd-dV-din"/>
<constraint firstItem="5cB-8U-Az3" firstAttribute="centerX" secondItem="ISu-6l-aO1" secondAttribute="centerX" id="Wh0-qC-IDM"/>
<constraint firstItem="vlz-kT-71x" firstAttribute="trailing" secondItem="gA9-n8-qaQ" secondAttribute="trailing" id="XRo-VA-krE"/>
<constraint firstItem="vlz-kT-71x" firstAttribute="top" secondItem="eCU-xC-qdo" secondAttribute="bottom" id="bWR-2T-bWy"/>
<constraint firstItem="HWt-17-FMf" firstAttribute="centerX" secondItem="gA9-n8-qaQ" secondAttribute="centerX" id="dV8-Dm-9mc"/>
......@@ -107,7 +102,4 @@
<point key="canvasLocation" x="433.33333333333337" y="-217.66304347826087"/>
</scene>
</scenes>
<resources>
<image name="LaunchImage" width="1" height="1"/>
</resources>
</document>
......@@ -13,6 +13,7 @@ A new Flutter plugin.
s.author = { 'Your Company' => 'email@example.com' }
s.source = { :path => '.' }
s.source_files = 'Classes/**/*'
s.resources = 'Storyboards/**/*.storyboard'
s.public_header_files = 'Classes/**/*.h'
s.dependency 'Flutter'
......
......@@ -409,13 +409,16 @@ class InAppBrowser {
}
///Give the host application a chance to take control when a URL is about to be loaded in the current WebView.
///
///**NOTE**: In order to be able to listen this event, you need to set `useShouldOverrideUrlLoading` option to `true`.
void shouldOverrideUrlLoading(String url) {
}
///Event fires when the [InAppBrowser] webview loads a resource.
///
///**NOTE**: In order to be able to listen this event, you need to set `useOnLoadResource` option to `true`.
///
///**NOTE only for iOS**: In some cases, the [response.data] of a [response] with `text/html` encoding could be empty.
void onLoadResource(WebResourceResponse response, WebResourceRequest request) {
......
name: flutter_inappbrowser
description: A Flutter plugin that allows you to open an in-app browser window. (inspired by the popular cordova-plugin-inappbrowser).
version: 0.3.1
version: 0.3.2
author: Lorenzo Pichilli <pichillilorenzo@gmail.com>
homepage: https://github.com/pichillilorenzo/flutter_inappbrowser
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment