Latest 1.0.0
Homepage https://github.com/WebFactoryMk/linkedInkit
License MIT
Platforms ios 8.0, requires ARC
Dependencies Alamofire
Authors ,

CI Status
Version
License
Platform

A simple wrapper for linkedIn-sdk & linkedIn REST Api written in Swift.
Based on https://github.com/tonyli508/LinkedinSwift

Using LinkedIn SDK 1.0.7

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

iOS 8.0+

Installation

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

pod 'LinkedInKit'

Backwards compatibility

For Swift 2.3 use:

pod 'LinkedInKit', :git => 'https://github.com/webfactorymk/linkedInkit.git', :branch => 'swift2.3'

For Swift 2.2 use:

pod 'LinkedInKit', :git => 'https://github.com/webfactorymk/linkedInkit.git', :branch => 'swift2.2'

Usage

For project setup please see Getting Started with the Mobile SDK for iOS and Getting started with the REST API
. LinkedIn sdk is already imported.

Setup

    LinkedInKit.setup(withConfiguration: LinkedInConfiguration(withClientID: "your_client_id",
                                                               clientSecret: "your_client_secret",
                                                               state: "custom_state_string",
                                                               permissions: [LISDK_BASIC_PROFILE_PERMISSION, LISDK_EMAILADDRESS_PERMISSION],
                                                               redirectURL: "any_valid_url",
                                                               appID: "your_linked_in_app_id"))

redirect_url param needs to be any valid url so the API calls and responses can be intercepted (if using REST api)

Authentication

    LinkedInKit.authenticate({ (token) in
        print(token)
    }) { (error) in
        print(error)
    }

API requests

    LinkedInKit.openProfileWithMemberId("member_id", success: { (success) in
                    print(success)
                }) { (error) in
                    print(error)
        }
    LinkedInKit.requestUrl("https://api.linkedin.com/v1/people/~/shares?format=json",
                            method: .POST,
                            parameters: parameters,
                            success: { (response) in
                                print("response data: (response?.jsonObject)")
                         }, failure: { (error) in
                                print(error)
        })

Customizing Web View appearance

    LinkedInKit.authViewControllerDelegate = DesignManager.sharedInstance

LinkedInAuthorizationViewControllerDelegate methods

    func linkedInViewControllerNavigationBarColor() -> UIColor? {
        /* return UIColor for customizing the navigation bar */
    }

    func linkedInViewControllerTitleAttributtedString() -> NSAttributedString? {
        /* return NSAttributtedString for formating the navigation bar title */
    }

    func linkedInViewControllerCancelAttributtedString() -> NSAttributedString? {
        /* return NSAttributtedString for formating 'Cancel' button label */
    }

    func linkedInViewControllerLoadingView() -> LinkedInLoadingView? {
        /* return a view conforming the LinkedInLoadingView protocol */
    }

License

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

Latest podspec

{
    "name": "LinkedInKit",
    "version": "1.0.0",
    "summary": "LinkedInKit - Framework for LinkedIn authentication",
    "description": "LinkedInKit is a framework for LinkedIn authentication both through the LinkedIn app or with the Browser OAuth 2 authentication. It is built as a simple wrapper for linkedIn-sdk & linkedIn REST API written in Swift. Based on https://github.com/tonyli508/LinkedinSwift",
    "homepage": "https://github.com/WebFactoryMk/linkedInkit",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Mariana": "[email protected]",
        "Gordan": "[email protected]"
    },
    "source": {
        "git": "https://github.com/WebFactoryMk/linkedInkit.git",
        "tag": "1.0.0"
    },
    "requires_arc": true,
    "platforms": {
        "ios": "8.0"
    },
    "vendored_frameworks": "linkedin-sdk.framework",
    "source_files": [
        "LinkedInKit/Classes/**/*",
        "linkedin-sdk.framework/Headers/LISDKAccessToken.h",
        "linkedin-sdk.framework/Headers/LISDKAPIError.h",
        "linkedin-sdk.framework/Headers/LISDKAPIHelper.h",
        "linkedin-sdk.framework/Headers/LISDKAPIResponse.h",
        "linkedin-sdk.framework/Headers/LISDKCallbackHandler.h",
        "linkedin-sdk.framework/Headers/LISDKDeeplinkHelper.h",
        "linkedin-sdk.framework/Headers/LISDKErrorCode.h",
        "linkedin-sdk.framework/Headers/LISDKPermission.h",
        "linkedin-sdk.framework/Headers/LISDKSession.h",
        "linkedin-sdk.framework/Headers/LISDKSessionManager.h"
    ],
    "public_header_files": [
        "linkedin-sdk.framework/Headers/LISDKAccessToken.h",
        "linkedin-sdk.framework/Headers/LISDKAPIError.h",
        "linkedin-sdk.framework/Headers/LISDKAPIHelper.h",
        "linkedin-sdk.framework/Headers/LISDKAPIResponse.h",
        "linkedin-sdk.framework/Headers/LISDKCallbackHandler.h",
        "linkedin-sdk.framework/Headers/LISDKDeeplinkHelper.h",
        "linkedin-sdk.framework/Headers/LISDKErrorCode.h",
        "linkedin-sdk.framework/Headers/LISDKPermission.h",
        "linkedin-sdk.framework/Headers/LISDKSession.h",
        "linkedin-sdk.framework/Headers/LISDKSessionManager.h"
    ],
    "dependencies": {
        "Alamofire": []
    },
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This