0

I have two Facebook accounts(friends) and I logged in and authorized my app in both. But when I try to request friends from any of them I get an empty list. Can this be related to the fact that my app still in development?

granted permissions = [AnyHashable("user_friends"), AnyHashable("contact_email"), AnyHashable("email"), AnyHashable("public_profile"), AnyHashable("user_birthday")]

my code:

FBSDKGraphRequest(graphPath: "/me/friends", parameters: nil).start(completionHandler: { (connection, user, requestError) -> Void in
        let userData = user as! NSDictionary
        let friends = userData["data"] as? String

        if requestError != nil {
            print(requestError)
            return
        }

        print(friends) // prints nil
})

Im using Swift 3

toiavalle
  • 414
  • 7
  • 20

1 Answers1

0

let friends = userData["data"] as? [NSDictionary]

toiavalle
  • 414
  • 7
  • 20
  • 2
    is that your own answer or what? don't you feel the need to at least say something more then provide code? – David Seek Oct 15 '16 at 22:50