0
votes

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

1

1 Answers

0
votes

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