Log in to the parser from Facebook 4.0.x using [PFFacebookUtils initializeFacebookWithApplicationLaunchOptions: launchOptions] (semaphore_wait_slow trap)

Since updating Facebook to v4.0.x and the latest Parse libraries, my application hangs, it seems, when I try to log in.

My stack trace looks like this:

enter image description here

I had a very similar problem earlier, here: Collection failed when calling [PFFacebookUtils initializeFacebook] - semaphore_wait_trap

However, this solution no longer works, as it seems that [PFUser currentUser] been replaced by [PFUser(Private) _getCurrentUserWithOptions:] and [BFTask(Private) waitForResult:withMainThreadWarning:] , where it gets stuck.

In my application, I subclassed PFUser to the MPLUser class and redefined the user method. Not sure if this could be due to a problem?

 + (MPLUser *)user { return (MPLUser *)[PFUser user]; } 

Once this happens, it becomes impossible to launch the application. However, I usually launch the application several times before the lock starts. This usually happens after a failure ...

I use pod 'ParseFacebookUtilsV4' and updates all libraries to the latest versions.

UPDATE:

Here's more stack trace from another thread, which is apparently trying to log in:

enter image description hereenter image description here

I initialize Parse and Facebook in the following order. If I cancel the calls, it will work:

 - (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]; } 
+7
objective-c pfuser
source share
3 answers

It seems to be fixed with parse 1.7.2

According to v1.7.2 - April 27, 2015

New: Local data exchange for extensions and WatchKit. Improved zero-value annotations for ParseFacebookUtils.
Fixed: logOutInBackground with a block callback not called in the main thread. Fixed: Potential compilation error using import for PFSubclassing.h.
Fixed: not constant currentUser when saving automatic user via saveEventually.
Bugfix: A rare deadlock scenario using ParseFacebookUtils and currentUser.
Fixed: A rare problem with binding several objects in a row to the same output.
Bugfix: A rare scenario when a user could not be connected to Facebook.
Increased local storage performance and reliability. Productivity increase.
Other minor bug fixes.

+2
source share

I have the same problem with Parse 1.7.1 and FBSDK 4.0.1, and I reported an error for Parse, but so far no luck. This has something to do with the local data warehouse.

https://developers.facebook.com/bugs/779176035499837

Please provide additional information.

+1
source share

I checked with my team working on the iOS SDK and was informed that the latest SDK should solve this problem. Can you try updating?

0
source share

All Articles