gpt4 book ai didi

ios - 尝试将 Linkedin SDK 集成到我的 Swift 项目时出错

转载 作者:行者123 更新时间:2023-11-28 06:32:46 24 4
gpt4 key购买 nike

我正在尝试将 Linkedin SDK 集成到我的 Swift 项目中。我正在使用 this cocoapod这是我遇到的错误。

使用未解析的标识符“LinkedinSwiftHelper”

我的播客文件:

使用框架!

目标'JobRewards'做pod 'LinkedinSwift', '~> 1.6.5'

结束

这是我收到错误的行,我在我的 View Controller 的类声明之后立即声明:

let linkedinHelper = LinkedinSwiftHelper(configuration: LinkedinSwiftConfiguration(clientId: "myclientid", clientSecret: "myclientsecret", state: "mystate", permissions: ["r_basicprofile", "r_emailaddress"]))

我的桥接头:

#ifndef ObjectiveCHeader_h
#define ObjectiveCHeader_h

#import <LinkedinSwift/LSHeader.h> // this will use both for POD and import framework.


#endif /* ObjectiveCHeader_h */

我的info.plist源码:

<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>linkedin.com</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSExceptionRequiresForwardSecrecy</key>
<false/>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>
</dict>
<key>LIAppId</key>
<string>4594413</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>li4594413</string>
</array>
</dict>
</array>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>linkedin</string>
<string>linkedin-sdk2</string>
<string>linkedin-sdk</string>
</array>

在build设置/Objective-C 桥接 header 中,这是当前路径:

/Users/myName/Desktop/PROJECTS/MyProject/MyProject/ObjectiveCHeader.h

在此先感谢您的帮助,我已经为此苦苦挣扎了 2 天。

最佳答案

使用 cocoa pods 时不需要桥接头。您是否在包含该 View Controller 的 Swift 文件中导入 LinkedInSwift?对我来说,编译没有问题。

import UIKit
import LinkedinSwift

class ViewController: UIViewController {

let linkedinHelper = LinkedinSwiftHelper()

}

关于ios - 尝试将 Linkedin SDK 集成到我的 Swift 项目时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39863311/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com