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

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -