Skip to content

Commit

Permalink
First version
Browse files Browse the repository at this point in the history
  • Loading branch information
vvisx committed Jun 24, 2015
1 parent fbebbd9 commit db21f8e
Show file tree
Hide file tree
Showing 9 changed files with 464 additions and 0 deletions.
1 change: 1 addition & 0 deletions Framework/LIExplorer.framework/Headers
1 change: 1 addition & 0 deletions Framework/LIExplorer.framework/LIExplorer
67 changes: 67 additions & 0 deletions Framework/LIExplorer.framework/Versions/A/Headers/LIApplication.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
//
// LIApplication.h
// TestLK
//
// Created by Vijay Viswas on 6/18/15.
// strongright (c) 2015 Vijay Viswas. All rights reserved.
//

// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
/*!
@details LIApplication is a model class used to define application preferences.
@author Vijay Viswas
*/

@interface LIApplication : NSObject
/*!
* @brief A unique string value of your choice that is hard to guess. Used to prevent CSRF.
*/
@property(nonatomic, strong) NSString *state;
/*!
* @brief This property is used to hide default webview login screen.
*/
@property (nonatomic,assign) BOOL hideDefaultWebView;
/*!
* @brief This property contains rectangular bounds of webview.
*/
@property(nonatomic, assign) CGRect webviewRect;
/*!
* @brief The URI your users will be sent back to after authorization. This value must match one of the defined OAuth 2.0 Redirect URLs in your application configuration.
*/
@property(nonatomic, strong) NSString *redirectURL;
/*!
* @brief The "LinkedIn API Key" value generated when you registered your application.
*/
@property(nonatomic, strong) NSString *clientId;
/*!
* @brief The "LinkedIn API secret" value generated when you registered your application.
*/
@property(nonatomic, strong) NSString *clientSecret;
/*!
* @brief This property is used to store access token, toekn expiration value and token generated time in keychain instead NSUserDefaults
*/
@property(nonatomic, assign) BOOL storeTokenInKeyChain;
/*!
* @brief This property is used to define keychain identifier to save token.
*/
@property(nonatomic, strong) NSString *keychainIdentifier;

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
//
// LIAuthorizationVC.h
// TestLK
//
// Created by Vijay Viswas on 6/18/15.
// Copyright (c) 2015 Vijay Viswas. All rights reserved.
//

// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

#import <UIKit/UIKit.h>
#import "LIApplication.h"
/*!
* @typedef LICompletionBlock
* @brief Framework calls this block when access token is received from LinkedIn.
*/
typedef void (^LICompletionBlock) (void);
/*
Error code 60001: User denied access.
Error code 60002: Internal Error.
Error code 60003: Invalid redirection.
Error code 60004: Form validation error.
Error code 60005: LinkedIn Rest API error.
* @typedef LIErrorBlock
* @brief This block is called by framework when an error occured by authenticating to LinkedIn.
* @property error The NSError object related to the failure.
*/
typedef void (^LIErrorBlock) (NSError *error);
/*!
@details LIAuthorizationVCView provides default webview to authenticate LinkedIn. Also subclass this viewcontroller to override default webview login screen.
@author Vijay Viswas
*/
@interface LIAuthorizationVC : UIViewController
/*!
* @brief This property is used to define custom navigation bar for default webview screen.
*/
@property(nonatomic,strong)UINavigationBar *webViewNavigationNar;
@property(nonatomic, copy) LIErrorBlock failureCallback;
@property(nonatomic, copy) LICompletionBlock successCallback;
/**
Initializes a LIAuthorizationVC viewcontroller.
* @param success A success block.
* @param failure A failure block.
* @returns A pointer to a LIAuthorizationVC instance.
**/
- (id)initWithSuccessBlock:(LICompletionBlock)success failureBlock:(LIErrorBlock)failure;
/*!
* Method is used in custom viewcontroller to authenticate using user name and password.
* @param username User name.
* @param password Password.
*/
-(void)authenticateWithUsername:(NSString*)username andPassword:(NSString*)password;
@end
38 changes: 38 additions & 0 deletions Framework/LIExplorer.framework/Versions/A/Headers/LIExplorer.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
//
// LIExplorer.h
// LIExplorer
//
// Created by Vijay Viswas on 6/21/15.
// Copyright (c) 2015 Vijay Viswas. All rights reserved.
//

// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

#import <Foundation/Foundation.h>
#import "LIApplication.h"
@interface LIExplorer : NSObject
/*!
* Method is used to register your application for framework.This should be called exactly once by your application, e.g., in application: didFinishLaunchingWithOptions:.
* @param frameworkKey Unique framework key for your application. Please contact me for keys.
* @param application The LIApplication object is used to define application preferences.
* @param staging Pass true if you would like to see logs from framework. Make sure you pass false for release version.
* @return Returns true if application is registered sucessfully else false.
*/
+(BOOL)registerKey:(NSString*)Key withApplication:(LIApplication*)application staging:(BOOL)staging;
@end
Loading

0 comments on commit db21f8e

Please sign in to comment.