Parse.com Facebook Login stays on "Loading" iOS

I am using Parse with LogInViewController. I have added Facebook to the login window.

When someone wants to connect to Facebook, they open a browser, the user accepts the application, and then returns to the application. But when it returns to the application, it stays on "loading" and nothing happens.

However, if the user reloads the app, it works.

It's only when this is the first communication for a user that I have this problem.

- (void)viewDidAppear:(BOOL)animated {
    [super viewDidAppear:animated];

    if (![PFUser currentUser]) {        
        // Customize the Log In View Controller
        PFLogInViewController *logInViewController = [[PFLogInViewController alloc] init];
        [logInViewController setDelegate:self];
        [logInViewController setFacebookPermissions:[NSArray arrayWithObjects:@"friends_about_me", nil]];
        [logInViewController setFields:  PFLogInFieldsFacebook | PFLogInFieldsDismissButton];

        // Present Log In View Controller
        [self presentViewController:logInViewController animated:YES completion:NULL];
    }
}

      

I think the problem is not my code, because I am using the default Parse code, but I am not sure.

+3


source to share


1 answer


- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
    return [FBAppCall handleOpenURL:url
                  sourceApplication:sourceApplication
                        withSession:[PFFacebookUtils session]];
}

- (void)applicationDidBecomeActive:(UIApplication *)application {
    /*
     Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
     */
    [FBAppCall handleDidBecomeActiveWithSession:[PFFacebookUtils session]];
}

- (void)applicationWillTerminate:(UIApplication *)application {
    /*
     Called when the application is about to terminate.
     Save data if appropriate.
     See also applicationDidEnterBackground:.
     */
    [[PFFacebookUtils session] close];
}

      



+1


source







All Articles