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

时间:2016-10-04 23:35:47

标签: ios swift xcode podfile objc-bridging-header

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

使用未解析的标识符' LinkedinSwiftHelper'

我的podfile:

use_frameworks!

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

这是我收到错误的行,我在视图控制器的类声明后立即声明:

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>

在构建设置/ Objective-C桥接头上,这是当前路径:

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

在此先感谢您提供任何帮助,我已经为此困难了2天。

1 个答案:

答案 0 :(得分:1)

使用可可豆荚时,您不需要桥接头。您是否在包含该viewcontroller的Swift文件中导入LinkedInSwift?对我而言,编译时没有任何问题。

EditText