从Facebook 4.0.x开始,使用[PFFacebookUtils initializeFacebookWithApplicationLaunchOptions:launchOptions](semaphore_wait_slow陷阱)来解析登录挂起 [英] Parse login hang since Facebook 4.0.x with [PFFacebookUtils initializeFacebookWithApplicationLaunchOptions:launchOptions] (semaphore_wait_slow trap)
问题描述
自从将Facebook更新到v4.0.x和最新的Parse库以来,我的应用程序正在挂起,似乎是在尝试登录用户时.
Since updating Facebook to v4.0.x and the latest Parse libraries, my app is hanging, seemingly when trying to log in the user.
我的堆栈跟踪如下:
我以前有一个非常类似的问题,在这里回答:调用[PFFacebookUtils initializeFacebook]-semaphore_wait_trap
I had a very similar problem previously, answered here: Parse crash when calling [PFFacebookUtils initializeFacebook] - semaphore_wait_trap
但是该解决方案不再起作用,因为看来[PFUser currentUser]
已被卡在其中的[PFUser(Private) _getCurrentUserWithOptions:]
和[BFTask(Private) waitForResult:withMainThreadWarning:]
取代.
However that solution no longer works, since it seems [PFUser currentUser]
has been replaced with [PFUser(Private) _getCurrentUserWithOptions:]
and [BFTask(Private) waitForResult:withMainThreadWarning:]
where it gets stuck.
在我的应用程序中,我将PFUser子类化为名为MPLUser的类,并覆盖了用户方法.不确定这是否与问题有关?
In my app, I've subclassed PFUser to a class called MPLUser, and overridden the user method. Not sure if this might be something to do with the issue?
+ (MPLUser *)user
{
return (MPLUser *)[PFUser user];
}
一旦开始发生,就无法启动该应用程序.但是,我通常会在锁定开始发生之前设法启动应用程序几次.通常是在车祸后发生的...
Once this starts occurring, it becomes impossible to launch the app. However, I usually manage to launch the app a few times before the lock starts happening. It usually happens after a crash...
我正在使用pod'ParseFacebookUtilsV4',并将所有库更新为最新版本.
I'm using pod 'ParseFacebookUtilsV4' and have updates all libraries to latest versions.
更新:
这里是来自另一个线程的更多堆栈跟踪信息,这似乎是在尝试登录:
Here's more stack trace from another thread, that is seemingly trying to log on:
我按以下顺序初始化Parse和Facebook.如果我拨回电话,则会崩溃:
I initialise Parse and Facebook in the following order. If I reverse the calls, it crashes:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[self initDefaults];
[self initialiseApplicationSpecifics];
[self setupParseWithOptions:launchOptions];
[self enableCrashReporting];
[self setupIAPs];
//etc...
}
- (void)initialiseApplicationSpecifics
{
[Flurry setCrashReportingEnabled:YES];
[self registerParseSubclasses];
[ParseCrashReporting enable];
[Parse enableLocalDatastore];
#ifdef MPL
[Parse setApplicationId:@"xxxyyy"
clientKey:@"xxxyyy"];
[Flurry startSession:@"xxxyyy"];
#elif MGM
[Parse setApplicationId:@"yyyxxx"
clientKey:@"yyyxxx"];
[Flurry startSession:@"yyyxxx"];
#endif
}
- (void)setupParseWithOptions:(NSDictionary *)launchOptions
{
[PFFacebookUtils initializeFacebookWithApplicationLaunchOptions:launchOptions];
[PFTwitterUtils initializeWithConsumerKey:@"aaaabbbb"
consumerSecret:@"bbbbaaaa"];
[PFAnalytics trackAppOpenedWithLaunchOptions:launchOptions];
}
推荐答案
似乎要通过解析1.7.2修复
Seems to be fixed with parse 1.7.2
根据v1.7.2-2015年4月27日
According to v1.7.2 — April 27, 2015
新功能:扩展和WatchKit的本地数据共享. 改进了ParseFacebookUtils的可空性注释.
修复:在主线程上未调用带块回调的logOutInBackground. 修复:对于PFSubclassing.h使用导入,可能会导致编译错误.
修复:如果通过saveEventually保存自动用户,则不是持久的currentUser.
已修复:使用ParseFacebookUtils和currentUser的罕见死锁方案.
已修复:将多个对象连续固定到同一针脚的问题很少.
固定:用户无法与Facebook链接时的罕见情况.
提高了本地数据存储的性能和可靠性. 性能改进.
其他小错误修复.
New: Local Data Sharing for Extensions and WatchKit. Improved nullability annotations for ParseFacebookUtils.
Fixed: logOutInBackground with block callback not called on main thread. Fixed: Potential compilation error with using imports for PFSubclassing.h.
Fixed: Not persistent currentUser if saving automatic user via saveEventually.
Fixed: Rare deadlock scenario with using ParseFacebookUtils and currentUser.
Fixed: Rare issue with pinning multiple objects in a row to the same pin.
Fixed: Rare scenario when user could be not linked with Facebook.
Improved performance and reliability of Local Datastore. Performance improvements.
Other small bug fixes.
这篇关于从Facebook 4.0.x开始,使用[PFFacebookUtils initializeFacebookWithApplicationLaunchOptions:launchOptions](semaphore_wait_slow陷阱)来解析登录挂起的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!