0

I'm working on an app that uses the Facebook SDK. Until now I've not had any significant problems. I've been using the API to request a user's photos. However, after deleting the app on the device to try out some log-in scenarios, the app now only requests the public profile.

This is the call being made

self.loginView = [[FBLoginView alloc] initWithReadPermissions:@[@"public_profile", @"email", @"user_friends", @"user_photos"]];

but this is what shows on the device

facebook public profile

When I request the user's photos the data is empty (as you'd expect with just the public profile).

What did I do to break it? And more importantly, how do I fix it?

EDIT: I've created a new app on the Facebook developer portal and I get exactly the same results.

3
  • Seems that it now switched to Graph API v2.0. I guess the User you're trying it with isn't an admin of the FB app behind the login? Have you successfully requested the review for your login permissions?
    – Tobi
    May 28, 2014 at 8:36
  • I am the user and the admin. The app is only in development, so I don't think permissions review is a requirement yet.
    – Phil John
    May 28, 2014 at 8:38
  • You're right. Then it's strange I guess
    – Tobi
    May 28, 2014 at 8:43

1 Answer 1

0

For reasons I can't establish, this error was somehow connected to the way that the FBLogin was initialising.

In my app I had created an FBLoginView in the storyboard and I was doing the alloc/init in the viewDidLoad method of the view controller handling my Facebook information.

I had checked to ensure that the FBLoginView class was associated with the view in the storyboard and that the FBLoginView class was declared in my app delegate.

However, I was seeing the problem as stated. It was only when I removed the FBLoginView from the storyboard and created it programmatically (as in the FBLoginUIControlSample that's available on Facebook) that the problem was resolved.

For reference, this DID NOT work for me

-(void)viewDidLoad{

[super viewDidLoad];
    self.loginView = [[FBLoginView alloc] initWithReadPermissions:@[@"public_profile", @"email", @"user_friends", @"user_photos"]];

    self.loginView.delegate = self;

}

This DID work.

-(void)viewDidLoad{
[super viewDidLoad];
FBLoginView *loginView = [[FBLoginView alloc] initWithReadPermissions:@[@"public_profile", @"email", @"user_friends", @"user_photos"]];
loginView.delegate = self;
loginView.frame = CGRectOffset(loginView.frame,
                               (self.view.center.x - (loginView.frame.size.width / 2)),
                               5);

loginView.center = self.view.center;
[self.View addSubview:loginView];
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.