1

It works on the simulator but not on the device?! Why? I've gone through all the troubleshooting where you set the bundle identifier through facebook, what can I do??

override func viewDidLoad() {
 super.viewDidLoad()
 // Do any additional setup after loading the view, typically from a nib.

 var permissions = []

 PFFacebookUtils.logInWithPermissions(permissions, {
   (user: PFUser!, error: NSError!) -> Void in
   if user == nil {
     NSLog("Uh oh. The user cancelled the Facebook login.")
   } else if user.isNew {
     NSLog("User signed up and logged in through Facebook!")
   } else {
     NSLog("User logged in through Facebook!")
   }
 })
}
rmaddy
  • 314,917
  • 42
  • 532
  • 579
Justin R.
  • 53
  • 1
  • 6

4 Answers4

1

Are you trying to login with a different facebook account , is your application allowed to be accessed by the public ,

if not these answers will help The developers of this app have not set up this app properly for Facebook Login?

Community
  • 1
  • 1
Akil
  • 719
  • 13
  • 23
  • When I run the app on my device it asks if facebook can have permissions, and then when I click yes, it prints to the log "Uh oh. The user cancelled the Facebook login" – Justin R. Jan 26 '15 at 00:15
  • have you configured parse and facebook properly with the proper keys? – Akil Jan 26 '15 at 07:04
  • this tutorial will help you , all the best --> http://www.raywenderlich.com/44640/integrating-facebook-and-parse-tutorial-part-1 You have a configuration problem , just check that and your application will run fine – Akil Jan 27 '15 at 11:16
  • i have been working on an app for several months, all this while login went smooth, and all of a sudden this happened. still it log in smoothly if no facebook app is install on my phone. – A. Adam Sep 11 '15 at 15:38
1

I had the same problem today actually. I was freaking out.

I looked at several solutions online related this issue. Some talked about adding proper fb permissions and others about setting up Facebook login from scratch. None of these worked me.

Every time I pressed the fb login button i got => "Uh oh. The user cancelled the Facebook login." It worked in the simulator...weird right?

Using your device, go to 1. settings 2. facebook app 3. scroll to "Allow these apps to use your account" then look for your app. 4. Make sure the switch is in the on position for your app. 5. run you app again.

Hope this helps you!

TheRealRonDez
  • 2,807
  • 2
  • 30
  • 40
1

I have figured it out, I was using a App bundle different from the one that already I have submitted to Facebook App. Reverting to the correct bundle id solves the problem.

kroky
  • 474
  • 3
  • 11
0

Maybe this helps, in my case the error was caused by the Facebook permissions, which i left as specified in the Parse tutorial. I had the same symptoms, working fine on simulator, not ok on the device which had a Facebook account added through settings.

The original line was
logInController.facebookPermissions = @[ @"friends_about_me" ];

i replaced it with:
[logInViewController setFacebookPermissions:[NSArray arrayWithObjects:@"public_profile", @"email", @"user_friends", nil]];

it s now working properly.

NoMan'sLand
  • 5
  • 1
  • 4