I am in front of the following problem, when trying to send a message using Facebook, from my iOS ap. I use this code as usual:
SLComposeViewController *facebkController = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];
…..
[facebkController addURL:[NSURL URLWithString:appLinkStr]];
…..
I get to the point where Facebook is launched without any problem. But when I tap the Post button (in Facebook); I get the following message: Cannot Post To Facebook The post cannot be sent because the connection to Facebook failed.
By searching the net I have been able to see that I am not the first one to hit this issue. Nevertheless I did not find any working solution.
By trial and errors I have been able to understand that:
*) The problem seems to be related to the contents of my message. Indeed when I take off the line:
[facebkController addURL:[NSURL URLWithString:appLinkStr]];
It sometimes works. Similarly when I change the text of the message it sometimes works.
*) Two factors seem to be causing the problem. One is the presence of the addURL: and the other one (in case there is no addURL:) is the fact of sending the same message.
I noticed this issue only very recently, everything was working with no problem before. I do not know if it is due to a change I made in my code or to something else.