-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update readme * Update Readme * Update package name * Update pubspec * Add commented line
- Loading branch information
Showing
7 changed files
with
46 additions
and
18 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 |
---|---|---|
|
@@ -19,3 +19,5 @@ doc/api/ | |
*.js_ | ||
*.js.deps | ||
*.js.map | ||
|
||
*.log |
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,3 +1,3 @@ | ||
## 1.0.0 | ||
## 1.0.0+1 | ||
|
||
* initial release. |
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,14 +1,37 @@ | ||
# webview_cookie_manager | ||
# Webview Cookie Manager | ||
[![pub package](https://img.shields.io/pub/v/webview_cookie_manager.svg)](https://pub.dartlang.org/packages/webview_cookie_manager) | ||
|
||
A new flutter plugin project. | ||
A flutter library to manager your web cookies for Android(API level 9) and iOS(11+). | ||
|
||
## Getting Started | ||
## Get started iOS | ||
Set minimum version for iOS to 11.0 | ||
|
||
This project is a starting point for a Flutter | ||
[plug-in package](https://flutter.dev/developing-packages/), | ||
a specialized package that includes platform-specific implementation code for | ||
Android and/or iOS. | ||
## How to use | ||
The WebCookieManager can be used directly or together with [webview_flutter](https://pub.dev/packages/webview_flutter). | ||
|
||
For help getting started with Flutter, view our | ||
[online documentation](https://flutter.dev/docs), which offers tutorials, | ||
samples, guidance on mobile development, and a full API reference. | ||
Get cookies: | ||
```dart | ||
final cookieManager = WebviewCookieManager(); | ||
final gotCookies = await cookieManager.getCookies('https://youtube.com'); | ||
for (var item in gotCookies) { | ||
print(item); | ||
} | ||
``` | ||
|
||
Set cookie | ||
```dart | ||
await cookieManager.setCookies([ | ||
Cookie('cookieName', 'cookieValue') | ||
..domain = 'youtube.com' | ||
..expires = DateTime.now().add(Duration(days: 10)) | ||
]); | ||
``` | ||
Clear cookies | ||
```dart | ||
await cookieManager.clearCookies(); | ||
``` | ||
|
||
For more examples check example folder. | ||
|
||
## How it works | ||
The cookies stores and retrieves using the [httpCookieStore](https://developer.apple.com/documentation/webkit/wkwebsitedatastore/2881956-httpcookiestore) for iOS and [CookieManager](https://developer.android.com/reference/java/net/CookieManager) for Android. |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.example.webview_cookie_manager"> | ||
package="io.flutter.plugins.webview_cookie_manager"> | ||
</manifest> |
2 changes: 1 addition & 1 deletion
2
...e_manager/WebviewCookieManagerPlugin.java → ...e_manager/WebviewCookieManagerPlugin.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
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