request Facebook friends return empty

女生的网名这么多〃 提交于 2019-12-12 05:17:08

问题


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:


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



来源:https://stackoverflow.com/questions/40064887/request-facebook-friends-return-empty

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!