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
Post a Comment