Answer the question
In order to leave comments, you need to log in
How to post to Facebook wall from app with facebook-ios-sdk 4.1.0?
Facebook-iOS-SDK 4.1.0 can't post a link to my FB wall.
During authorization I request the rights to @"publish_actions". I log in as one of the users in the application's Roles list on Facebook.
The code is like this:
if ([[FBSDKAccessToken currentAccessToken] hasGranted:@"publish_actions"]) {
[[[FBSDKGraphRequest alloc] initWithGraphPath:@"/me/feed"
parameters: params
HTTPMethod:@"POST"]
startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
if (!error) {
success( result );
} else {
failed( error.description );
}
}];
}
Answer the question
In order to leave comments, you need to log in
Found a problem.
i was trying to send a post to the wall in another thread via dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{}); The Facebook docs say the following:
FBSDKRequestConnection uses NSURLConnection which requires an active RunLoop. If you're using it outside of the main thread you have to manage this yourself.
alternatively, you can set the delegateQueue property on the FBSDKRequestConnection.
How does it leave you if you cannot get publish_actions? Most likely at you the request simply is not executed under a condition. As for the post on the wall, it is not necessary to do this through API requests, it can be done through dialogs or the tool built into iOS, for this you do not need to receive publish_actions.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question