【问题标题】:PFFacebookUtils.initializeFacebookWithApplicationLaunchOptions(launchOptions) hangs appPFFacebookUtils.initializeFacebookWithApplicationLaunchOptions(launchOptions) 挂起应用
【发布时间】:2016-08-10 11:44:14
【问题描述】:

使用最新的 FB iOS SDKS 和 Parse,以及 ParseFacebookUtilsV4

 pod 'FBSDKCoreKit'
 pod 'FBSDKShareKit'
 pod 'FBSDKLoginKit'
 pod 'Parse'
 pod 'ParseUI'
 pod 'ParseCrashReporting'
 pod 'ParseFacebookUtilsV4'

我的应用程序在启动时挂起。这是我的应用委托代码:

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {

    Fabric.with([Crashlytics.self])
    configurePushNotifications(application)
    Parse.enableLocalDatastore()

    let configuration = ParseClientConfiguration {
        $0.applicationId = "myapp"
        $0.clientKey = "123123123"
        $0.server = "https://xxxxxx.herokuapp.com/parse"
    }
    Parse.initializeWithConfiguration(configuration)


    if let launchOptions = launchOptions {
        PFFacebookUtils.initializeFacebookWithApplicationLaunchOptions(launchOptions)
    } else {
        PFFacebookUtils.initializeFacebookWithApplicationLaunchOptions([NSObject:AnyObject]())
    }

最后一次调用导致应用程序挂起,特别是在块中:

- (PFUserAuthenticationController *)userAuthenticationController {
    __block PFUserAuthenticationController *controller = nil;
    dispatch_sync(_controllerAccessQueue, ^{
        if (!_userAuthenticationController) {
            _userAuthenticationController = [PFUserAuthenticationController controllerWithDataSource:self];
        }
        controller = _userAuthenticationController;
    });
    return controller;
}

内部PFCoreManager.m

我认为我在这里没有做任何不寻常的事情,并已尝试删除并重新安装该应用程序。在模拟器中也会发生同样的事情。

【问题讨论】:

    标签: ios swift facebook parse-platform


    【解决方案1】:

    我遇到了同样的问题。通过阅读最近的发行说明,我们完成了一些工作来自动注册实现 PFSubclassing 协议的对象。

    您可以在此处阅读更多信息:https://github.com/ParsePlatform/Parse-SDK-iOS-OSX/pull/967

    我发现删除任何显式注册可以解决这个问题,其中包括从类中删除这样的行:

    override public class func initialize() {
        self.registerSubclass()
    }
    

    多次注册似乎在 userAuthenticationController 也碰巧使用的 _controllerAccessQueue 上造成了死锁......

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-07-04
      • 2011-02-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-23
      • 1970-01-01
      相关资源
      最近更新 更多