2

I am currently using the Xamarin.Social component in xamarin forms and when I try to post to Facebook, it gives me an error stating: Share Error: The remote server returned an error: (403) Forbidden", anyone know why I am getting this error and how to fix it? Also twitter posting works perfectly fine, so its just Facebook.

Thank You

user3841879
  • 659
  • 3
  • 12
  • 21

1 Answers1

1

some Troubleshooting for your issue:

  1. You probably already have your ClientID correctly set up. Check it again on https://developers.facebook.com/apps

  2. It took me a while to figure out what to enter as for the RedirectURL. At the moment i am using https://apps.facebook.com/yourappname/. If this is not working for you, go to your App on Facebook Developers Page > Settings > Add Platform > Facebook Canvas > And enter this url as for the "Canvas Page". Authentication should work fine now, and the 403 error should no longer occur.

My working example, for creating the Facebook service:

    public static FacebookService Facebook
    {
        get
        {
            if (mFacebook == null)
            {
                mFacebook = new FacebookService() {
                    ClientId = "<Your App ID from https://developers.facebook.com/apps>",
                    RedirectUrl = new Uri ("https://apps.facebook.com/yourappname/")
                };
            }

            return mFacebook;
        }
    }

For which Platform are you developing? The rest of the share process is just like in the Xamarin.Social IOS Unified sample. Don‘t hesitate to ask for clarification.

Falco Winkler
  • 1,082
  • 1
  • 18
  • 24