diff --git a/Framework/LIExplorer.framework/Headers b/Framework/LIExplorer.framework/Headers new file mode 120000 index 0000000..a177d2a --- /dev/null +++ b/Framework/LIExplorer.framework/Headers @@ -0,0 +1 @@ +Versions/Current/Headers \ No newline at end of file diff --git a/Framework/LIExplorer.framework/LIExplorer b/Framework/LIExplorer.framework/LIExplorer new file mode 120000 index 0000000..071dfb0 --- /dev/null +++ b/Framework/LIExplorer.framework/LIExplorer @@ -0,0 +1 @@ +Versions/Current/LIExplorer \ No newline at end of file diff --git a/Framework/LIExplorer.framework/Versions/A/Headers/LIApplication.h b/Framework/LIExplorer.framework/Versions/A/Headers/LIApplication.h new file mode 100644 index 0000000..1d359a4 --- /dev/null +++ b/Framework/LIExplorer.framework/Versions/A/Headers/LIApplication.h @@ -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 +#import +/*! + @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 diff --git a/Framework/LIExplorer.framework/Versions/A/Headers/LIAuthorizationVC.h b/Framework/LIExplorer.framework/Versions/A/Headers/LIAuthorizationVC.h new file mode 100644 index 0000000..b23c42d --- /dev/null +++ b/Framework/LIExplorer.framework/Versions/A/Headers/LIAuthorizationVC.h @@ -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 +#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 diff --git a/Framework/LIExplorer.framework/Versions/A/Headers/LIExplorer.h b/Framework/LIExplorer.framework/Versions/A/Headers/LIExplorer.h new file mode 100644 index 0000000..3bab749 --- /dev/null +++ b/Framework/LIExplorer.framework/Versions/A/Headers/LIExplorer.h @@ -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 +#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 diff --git a/Framework/LIExplorer.framework/Versions/A/Headers/LIRestAPIHandlers.h b/Framework/LIExplorer.framework/Versions/A/Headers/LIRestAPIHandlers.h new file mode 100644 index 0000000..0791244 --- /dev/null +++ b/Framework/LIExplorer.framework/Versions/A/Headers/LIRestAPIHandlers.h @@ -0,0 +1,243 @@ +// +// LIRestAPIHandlers.h +// TestLK +// +// Created by Vijay Viswas on 6/19/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 + +typedef enum +{ + LICommentVisibilityAnyone, + LICommentVisibilityConnectionsOnly +} LICommentVisibilityMode; +typedef enum +{ + LIGranularityDay, + LIGranularityMonth +} LIGranularity; +/*! + * @typedef LIAPICompletionBlock + * @brief Block is called when API service is called successfully. + * @property dic The dictionary object contains service response data. + * @property error The NSURLResponse object. + */ +typedef void (^LIAPICompletionBlock) (NSDictionary *dic, NSURLResponse *response); +/* + 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 LIAPIErrorBlock + * @brief Block is called when an error ocurred in API service call. + * @property error The NSError object related to the failure. + */ +typedef void (^LIAPIErrorBlock) (NSError *error); +/*! + @details LIRestAPIHandlers provides method to call various LinkedIn APIs. + @author Vijay Viswas + */ +@interface LIRestAPIHandlers : NSObject +/*! + * Method is used to share member comment in LinkedIn. + * @param comment A comment by the member to associated with the share. + * @param mode A collection of visibility information about the share. + * @param success A completion block. + * @param failure A failure block. + * @return Returns true if service is called successfully else returns false when there is an invalid access token or framework key. + */ ++(BOOL)shareComment:(NSString*)comment + withVisibity:(LICommentVisibilityMode)mode +withCompletionBlock:(LIAPICompletionBlock)completionBlock + failure:(LIAPIErrorBlock)failureBlock; +/*! + * Method is used to share content in LinkedIn. + * @param comment A comment by the member to associated with the share. + * @param title The title of the content being shared. + * @param description The description of the content being shared. + * @param url A fully qualified URL for the content being shared. + * @param imgUrl A fully qualified URL to a thumbnail image to accompany the shared content. + * @param mode A collection of visibility information about the share. + * @param success A completion block. + * @param failure A failure block. + * @return Returns true if service is called successfully else returns false when there is an invalid access token or framework key. + */ + ++(BOOL)shareComment:(NSString*)comment + withTitle:(NSString*)title + withDescription:(NSString*)description + withSubmittedUrl:(NSString*)url + withImageURL:(NSString*)imgUrl + withVisibity:(LICommentVisibilityMode)mode +withCompletionBlock:(LIAPICompletionBlock)completionBlock + failure:(LIAPIErrorBlock)failureBlock; + +/*! + * Method is used to create company share. + * @param comment A comment by the member to associated with the share. + * @param companyID Company identifier. + * @param mode A collection of visibility information about the share. + * @param success A completion block. + * @param failure A failure block. + * @return Returns true if service is called successfully else returns false when there is an invalid access token or framework key. + */ ++(BOOL)shareComment:(NSString*)comment + forCompanyID:(NSString*)companyID + withVisibity:(LICommentVisibilityMode)mode +withCompletionBlock:(LIAPICompletionBlock)completionBlock + failure:(LIAPIErrorBlock)failureBlock; +/*! + * Method is used to create company share. + * @param comment A comment by the member to associated with the share. + * @param companyID Company identifier. + * @param title The title of the content being shared. + * @param description The description of the content being shared. + * @param url A fully qualified URL for the content being shared. + * @param imgUrl A fully qualified URL to a thumbnail image to accompany the shared content. + * @param mode A collection of visibility information about the share. + * @param success A completion block. + * @param failure A failure block. + * @return Returns true if service is called successfully else returns false when there is an invalid access token or framework key. + */ ++(BOOL)shareComment:(NSString*)comment + forCompanyID:(NSString*)companyID + withTitle:(NSString*)title + withDescription:(NSString*)description + withSubmittedUrl:(NSString*)url + withImageURL:(NSString*)imgUrl + withVisibity:(LICommentVisibilityMode)mode +withCompletionBlock:(LIAPICompletionBlock)completionBlock + failure:(LIAPIErrorBlock)failureBlock; + +/*! + * Method returns authenticated user profile information. + * @param success A completion block. + * @param failure A failure block. + * @return Returns true if service is called successfully else returns false when there is an invalid access token or framework key. + */ ++(BOOL)requestProfile:(LIAPICompletionBlock)completionBlock failure:(LIAPIErrorBlock)failureBlock; +/*! + * Method Check if sharing is enabled for a company + * @param companyID Company identifier. + * @param success A completion block. + * @param failure A failure block. + * @return Returns true if service is called successfully else returns false when there is an invalid access token or framework key. + */ ++(BOOL)checkSharingEnabledForCompanyID:(NSString *)companyID + withCompletionBlock:(LIAPICompletionBlock)completionBlock + failure:(LIAPIErrorBlock)failureBlock; +/*! + * Method retruns company profile. + * @param companyID Company identifier. + * @param success A completion block. + * @param failure A failure block. + * @return Returns true if service is called successfully else returns false when there is an invalid access token or framework key. + */ ++(BOOL)companyProfileForCompanyID:(NSString *)companyID + withCompletionBlock:(LIAPICompletionBlock)completionBlock + failure:(LIAPIErrorBlock)failureBlock; +/*! + * Method retruns statistics for a company page. + * @param companyID Company identifier. + * @param success A completion block. + * @param failure A failure block. + * @return Returns true if service is called successfully else returns false when there is an invalid access token or framework key. + */ ++(BOOL)getStatisticsForCompanyID:(NSString *)companyID + withCompletionBlock:(LIAPICompletionBlock)completionBlock + failure:(LIAPIErrorBlock)failureBlock; +/*! + * Method retruns historical status update statistics about a company. + * @param companyID Company identifier. + * @param LIGranularity Granularity of statistics. Supported values are:day & month + * @param time Starting timestamp of when the stats search should begin (milliseconds since epoch). + * @param success A completion block. + * @param failure A failure block. + * @return Returns true if service is called successfully else returns false when there is an invalid access token or framework key. + */ ++(BOOL)getHistoricalStatisticsForCompanyID:(NSString *)companyID + withTimeGranularity:(LIGranularity)granularity + withTimestamp:(NSString*)time + withCompletionBlock:(LIAPICompletionBlock)completionBlock + failure:(LIAPIErrorBlock)failureBlock; +/*! + * Method returns historical follower statistics about a company. + * @param companyID Company identifier. + * @param LIGranularity Granularity of statistics. Supported values are:day & month + * @param time Starting timestamp of when the stats search should begin (milliseconds since epoch). + * @param success A completion block. + * @param failure A failure block. + * @return Returns true if service is called successfully else returns false when there is an invalid access token or framework key. + */ ++(BOOL)getHistoricalFollowerStatisticsForCompanyID:(NSString *)companyID + withTimeGranularity:(LIGranularity)granularity + withTimestamp:(NSString*)time + withCompletionBlock:(LIAPICompletionBlock)completionBlock + failure:(LIAPIErrorBlock)failureBlock; +/*! + * Method retruns company's updates. + * @param companyID Company identifier. + * @param success A completion block. + * @param failure A failure block. + * @return Returns true if service is called successfully else returns false when there is an invalid access token or framework key. + */ ++(BOOL)getCompanyUpdatesForCompanyID:(NSString *)companyID + withCompletionBlock:(LIAPICompletionBlock)completionBlock + failure:(LIAPIErrorBlock)failureBlock; +/*! Method returns a single specific company update record for the company identified by the {id} value and the update identified by the {update-key} value in the request. + * @param companyID Company identifier. + * @param updateKey Unique identifier for the event, similar to an id. + * @param success A completion block. + * @param failure A failure block. + * @return Returns true if service is called successfully else returns false when there is an invalid access token or framework key. + */ ++(BOOL)getSpecificCompanyUpdatesForCompanyID:(NSString *)companyID + andUpdateKEy:(NSString*)updateKey + withCompletionBlock:(LIAPICompletionBlock)completionBlock + failure:(LIAPIErrorBlock)failureBlock; +/*! + * Method returns comments for a specific company update. + * @param companyID Company identifier. + * @param updateKey Unique identifier for the event, similar to an id. + * @param success A completion block. + * @param failure A failure block. + * @return Returns true if service is called successfully else returns false when there is an invalid access token or framework key. + */ ++(BOOL)getCommentsOfSpecificCompanyUpdatesForCompanyID:(NSString *)companyID + andUpdateKEy:(NSString*)updateKey + withCompletionBlock:(LIAPICompletionBlock)completionBlock + failure:(LIAPIErrorBlock)failureBlock; +/*! + * Method returns likes for a specific company update. + * @param companyID Company identifier. + * @param updateKey Unique identifier for the event, similar to an id. + * @param success A completion block. + * @param failure A failure block. + * @return Returns true if service is called successfully else returns false when there is an invalid access token or framework key. + */ ++(BOOL)getLikesOfSpecificCompanyUpdatesForCompanyID:(NSString *)companyID + andUpdateKEy:(NSString*)updateKey + withCompletionBlock:(LIAPICompletionBlock)completionBlock + failure:(LIAPIErrorBlock)failureBlock; +@end diff --git a/Framework/LIExplorer.framework/Versions/A/Headers/LITokenHandler.h b/Framework/LIExplorer.framework/Versions/A/Headers/LITokenHandler.h new file mode 100644 index 0000000..815a4b4 --- /dev/null +++ b/Framework/LIExplorer.framework/Versions/A/Headers/LITokenHandler.h @@ -0,0 +1,43 @@ +// +// LITokenHandler.h +// TestLK +// +// Created by Vijay Viswas on 6/19/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 +#define LI_TK_GENERATED_TIME @"generated_time" +#define LI_ACCESS_TK @"access_token" +#define LI_TK_EXPIRES_IN @"expires_in" + +@interface LITokenHandler : NSObject + +/*! + * Method returns access token. + * @return Returns access token. + */ ++(NSString*)getLIAccessToken; +/*! + * Method checks whether access token is valid value and not expired + * @return Returns true if access token is valid. + */ ++(BOOL)isValidToken; +@end diff --git a/Framework/LIExplorer.framework/Versions/A/LIExplorer b/Framework/LIExplorer.framework/Versions/A/LIExplorer new file mode 100644 index 0000000..5fea92f Binary files /dev/null and b/Framework/LIExplorer.framework/Versions/A/LIExplorer differ diff --git a/Framework/LIExplorer.framework/Versions/Current b/Framework/LIExplorer.framework/Versions/Current new file mode 120000 index 0000000..8c7e5a6 --- /dev/null +++ b/Framework/LIExplorer.framework/Versions/Current @@ -0,0 +1 @@ +A \ No newline at end of file