-
Notifications
You must be signed in to change notification settings - Fork 934
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Fixed crash with clearCookies - Added flag to toggle full screen mode - Updated README - Updated pubspec.yaml authors section
- Loading branch information
Toufik Zitouni
authored and
Toufik Zitouni
committed
Jun 20, 2017
1 parent
b0d9458
commit 4e3488b
Showing
15 changed files
with
238 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,5 @@ build/ | |
ios/.generated/ | ||
packages | ||
pubspec.lock | ||
|
||
example/ios/Podfile.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
example/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package io.flutter.plugins; | ||
|
||
import io.flutter.plugin.common.PluginRegistry; | ||
import com.flutter_webview_plugin.FlutterWebviewPlugin; | ||
|
||
/** | ||
* Generated file. Do not edit. | ||
*/ | ||
public final class GeneratedPluginRegistrant { | ||
public static void registerWith(PluginRegistry registry) { | ||
FlutterWebviewPlugin.registerWith(registry.registrarFor("com.flutter_webview_plugin.FlutterWebviewPlugin")); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
example/ios/Runner.xcworkspace/xcshareddata/Runner.xcscmblueprint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "089954AE9FE84C565F8189CE7B1E08C8949FC40C", | ||
"DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : { | ||
|
||
}, | ||
"DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : { | ||
"B9BC852104FA5F3F91D8B12EB80D37232CB3B40D" : 9223372036854775807, | ||
"089954AE9FE84C565F8189CE7B1E08C8949FC40C" : 9223372036854775807 | ||
}, | ||
"DVTSourceControlWorkspaceBlueprintIdentifierKey" : "9839F02E-853D-4357-B537-73CD5272EC87", | ||
"DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : { | ||
"B9BC852104FA5F3F91D8B12EB80D37232CB3B40D" : "..\/..\/flutter", | ||
"089954AE9FE84C565F8189CE7B1E08C8949FC40C" : "flutter_webview_plugin\/" | ||
}, | ||
"DVTSourceControlWorkspaceBlueprintNameKey" : "Runner", | ||
"DVTSourceControlWorkspaceBlueprintVersion" : 204, | ||
"DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "example\/ios\/Runner.xcworkspace", | ||
"DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [ | ||
{ | ||
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/dart-flitter\/flutter_webview_plugin.git", | ||
"DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", | ||
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "089954AE9FE84C565F8189CE7B1E08C8949FC40C" | ||
}, | ||
{ | ||
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/flutter\/flutter.git", | ||
"DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", | ||
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "B9BC852104FA5F3F91D8B12EB80D37232CB3B40D" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// | ||
// Generated file. Do not edit. | ||
// | ||
|
||
#ifndef GeneratedPluginRegistrant_h | ||
#define GeneratedPluginRegistrant_h | ||
|
||
#import <Flutter/Flutter.h> | ||
|
||
@interface GeneratedPluginRegistrant : NSObject | ||
+ (void)registerWithRegistry:(NSObject<FlutterPluginRegistry>*)registry; | ||
@end | ||
|
||
#endif /* GeneratedPluginRegistrant_h */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// | ||
// Generated file. Do not edit. | ||
// | ||
|
||
#import "GeneratedPluginRegistrant.h" | ||
#import <flutter_webview_plugin/FlutterWebviewPlugin.h> | ||
|
||
@implementation GeneratedPluginRegistrant | ||
|
||
+ (void)registerWithRegistry:(NSObject<FlutterPluginRegistry>*)registry { | ||
[FlutterWebviewPlugin registerWithRegistrar:[registry registrarForPlugin:@"FlutterWebviewPlugin"]]; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
#import <Flutter/Flutter.h> | ||
#import "WebviewController.h" | ||
|
||
static FlutterMethodChannel *channel; | ||
|
||
@interface FlutterWebviewPlugin : NSObject<FlutterPlugin> | ||
@end | ||
@property (nonatomic, retain) UIViewController *viewController; | ||
@property (nonatomic, retain) WebviewController *webviewController; | ||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// | ||
// WebviewController.h | ||
// Pods | ||
// | ||
// Created by Toufik Zitouni on 6/17/17. | ||
// | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
@interface WebviewController : UIViewController | ||
- (instancetype)initWithUrl:(NSString *)url withJavascript:(NSNumber *)withJavascript clearCache:(NSNumber *)clearCache clearCookes:(NSNumber *)clearCookies fullScreen:(NSNumber *)fullScreen; | ||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
// | ||
// WebviewController.m | ||
// Pods | ||
// | ||
// Created by Toufik Zitouni on 6/17/17. | ||
// | ||
// | ||
|
||
#import "WebviewController.h" | ||
#import "FlutterWebviewPlugin.h" | ||
|
||
@interface WebviewController () | ||
@property (nonatomic, retain) NSString *url; | ||
@property NSNumber *withJavascript; | ||
@property NSNumber *clearCache; | ||
@property NSNumber *clearCookies; | ||
@property NSNumber *fullScreen; | ||
@end | ||
|
||
@implementation WebviewController | ||
|
||
- (instancetype)initWithUrl:(NSString *)url withJavascript:(NSNumber *)withJavascript clearCache:(NSNumber *)clearCache clearCookes:(NSNumber *)clearCookies fullScreen:(NSNumber *)fullScreen { | ||
self = [super init]; | ||
if (self) { | ||
self.url = url; | ||
self.withJavascript = withJavascript; | ||
self.clearCache = clearCache; | ||
self.clearCookies = clearCookies; | ||
self.fullScreen = fullScreen; | ||
} | ||
return self; | ||
} | ||
|
||
- (void)viewDidLoad { | ||
[super viewDidLoad]; | ||
UIBarButtonItem *backButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(backButtonPressed:)]; | ||
self.navigationItem.leftBarButtonItem = backButton; | ||
|
||
UIWebView *webView = [[UIWebView alloc] initWithFrame:self.view.frame]; | ||
|
||
if ([self.clearCache boolValue]) { | ||
[[NSURLCache sharedURLCache] removeAllCachedResponses]; | ||
} | ||
|
||
if ([self.clearCookies boolValue]) { | ||
[[NSURLSession sharedSession] resetWithCompletionHandler:^{ | ||
|
||
}]; | ||
} | ||
|
||
[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:self.url]]]; | ||
|
||
webView.autoresizingMask = UIViewAutoresizingFlexibleWidth; | ||
[self.view addSubview:webView]; | ||
} | ||
|
||
- (void)viewWillAppear:(BOOL)animated { | ||
[super viewWillAppear:animated]; | ||
|
||
if ([self.fullScreen boolValue]) { | ||
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationNone]; | ||
} | ||
} | ||
|
||
- (IBAction)backButtonPressed:(id)sender { | ||
[channel invokeMethod:@"onBackPressed" arguments:nil]; | ||
[self dismissViewControllerAnimated:YES completion:nil]; | ||
} | ||
|
||
- (void)dealloc { | ||
[channel invokeMethod:@"onDestroy" arguments:nil]; | ||
} | ||
|
||
@end |
Oops, something went wrong.