Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix initialization of Facebook/Twitter Utils blocking the main thread. #312

Merged
merged 1 commit into from
Sep 23, 2015

Conversation

nlutsenko
Copy link
Contributor

This will make load of currentUser asynchronous, as well as won't create anonymous user if enabled, and will properly restore auth from a background thread.
Fixes #302

if (![authType isEqualToString:PFAnonymousUserAuthenticationType]) {
[[PFUser currentUser] synchronizeAuthDataWithAuthType:authType];
}
[[[PFUser currentUserController] getCurrentUserAsyncWithOptions:0] continueWithSuccessBlock:^id(BFTask *task) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How hard is it to have this injected? I don't really like having this be harder than necessary to test.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, let's do it. It's going to be much better.

@nlutsenko
Copy link
Contributor Author

Injecting the currentUserController, all the way!

nlutsenko added a commit that referenced this pull request Sep 23, 2015
Fix initialization of Facebook/Twitter Utils blocking the main thread.
@nlutsenko nlutsenko merged commit fc2d6c8 into master Sep 23, 2015
@nlutsenko nlutsenko deleted the nlutsenko.auth branch September 23, 2015 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants