Forum Xamarin Xamarin.Android

Social providers integration in Xamarin.Android

MarkBryanMarkBryan GBUniversity ✭✭

I just trying to add add the Facebook integration with my app in Xamarin.Android. For that I found that there is a Component named as Xamarin.Social then I am trying that. Here is my attempt.

Attempt :-

void btnShare_Click(object sender, EventArgs e)
{
try
{
var facebook = new Xamarin.Social.Services.FacebookService()
{
ClientId = AppId,
RedirectUrl = new System.Uri("http://www.facebook.com/connect/login_success.html")
};

        // 2. Create an item to share
        var item = new Item { Text = "Xamarin.Social is the bomb.com." };

        var shareController = facebook.GetShareUI(this, item, result =>
        {
            if (result.HasFlag(Xamarin.Social.ShareResult.Done))
            {
                Toast.MakeText(this, "Posted", ToastLength.Long).Show();
            }
            if (result.HasFlag(Xamarin.Social.ShareResult.Cancelled))
            {
                Toast.MakeText(this, "Cancelled", ToastLength.Long).Show();
            }
        });
        StartActivity(shareController);
    }
    catch (Exception exp)
    {

    }
}

Note :- Facebook login page is opening successfully.

Error :- But I am getting this Forbidded(403) error. the point is this error is not reaching to catch block , but it is shown in a toast notification. so no further details are available.

Does anybody explored this component successfully ?

Any help is appreciated :)

Sign In or Register to comment.