Skip to content

Commit

Permalink
Update documentation (#1)
Browse files Browse the repository at this point in the history
* Update readme

* Update Readme

* Update package name

* Update pubspec

* Add commented line
  • Loading branch information
fryette authored Jul 13, 2020
1 parent cdc204c commit 6e37169
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 18 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ doc/api/
*.js_
*.js.deps
*.js.map

*.log
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
## 1.0.0
## 1.0.0+1

* initial release.
43 changes: 33 additions & 10 deletions README.md
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.
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
group 'com.example.webview_cookie_manager'
group 'io.flutter.plugins.webview_cookie_manager'
version '1.0'

buildscript {
Expand Down
2 changes: 1 addition & 1 deletion android/src/main/AndroidManifest.xml
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>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.webview_cookie_manager;
package io.flutter.plugins.webview_cookie_manager;

import androidx.annotation.NonNull;

Expand Down
11 changes: 7 additions & 4 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
name: webview_cookie_manager
description: A new flutter plugin project.
version: 1.0.0+1
author: amag2511
description: Have you been turned into a cookie managment problem? This package can help. It has all of the cookie managment functionality you have been looking for.
version: 1.0.0+2
repository: https://github.com/amag2511/webview_cookie_manager
homepage: https://github.com/amag2511/webview_cookie_manager
issue_tracker: https://github.com/amag2511/webview_cookie_manager/issues
# documentation: link on documentation

environment:
sdk: ">=2.7.0 <3.0.0"
Expand All @@ -19,7 +22,7 @@ flutter:
plugin:
platforms:
android:
package: com.example.webview_cookie_manager
package: io.flutter.plugins.webview_cookie_manager
pluginClass: WebviewCookieManagerPlugin
ios:
pluginClass: WebviewCookieManagerPlugin

0 comments on commit 6e37169

Please sign in to comment.