1

Hi ther I am working on a project for Android and I have a button. When the user press the button I want to give him/her the oportunity to share on facebook. This is the code that I am using:

public void ShareOnFacebook()
{
    List<string> permission = new List<String>();
    permission.Add("publish_actions");

    if(!FB.IsLoggedIn)
        FB.LogInWithPublishPermissions(permission, null);

    FB.FeedShare(
          string.Empty,
          new Uri("http://linktoga.me"),
          "Hello this is the title",
          "This is the caption",
          "Check out this game",
          new Uri("https://i.ytimg.com/vi/NtgtMQwr3Ko/maxresdefault.jpg"),
          string.Empty,
          callback:ShareCallBack
   );

}

void ShareCallBack(IResult result)
{
    if (result.Cancelled)
    {
        Debug.Log("Share Cancelled");
    }
    else if (!string.IsNullOrEmpty(result.Error))
    {
        Debug.Log("Error on share!");
    }
    else if (!string.IsNullOrEmpty(result.RawResult))
    {
        Debug.Log("Success on share");
    }
}

Now the problem is that when I test this on my Android device a Facebook window pops up with a message : "There was a problem. Please try again later". I am using Facebook SDK 7.4.0

Raducu Mihai
  • 313
  • 4
  • 14
  • http://stackoverflow.com/a/22182436/294884 ?? – Fattie Feb 11 '16 at 21:39
  • Ok So I have tryied to make my url's shorter using https://goo.gl/ . But I still have this problem. – Raducu Mihai Feb 11 '16 at 22:00
  • 1
    I found a solution. For those who have the same problem check this links: http://stackoverflow.com/questions/20589213/how-to-enable-disable-sandbox-mode-in-facebook-app – Raducu Mihai Feb 11 '16 at 22:29
  • which solution man - do you mean my one (with all the yellow arrows?) Please tell – Fattie Feb 11 '16 at 22:48
  • 1
    For me, the solution provided by David Hackro worked. – Raducu Mihai Feb 11 '16 at 22:54
  • Excellent. I suggest you answer your own question here (since all FB questions are tricky). Just write a short sentence saying what works. It's OK to answer your own questions on tricky stuff like FB, it helps others. Cheers – Fattie Feb 11 '16 at 23:07
  • Ok so the problem I had was the same as the problem of this OP http://stackoverflow.com/questions/7231939/redirecting-to-authentication-dialog-an-error-occurred-please-try-again-late So the solution was to disable the SandBox Mode of your facebook app. – Raducu Mihai Feb 11 '16 at 23:22

0 Answers0