serhii-londar / LinkedInSignIn

Simple view controller to log in and retrieve an access token from LinkedIn.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LinkedInSignIn

CI Status Version License Platform

Example

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

Also you need to setup app on LinkedIn and fill in dictionary with your app credetials:

let linkedinCredentilas = [
    "linkedInKey": "",
    "linkedInSecret": "",
    "redirectURL": ""
]

Login proces is simple as:

let linkedInConfig = LinkedInConfig(linkedInKey: linkedinCredentilas["linkedInKey"]!, linkedInSecret: linkedinCredentilas["linkedInSecret"]!, redirectURL: linkedinCredentilas["redirectURL"]!)
let linkedInHelper = LinkedinHelper(linkedInConfig: linkedInConfig)
linkedInHelper.login(from: self, completion: { (accessToken) in
        let alertVC = UIAlertController(title: "Success", message: "Your access token is : \(accessToken)!", preferredStyle: .alert)
        alertVC.addAction(UIAlertAction(title: "Ok", style: .default, handler: { _ in
            alertVC.dismiss(animated: true, completion: nil)
        }))
    self.present(alertVC, animated: true, completion: nil)
}) { error in
    print(error.localizedDescription)
}

Installation

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

pod 'LinkedInSignIn'

Author

Github: Serhii Londar

Email: serhii.londar@gmail.com

License

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

About

Simple view controller to log in and retrieve an access token from LinkedIn.

License:MIT License


Languages

Language:Swift 84.6%Language:Ruby 9.4%Language:Objective-C 6.1%