Skip to content

Commit 83f8db0

Browse files
committed
Update cleanCookies.
1 parent bf64045 commit 83f8db0

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

android/src/main/java/com/flutter_webview_plugin/FlutterWebviewPlugin.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ public void onMethodCall(MethodCall call, MethodChannel.Result result) {
7474
case "stopLoading":
7575
stopLoading(call, result);
7676
break;
77-
case "cleanCookie":
78-
cleanCookie(call, result);
77+
case "cleanCookies":
78+
cleanCookies(call, result);
7979
break;
8080
default:
8181
result.notImplemented();
@@ -216,7 +216,7 @@ private void show(MethodCall call, final MethodChannel.Result result) {
216216
}
217217
}
218218

219-
private void cleanCookie(MethodCall call, final MethodChannel.Result result) {
219+
private void cleanCookies(MethodCall call, final MethodChannel.Result result) {
220220
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
221221
CookieManager.getInstance().removeAllCookies(new ValueCallback<Boolean>() {
222222
@Override

ios/Classes/FlutterWebviewPlugin.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {
5858
} else if ([@"stopLoading" isEqualToString:call.method]) {
5959
[self stopLoading];
6060
result(nil);
61-
} else if ([@"cleanCookie" isEqualToString:call.method]) {
62-
[self cleanCookie];
61+
} else if ([@"cleanCookies" isEqualToString:call.method]) {
62+
[self cleanCookies];
6363
} else if ([@"back" isEqualToString:call.method]) {
6464
[self back];
6565
result(nil);
@@ -229,7 +229,7 @@ - (void)reload {
229229
}
230230
}
231231

232-
- (void)cleanCookie {
232+
- (void)cleanCookies {
233233
[[NSURLSession sharedSession] resetWithCompletionHandler:^{
234234
}];
235235
}

lib/src/base.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@ class FlutterWebviewPlugin {
176176
await _channel.invokeMethod('reloadUrl', args);
177177
}
178178

179-
// Clean cookie on WebView
180-
Future cleanCookie() async => _channel.invokeMethod('cleanCookie');
179+
// Clean cookies on WebView
180+
Future cleanCookies() async => _channel.invokeMethod('cleanCookies');
181181

182182
// Stops current loading process
183183
Future stopLoading() => _channel.invokeMethod("stopLoading");
@@ -209,8 +209,8 @@ class FlutterWebviewPlugin {
209209

210210
if (cookiesString?.isNotEmpty == true) {
211211
cookiesString.split(';').forEach((String cookie) {
212-
final splited = cookie.split('=');
213-
cookies[splited[0]] = splited[1];
212+
final split = cookie.split('=');
213+
cookies[split[0]] = split[1];
214214
});
215215
}
216216

0 commit comments

Comments
 (0)