Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Browncoat/NCCSession

Open more actions menu

Repository files navigation

NCCSession is a session mananger that makes it easy to store sensitive data between sessions in the keychain.

How To Get Started

Communication

  • If you need help, use Stack Overflow. (Tag 'nccsession')
  • If you'd like to ask a general question, use Stack Overflow.
  • If you found a bug, and can provide steps to reliably reproduce it, open an issue.
  • If you have a feature request, open an issue.
  • If you want to contribute, submit a pull request.

Requirements

iOS 5.1+

Usage

To create a session and pass a dictionary to be stored in the keychain

NCCSession *session = [NCCSession createSessionWithUserId:userId userInfo:@{SESSION_TOKEN_NAME:accessToken, 
                                                      SESSION_ID_NAME:sessionId, 
                                                      API_KEY_NAME:apiKey, 
                                                      APP_ID_NAME:appId} service:@"com.yourapp"];

In application:didFinishLaunchingWithOptions: check to see if a session has already been saved

NCCSession *session = [NCCSession sessionWithService:@"com.yourapp"];
if ([NCCSession isValid]) {
    [self doStuff];
}

Retrieve the userInfo dictionary that was previously store in the session keychain

NSDictionary *userInfo = [[NCCSession sharedSession] userInfo];

Clear a session user

[NCCSession invalidateSession];

You can also get a session for userId

NCCSession *session = [NCCSession sessionWithService:@"com.yourapp" userId:@"213"]

About

iOS persist session data to keychain

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
Morty Proxy This is a proxified and sanitized view of the page, visit original site.