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

时间:2016-06-24 06:34:56

标签: swift facebook-graph-api cocoapods fbsdkloginkit

我正在使用Cocoapods整合FacebookSDK。当我创建像FBSDKLoginManager let login = FBSDKLoginManager()这样的对象时,我收到错误"使用未解析的标识符' FBSDKLoginManager'"。我可以看到autoComplete,它指向正确的方法,但它仍然显示错误。这是我的pod文件:

platform :ios, '9.0'
use_frameworks!

target 'BuildTheTower' do

pod 'SVProgressHUD'

pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'FBSDKShareKit'

end

这是我的桥接头文件:

#ifndef ObjectiveC_Bridging_Header_h
#define ObjectiveC_Bridging_Header_h

#import <SVProgressHUD/SVProgressHUD.h>

#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <FBSDKLoginKit/FBSDKLoginKit.h>

#endif /* ObjectiveC_Bridging_Header_h */

FBSDKAppEvents.activateApp()FBSDKApplicationDelegate.sharedInstance().application(application, didFinishLaunchingWithOptions: launchOptions)等其他内容正常,但FBSDKLoginManager不正常。

2 个答案:

答案 0 :(得分:3)

不需要桥接标头。只需添加import语句。

<script type="text/javascript">
    var clock;

    $(document).ready(function() {
        var clock;

        clock = $('.clock').FlipClock({
            clockFace: 'DailyCounter',
            autoStart: false,
            callbacks: {
                stop: function() {
                    $('.message').html('The clock has stopped!')
                }
            }
        });

        clock.setTime(220880);
        clock.setCountdown(true);
        clock.start();

    });
</script>

有关详细信息,请参阅官方tutorial/docs

答案 1 :(得分:0)

使用这些导入语句

import FacebookLogin
import FBSDKLoginKit
import FBSDKCoreKit
import FacebookCore
import FirebaseAuth