Latest 1.0.3
Homepage https://github.com/mkoosun/SafariCookieBridge
License MIT
Platforms ios 7.0
Frameworks UIKit
Authors

SafariCookieBridge can get data from Safari’s Cookie, and also set data to Cookie. Very convenient to transfer data between App and Web, even if App is not installed. You can fetch cookie data after user install your App, and let user continue to do something that he want do in Web Page

Installation

SafariCookieBridge is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "SafariCookieBridge"

Usage

  1. Put cookie.html on your server, for example:

    http://yourserver.com/cookie.html`

  2. Add a scheme to the project, for example:

    myScheme

  3. Call SafariCookieBridge.openURL in AppDelegate.m
-(BOOL)application:(UIApplication *)application openURL:(nonnull NSURL *)url options:(nonnull NSDictionary<NSString *,id> *)options {

    return [SafariCookieBridge openURL:url];
}

Set Cookie

[SafariCookieBridge setCookieWithName:@"userid" value:@"testValue" scheme:@"myScheme" url:@"http://yourserver.com/cookie.html" timeout:30 block:^(BOOL success, NSString *value) {

    if(success)
        NSLog(@"Set cookie success");
    else
        NSLog(@"Set cookie fail");
}];

Get Cookie

[SafariCookieBridge getCookieWithName:@"userid" scheme:@"myScheme" url:@"http://yourserver.com/cookie.html" timeout:10 block:^(BOOL success, NSString *value) {

    if(success && value) {
        NSLog(@"Get cookie userid = %@", value);
    } else {
        NSLog(@"Get cookie fail");
    }
}];

Author

wanglin.sun, [email protected]

License

SafariCookieBridge is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "SafariCookieBridge",
    "version": "1.0.3",
    "summary": "Get and Set data via Safari Cookie",
    "description": "SafariCookieBridge can get data from Safari's Cookie, and also set data to Cookie. Very convenient to transfer data between App and Web, even if App is not installed. You can fetch cookie data after user install your App, and let user continue to do something that he want do in Web Page.",
    "homepage": "https://github.com/mkoosun/SafariCookieBridge",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "wanglin.sun": "[email protected]"
    },
    "source": {
        "git": "https://github.com/mkoosun/SafariCookieBridge.git",
        "tag": "1.0.3"
    },
    "platforms": {
        "ios": "7.0"
    },
    "frameworks": "UIKit",
    "source_files": "SafariCookieBridge/Classes/**/*"
}

Pin It on Pinterest

Share This