From e18c8c47b067ee5ceb36a7235ca021948a8fef93 Mon Sep 17 00:00:00 2001 From: Jason Safaiyeh Date: Sat, 9 Jan 2021 11:02:34 -0800 Subject: [PATCH] Update README.md (#97) --- README.md | 67 ++++--------------------------------------------------- 1 file changed, 4 insertions(+), 63 deletions(-) diff --git a/README.md b/README.md index c5be956..3962b9a 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ Cookie Manager for React Native This module was ported from [joeferraro/react-native-cookies](https://github.com/joeferraro/react-native-cookies). This would not exist without the work of the original author, [Joe Ferraro](https://github.com/joeferraro). ## Important notices & Breaking Changes +- **v6.0.0**: Package name updated to `@react-native-cookies/cookies`. - **v5.0.0**: Peer Dependency of >= React Native 0.60.2 - **v4.0.0**: Android SDK version bumpted to 21 - **v3.0.0**: Remove React Native Core dependencies, CookieManager.set() support for Android @@ -29,7 +30,7 @@ Currently lacking support for Windows, macOS, and web. Support for these platfor ## Installation ``` -yarn add @react-native-community/cookies +yarn add @react-native-cookies/cookies ``` Then link the native iOS package @@ -38,66 +39,6 @@ Then link the native iOS package npx pod-install ``` -## Setup (React Native < 0.60.0) - -### Automatic (recommended) - -``` -react-native link @react-native-community/cookies -``` - -### Manual - -If automatic linking does not work, you can manually link this library by following the instructions below: - -#### iOS - -1. Open your project in Xcode, right click on `Libraries` and click `Add Files to "Your Project Name"` Look under `node_modules/@react-native-community/cookies/ios` and add `RNCookieManagerIOS.xcodeproj`. -2. Add `libRNCookieManagerIOS.a` to `Build Phases -> Link Binary With Libraries. -3. Clean and rebuild your project - -#### Android - -Run `react-native link` to link the cookies library. - -Or if you have trouble, make the following additions to the given files manually: - -**android/settings.gradle** - -```gradle -include ':@react-native-community_cookies' -project(':@react-native-community_cookies').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-community/cookies/android') -``` - -**android/app/build.gradle** - -```gradle -dependencies { - ... - implementation project(':@react-native-community_cookies') -} -``` - -**MainApplication.java** - -On top, where imports are: - -```java -import com.reactnativecommunity.cookies.CookieManagerPackage; -``` - -Add the `CookieManagerPackage` class to your list of exported packages. - -```java -@Override -protected List getPackages() { - return Arrays.asList( - new MainReactPackage(), - new CookieManagerPackage() - ); -} -``` - ## Usage A cookie object can have one of the following fields: @@ -120,7 +61,7 @@ export interface Cookies { ``` ```javascript -import CookieManager from '@react-native-community/cookies'; +import CookieManager from '@react-native-cookies/cookies'; // set a cookie CookieManager.set('http://example.com', { @@ -201,7 +142,7 @@ To use this _CookieManager_ with WebKit-Support we extended the interface with t ##### Usage ```javascript -import CookieManager from '@react-native-community/cookies'; +import CookieManager from '@react-native-cookies/cookies'; const useWebKit = true;