Skip to content

Browncoat/NCCSession

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

 
 
 

Contributors