Posting photos to Facebook fan page with iOS SDK

Ater successfully login to Facebook, you can get list FanPage by requesting @”/me/accounts” and iterate to the fan page you want and request its accessToken by making request to @"/FBFanPageID?fields=access_token"

This accessToken is different from your facebook.accesstoken .

After getting fanPage accessToken, set it as facebook accessToken by

[_facebook setAccessToken:_accessTokenForFanPage]; // this is necc step

Now you can upload to fanPage wall by @"/FBFanPageID/photos"

Request fanPage albums by @"/FBFanPageID/albums"

Upload to particular album by @"/AlbumsID/photos"

For uploading these image param dictionary will be used.

NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
IMAGE,@"source",
IMAGECAPTION,@"message",
nil];

Leave a Comment