HTTPCookieSync is an iOS framework that allows to synchronize cookies between HTTPCookieStorage and WebKit's WKHTTPCookieStore.
- iOS 11.0+
- Swift 5.3+
To integrate using Swift Package Manager perform the following steps:
- Select
File>Swift Packages>Add Package Dependency - Enter
https://github.com/braintree/popup-bridge-iosas the repository URL. - Select
HTTPCookieSync.
Package is automatically linked as a framework to the project's target.
See General > Frameworks, Libraries, and Embedded Content.
To integrate using CocoaPods perform the following steps:
- Integrate CocoaPods to your project
- Add the following line to your
podfile
pod 'HTTPCookieSync'- Create
HTTPCookieSyncerinstance,defaultor custom. - Call
sync()method, when it needed.
let httpCookieSyncer = HTTPCookieSyncer.default
...
httpCookieSyncer.syncStorages {
// cookies were synced
}NOTE: Syncer instance must be stored (for application session) due to synchronization algorithm.
Storages, used for default instances:
let httpCookieSyncer = HTTPCookieSyncer(
storages: [
// Custom cookie storages
]
)You can look at the provided demo application. Check the Demo directory.
Dmytrii Golovanov, Vladyslav Otsevyk, Serhii Reznichenko
Library is available under the MIT license. See the LICENSE file for more info.