ios - Not getting photos from Facebook -


i want fetch photos facebook account. unable fetch it. whenever request empty array.

 @ibaction func sharefacebook(sender: fbsdkloginbutton) {         sender.readpermissions = ["public_profile", "email", "user_friends"]         sender.delegate = self         sender.loginbehavior = .native     }  //delegate method  func loginbutton(loginbutton: fbsdkloginbutton!, didcompletewithresult result: fbsdkloginmanagerloginresult!, error: nserror!)     {         print(result.token)        fbsdkgraphrequest.init(graphpath: "me/photos", parameters: ["fields":"age_range,name,first_name, last_name, picture.type(large)"], httpmethod: "get").startwithcompletionhandler { (con, res, err) in         print(res)         } }  //output = <fbsdkaccesstoken: 0x12fea99a0> {     data =     (     ); } 

/me/photos requires permission user_photos. make sure authorize user permission:

sender.readpermissions = ["public_profile", "email", "user_friends", "user_photos"] 

if still not work, make sure trying app admin , read login review: https://developers.facebook.com/docs/facebook-login/review

also, /me/photos endpoint not have fields age_range, name, first_name , on. /me endpoint only.


Comments

Popular posts from this blog

ruby on rails - Permission denied @ sys_fail2 - (D:/RoR/projects/grp/public/uploads/ -

c++ - nodejs socket.io closes connection before upgrading to websocket -

java - What is the equivalent of @Value in CDI world? -