diff --git a/README.md b/README.md index 9a9c24b..d327533 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,9 @@ 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 +- v1.1.1 >= will be published to `@react-native-community/cookies`. `@react-native-community/react-native-cookies` is now deprecated as of v1.1.1. + ## Maintainers - [Jason Safaiyeh](https://github.com/safaiyeh) ([Twitter @safaiyeh](https://twitter.com/safaiyeh)) from [Sumo Logic](https://www.sumologic.com) @@ -15,7 +18,7 @@ Currently lacking support for Windows, Web, and Expo. Support for these platform ## Installation ``` -yarn add @react-native-community/react-native-cookies +yarn add @react-native-community/cookies ``` @@ -24,7 +27,7 @@ yarn add @react-native-community/react-native-cookies ### Automatic (recommended) ``` -react-native link @react-native-community/react-native-cookies +react-native link @react-native-community/cookies ``` ### Manual @@ -34,21 +37,21 @@ If automatic linking does not work, you can manually link this library by follow #### 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/react-native-cookies/ios` and add `RNCookieManagerIOS.xcodeproj`. + 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 react-native-cookies library. +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_react-native-cookies' -project(':@react-native-community_react-native-cookies').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-community/react-native-cookies/android') +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** @@ -56,7 +59,7 @@ project(':@react-native-community_react-native-cookies').projectDir = new File(r ```gradle dependencies { ... - implementation project(':@react-native-community_react-native-cookies') + implementation project(':@react-native-community_cookies') } ``` @@ -85,7 +88,7 @@ protected List getPackages() { ## Usage ```javascript -import CookieManager from '@react-native-community/react-native-cookies'; +import CookieManager from '@react-native-community/cookies'; // set a cookie (IOS ONLY) CookieManager.set({ @@ -156,7 +159,7 @@ To use this _CookieManager_ with WebKit-Support we extended the interface with t ##### Usage ```javascript -import CookieManager from '@react-native-community/react-native-cookies'; +import CookieManager from '@react-native-community/cookies'; const useWebKit = true; diff --git a/index.d.ts b/index.d.ts index 61e6a4c..6594d9b 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,4 +1,4 @@ -declare module "@react-native-community/react-native-cookies" { +declare module "@react-native-community/cookies" { export interface Cookie { name: string; value: string; diff --git a/index.js b/index.js index bdce697..6736046 100644 --- a/index.js +++ b/index.js @@ -15,19 +15,19 @@ let CookieManager; if (Platform.OS === 'ios') { invariant( RNCookieManagerIOS, - 'react-native-cookies: Add RNCookieManagerIOS.h and RNCookieManagerIOS.m to your Xcode project', + '@react-native-community/cookies: Add RNCookieManagerIOS.h and RNCookieManagerIOS.m to your Xcode project', ); CookieManager = RNCookieManagerIOS; } else if (Platform.OS === 'android') { invariant( RNCookieManagerAndroid, - 'react-native-cookies: Import libraries to android "react-native link react-native-cookies"', + '@react-native-community/cookies: Import libraries to android "react-native link @react-native-community/cookies"', ); CookieManager = RNCookieManagerAndroid; } else { invariant( CookieManager, - 'react-native-cookies: Invalid platform. This library only supports Android and iOS.', + '@react-native-community/cookies: Invalid platform. This library only supports Android and iOS.', ); } diff --git a/ios/react-native-cookies.podspec b/ios/react-native-cookies.podspec index e2682b8..65afde4 100644 --- a/ios/react-native-cookies.podspec +++ b/ios/react-native-cookies.podspec @@ -9,7 +9,7 @@ Pod::Spec.new do |s| s.homepage = package['homepage'] s.license = package['license'] s.author = "safaiyeh" - s.source = { :git => "git@github.com:react-native-community/react-native-cookies.git", :tag => "v#{s.version}" } + s.source = { :git => "git@github.com:react-native-community/cookies.git", :tag => "v#{s.version}" } s.requires_arc = true s.platform = :ios, "7.0" s.preserve_paths = "*.framework" diff --git a/package.json b/package.json index 0f527e5..8fcb6bc 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,11 @@ { - "name": "@react-native-community/react-native-cookies", + "name": "@react-native-community/cookies", "version": "1.1.1", "description": "Cookie Manager for React Native", "repository": { "type": "git", - "url": "git+https://github.com/react-native-community/react-native-cookies.git", - "baseUrl": "https://github.com/react-native-community/react-native-cookies" + "url": "git+https://github.com/react-native-community/cookies.git", + "baseUrl": "https://github.com/react-native-community/cookies" }, "keywords": [ "react native", @@ -23,9 +23,9 @@ "licenseFilename": "LICENSE", "readmeFilename": "README.md", "bugs": { - "url": "https://github.com/react-native-community/react-native-cookies/issues" + "url": "https://github.com/react-native-community/cookies/issues" }, - "homepage": "https://github.com/react-native-community/react-native-cookies#readme", + "homepage": "https://github.com/react-native-community/cookies#readme", "main": "index.js", "types": "index.d.ts", "scripts": {