LinkedIn.swift 1.0.2

LinkedIn.swift 1.0.2

维护者 Orkhan Alikhanov.



  • 作者:
  • Orkhan Alikhanov

Platform Cocoapods Compatible

LinkedIn.swift

LinkedIn SDK iOS 依赖项,消除手动将 linkedin-sdk.framework 导入到 Swift 项目的需求

使用

  1. 遵循 LinkedIn iOS 文档 并设置您的应用
  2. 将以下内容添加到您的 AppDelegate.swift
    func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
    
        return LinkedIn.application(app,
                                    open: url,
                                    options: options)
    }
  3. import LinkedInSDK,现在可以在项目中使用 LISDKSessionManager 等类。

特点

LinkedIn.swift 自动简化了 登录和获取用户信息 的过程。导入 LinkedInSwift(而不是 LinkedInSDK)。

import LinkedInSwift
// ...
LinkedIn.login(permissions: [.basicProfile, .email] { (user: LinkedInUser?, error: Error?) in
    print(user?.jsonDict as Any, error as Any)
}

LinkedInUser 将用户信息存储在 jsonDict: [String: Any] 字段中,并提供了一些便捷的获取参数的 getter。更多信息请参阅 LinkedInUser.swift 及其他文件。

安装

CocoaPods

CocoaPods 是 Cocoa 项目的依赖管理器。您可以使用以下命令安装它:

$ gem install cocoapods

要使用 CocoaPods 将 LinkedIn.swift 集成到您的 Xcode 项目中,请在您的 Podfile 中指定它:

source 'https://github.com/CocoaPods/Specs.git'
target '<Your Target Name>' do
    pod 'LinkedIn.swift', '~> 1.0'
end

然后,运行以下命令:

$ pod install

作者

有关参与此项目的其他贡献者名单,请查看 贡献者列表

许可证

该项目采用 MIT 许可证 - 有关详细信息,请参阅 许可证文件